公式

A - Four Coloring 解説 by evima


Let \(Y\) be the grid obtained by replacing \(1,2,3,4\) in \(X\) with \(2,4,1,3\), respectively.

Then, pairs that had a difference of \(1\) in \(X\) will have a difference of \(2\) or more in \(Y\), and pairs that had a difference of \(2\) or more in \(X\) will have a difference of \(1\) in \(Y\).

Therefore, this is a valid solution.

投稿日時:
最終更新: