LuckyLand Lottery
CodeChefOpen on judge ↗
LuckyLand is a very lucky country. There are many state sanctioned lotteries and every citizen wins it at least once. Until every person wins it once, none can win it again. Winners are selected in the following manner: If it has a population of N, numbered from 1 to N, starting from a random number P, every second person wins the lottery in the round. In the next round, the lottery winning starts
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