← All problemsSign in

Nice SubSegments

CodeChefRating 2344Open on judge ↗

Let's call arrays of the form x x+1 ... x+k nice. In other words nice arrays are arrays that form increasing arithmetic progression with the difference of one. You are given an array of N integers. Let's denote it's numbers by a1, a2, ..., aN. You are also given M change queries. Every change query is a query of the form "X Y" with the meaning that the X-th number in it becomes equal to Y. We pe

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start