Problem

Source: Ukraine MO 2021 8.7

Tags: combinatorics, game



Andriy and Bogdan take turns putting integers from $1$ to $n$ inclusive in the cells of an $n \times n$ board in such a way that no row or column contains two equal numbers. Andriy begins, and the player who cannot make a move loses. Depending on $n$, which player has a winning strategy? Proposed by Fedir Yudin