Symmetric Stones
CodeChefOpen on judge ↗
The Spirit of the Sea has held you captive and has agreed to release you if you can do him a favor. The Spirit has given you N numbered pebbles A[i] in a series, one after the other. He said that you can choose any random integers X and Y such that 1<=X<=Y<=N, and you can rearrange the pebbles whose indices i fall within the range (X,Y) (both inclusive) (X<=i<=Y) any way you like such that the E
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.
Sign in to chat with the tutor and save your progress.
Sign in to start