Tap here to switch tabs
Problem
Submissions

Problem: Divisor Game

med
30 min
Try to solve the Divisor Game problem.

Statement

Alice and Bob play a game, with Alice taking the first turn.

Initially, an integer n is given. On each player’s turn, that player performs the following steps:

  1. Chooses an integer x such that 0<0 < x << n and n \\% x =0= 0.

  2. Replaces the current number n with n −- x.

If a player cannot make a move, they lose the game.

Return true if Alice wins the game assuming both players play optimally, and false otherwise.

Constraints:

  • 1≤1 \leq n ≤1000\leq 1000

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Divisor Game

med
30 min
Try to solve the Divisor Game problem.

Statement

Alice and Bob play a game, with Alice taking the first turn.

Initially, an integer n is given. On each player’s turn, that player performs the following steps:

  1. Chooses an integer x such that 0<0 < x << n and n \\% x =0= 0.

  2. Replaces the current number n with n −- x.

If a player cannot make a move, they lose the game.

Return true if Alice wins the game assuming both players play optimally, and false otherwise.

Constraints:

  • 1≤1 \leq n ≤1000\leq 1000