Clever Priest
CodeChefOpen on judge ↗
Its festival time and a priest is the head of distributing prasad (sweets). But he is very clever and want to test children. So he gives them a binary string of $N$ characters (initially all characters are **0**). In the binary string, $1$ denotes prasad and $0$ denotes no prasad. He asks them to process total $N$ queries. In each query, they have to choose a number $M$ such that $1 \leq M \leq
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