Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Divisor Game

Alice and Bob alternate turns starting with Alice on a number n. A move picks x with 0 < x < n and n % x == 0 and replaces n with n - x. The player who cannot move loses. Print true if Alice wins.

Constraints

1 <= n <= 1000

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.