12. (18 points) Let $n (n \geqslant 11)$ be a positive integer. The set $A$ consists of the sums of 10 consecutive positive integers not greater than $n$, and the set $B$ consists of the sums of 11 consecutive positive integers not greater than $n$. If the number of elements in $A \cap B$ is 181, find the maximum and minimum values of $n$.
12. Clearly,
\[
\begin{array}{l}
A=\{55+10 k \mid k=0,1, \cdots, n-10\}, \\
B=\{66+11 l \mid l=0,1, \cdots, n-11\} .
\end{array}
\]

To find the number of elements in \( A \cap B \), let
\[
55+10 k=66+11 l \text{. }
\]

Then \( 10 k=(l+1) 11 \).
Let \( k=11 m \). Then \( l=10 m-1 \).
Since \( 0 \leqslant k \leqslant n-10 \), \( m \) can take values 0, 1, \(\cdots, \left[\frac{n-10}{11}\right]\), at this time, the corresponding values of \( l \) are
\[
-1, 9, \cdots, 10\left[\frac{n-10}{11}\right]-1 \text{. }
\]

Notice that,
\[
10\left[\frac{n-10}{11}\right]-1 \leqslant 10 \cdot \frac{n-10}{11}-1 \leqslant n-11 \text{. }
\]

It is easy to see that the number of elements in \( A \cap B \) is \( \left[\frac{n-10}{11}\right] \).
Let \( 181=\left[\frac{n-10}{11}\right] \). Then
\[
\begin{array}{l}
181 \leqslant \frac{n-10}{11}<182 \\
\Rightarrow 2001 \leqslant n<2012 .
\end{array}
\]

Thus, the maximum and minimum values of \( n \) are 2011 and 2001, respectively.