Four, (50 points) In an $n \times n$ grid, fill each cell with one of the numbers 1 to $n^{2}$. If no matter how you fill it, there must be two adjacent cells where the difference between the two numbers is at least 1011, find the minimum value of $n$.

---

The translation preserves the original text's formatting and structure.
Four, take the row $l$ where the number 1 is located and the column $t$ where the number $n^{2}$ is located, and approach $n^{2}$ sequentially along row $l$ and column $t$ from 1. Assume the numbers filled in the small grids passed through are $a_{1}, a_{2}, \cdots, a_{k}$.
From Figure 5, we know $k \leqslant 2 n-3$.
Then make the sum
$$
\begin{array}{l}
\left|1-a_{1}\right|+\left|a_{1}-a_{2}\right|+\left|a_{2}-a_{3}\right|+\cdots+ \\
\left|a_{k-1}-a_{k}\right|+\left|a_{k}-n^{2}\right| \\
\geqslant \mid\left(1-a_{1}\right)+\left(a_{1}-a_{2}\right)+\left(a_{2}-a_{3}\right)+\cdots+ \\
\quad\left(a_{k-1}-a_{k}\right)+\left(a_{k}-n^{2}\right) \mid \\
=n^{2}-1 .
\end{array}
$$

By the pigeonhole principle, we know that among
$$
\left|a_{i}-a_{i+1}\right|\left(a_{0}=1, a_{k+1}=n^{2}, i=0,1, \cdots, k\right)
$$

the $k+1$ positive integers, at least one number is not less than
$$
\left[\frac{n^{2}-1}{k+1}\right]+1 \text {, and } k+1 \leqslant 2 n-2 \text {. }
$$

According to the problem, we have
$$
\begin{array}{l}
\frac{n^{2}-1}{k+1} \geqslant \frac{n^{2}-1}{2 n-2}>1011-1 \\
\Rightarrow n>2019 .
\end{array}
$$

Therefore, the minimum value of $n$ is 2020.
(Xie Wenxiao, Huanggang High School, Hubei Province, 438000)