← All problemsSign in

Partially Increasing Array Queries

CodeChefRating 2806Open on judge ↗

An array $B$ of size $M$ is called *partially increasing* if there exists an index $i$ such that: - $ 1 \lt i \lt M $ - $ B_{i - 1} \leq B_i \leq B_{i + 1} $ For example, $[1, 2, 4, 8], [1, 2, 8, 4], $ and $[7, 6, 5, 5, 7]$ are partially increasing, while $[1, 2, 1, 3], [1, 2], $ and $[7, 6, 5, 6]$ are not. You are given an array $A$ of size $N$, and $Q$ queries each containing a pair of integer

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