Problem

Source: All-Russian MO 2023 Final stage 11.3

Tags: combinatorics



In every row of a grid $100 \times n$ is written a permutation of the numbers $1,2 \ldots, 100$. In one move you can choose a row and swap two non-adjacent numbers with difference $1$. Find the largest possible $n$, such that at any moment, no matter the operations made, no two rows may have the same permutations.