← All problemsSign in

Playing Game with Jaya Surya

Jaya Surya is a naughty guy in CEG. He always plays games only with girls. One day a conflict arose between him and his girlfriend about the winner in the next game. The game is described as follows. Initially there are K coins in the pile. There is an array of N integers a1, a2,...aN. The game is played in turns. In each turn, the player can take away ai coins (1Input - The first line of the inp

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