← All problemsSign in

Lottery Tickets

CodeChefRating 1520Open on judge ↗

There were $N$ lottery tickets with numbers $A_i$. Each number was distinct. Chef bought the first ticket, i.e. $A_1$. He is now wondering whether he won the lottery. Here is how the winner is decided: - A number $X$ is decided in the range $[1, 10^{6}]$, and then whoever has the closest ticket to $X$ wins the lottery. If there is a tie, all of them are winners. How many numbers $X$ exist such

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