Ddakji
CodeChefOpen on judge ↗
The Salesman is playing Ddakji with Seong Gi-Hun. There are $N$ cardboards kept at distinct positions, the $i^{th}$ of which can be flipped **$A_{i}$ times only** in each game. Gi-Hun gets $100$ $won$ with each flip. He has to play the game $Q$ times and can select a series of **consecutive** positions to flip the cardboard kept at those positions . The Salesman being clever, has already decid
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