← All problemsSign in

Ancient Magic

CodeChefRating 3439Open on judge ↗

There is a game played on a one-dimensional axis. $N$ stones will appear on this axis. Each of these stones is described by three numbers $x_i$, $t_i$, $c_i$, meaning the stone will appear at a point $x_i$, at time $t_i$, and has a value $c_i$. There are $p$ players initially (at time $0$) all at the point $0$. If a player is at a point $x$ at time $t$, then at time $t + 1$, he/she can be either

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