Skip to content
We areTOP 1%

GameGame

HardRating 1900CodeforcesGame Theory
Solve on Codeforces(opens in a new tab)
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews
Approach hintTry it first, then reveal

If the total XOR is zero, the game is a draw. Otherwise only the highest set bit of the total matters: count the elements having that bit and the others, then reason about parity, where the count modulo 4 decides the outcome.

More in Game Theory

Game Theory questions
#ProblemPlatformDifficultyOpen1st1st Visit2nd2nd VisitRevRevise
1Stone Game IIILeetCodeHard Solve Stone Game III on LeetCode (opens in a new tab)
21-2-K GameCodeforcesMedium 1700Solve 1-2-K Game on Codeforces (opens in a new tab)
3Stoned GameCodeforcesHard 1800Solve Stoned Game on Codeforces (opens in a new tab)
4A Lot of GamesCodeforcesHard 1900Solve A Lot of Games on Codeforces (opens in a new tab)
5GameGameCodeforcesHard 1900Solve GameGame on Codeforces (opens in a new tab)
6Tree TagCodeforcesHard 1900Solve Tree Tag on Codeforces (opens in a new tab)
7Cat and MouseLeetCodeHard Solve Cat and Mouse on LeetCode (opens in a new tab)
8Not a Nim ProblemCodeforcesHard 2100Solve Not a Nim Problem on Codeforces (opens in a new tab)
9Lieges of LegendreCodeforcesHard 2200Solve Lieges of Legendre on Codeforces (opens in a new tab)

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account