← All problemsSign in

Game Problem

Alice and Bob have an array a of n integers. They decide to play a game with the array. In one move, - One must choose an index i such that $a_i$ >0 . After that, he sets the value of $a_i$ to 0. Alice and Bob make alternating moves: Alice makes the first move, Bob makes the second move, Alice makes the third one, and so on. If a player can't make any move, he/she loses. Who will win if both play

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