← CSES Better
Open official problem ↗Sum Range-Max Operation Scores over Subarrays
ZIO · 2026 · Zonal Informatics Olympiad · P4
Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktoparrays · range-operations · subarrays
The organizer’s problem statement is available at the official source link.
range overlays
Build a profile with interval maximum overlays
An operation sets each value in [L,R] to at least v; score each array by the fewest operations, then sum scores over subarrays.
| L | -> | R |
| v | v | v |
| C[i] = max(C[i], v) |
- 1
View interval layers
View each operation as a horizontal interval layer at height v. - 2
Rebuild each subarray
Layers combine pointwise by maximum to form the target subarray. - 3
Sum minimum operation counts
Find the minimum layer count per subarray and sum all scores.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 charsRun output
Run your code to see output.