10. (2006 Polish Mathematical Olympiad) Given a prime number $p$ and a positive integer $n(p \geqslant n \geqslant 3)$. The set $A$ consists of sequences of length $n$ whose elements are taken from the set $\{1,2, \cdots, p\}$. If for any two sequences $\left(x_{1}, x_{2}, \cdots, x_{n}\right)$ and $\left(y_{1}, y_{2}, \cdots, y_{n}\right)$ in the set $A$, there exist three distinct positive integers $k, l, m$, such that $x_{k} \neq y_{k}, x_{l} \neq y_{l}, x_{m} \neq y_{m}$. Find the maximum number of elements in the set $A$.
10. The maximum number of elements in set $A$ is $p^{n-2}$.

It is easy to see that the first $n-2$ components of any two different sequences in set $A$ are not all the same (otherwise, these two sequences would differ in at most 2 components, which is a contradiction). Each component has $p$ possible values, thus,
$$
|A| \leqslant p^{n-2} \text {. }
$$

On the other hand, let one of the sequences in $A$ be $\left(x_{1}, x_{2}, \cdots, x_{n}\right)$, where the first $n-2$ components take all $p^{n-2}$ different values, and
$$
x_{n-1} \equiv \sum_{i=1}^{n-2} x_{i}(\bmod p), x_{n} \equiv \sum_{i=1}^{n-2} i x_{i}(\bmod p) .
$$

This yields a set $A$ with $p^{n-2}$ elements.
We now prove that this set $A$ meets the requirements.
For any two different sequences in $A$: $X=\left(x_{1}, x_{2}, \cdots, x_{n}\right)$ and $Y=\left(y_{1}, y_{2}, \cdots, y_{n}\right)$, we have
$$
\left(x_{1}, x_{2}, \cdots, x_{n-2}\right) \neq\left(y_{1}, y_{2}, \cdots, y_{n-2}\right) \text {. }
$$

If $\left(x_{1}, x_{2}, \cdots, x_{n-2}\right)$ and $\left(y_{1}, y_{2}, \cdots, y_{n-2}\right)$ differ in at least 3 corresponding components, then $X$ and $Y$ differ in at least 3 corresponding components.
If $\left(x_{1}, x_{2}, \cdots, x_{n-2}\right)$ and $\left(y_{1}, y_{2}, \cdots, y_{n-2}\right)$ differ in exactly 2 corresponding components, i.e., there exist $k, l(1 \leqslant k<l \leqslant n-$
2), such that
$$
x_{k} \neq y_{k}, x_{l} \neq y_{l} .
$$

Assume at this point $x_{n-1}=y_{n-1}, x_{n}=y_{n}$, then
$$
\begin{array}{l}
x_{k}+x_{l} \equiv y_{k}+y_{l}(\bmod p), \\
k x_{k}+l x_{l} \equiv k y_{k}+l y_{l}(\bmod p) .
\end{array}
$$
(2) $-k \times$ (1) gives
$(l-k) x_{l}=(l-k) y_{l}(\bmod p)$.
Since $1 \leqslant l-k<p$, i.e., $(p, l-k)=1$, we have
$x_{l} \equiv y_{l}(\bmod p)$.
Thus, $x_{l}=y_{l}$, which is a contradiction.
Therefore, $X$ and $Y$ differ in at least 3 corresponding components.
If $\left(x_{1}, x_{2}, \cdots, x_{n-2}\right)$ and $\left(y_{1}, y_{2}, \cdots, y_{n-2}\right)$ differ in only 1 corresponding component, i.e., there exists $k(1 \leqslant k \leqslant n-2)$, such that
$x_{k} \neq y_{k}$.
Then, by $1 \leqslant\left|y_{k}-x_{k}\right|<p(1 \leqslant k<p)$, we get
$y_{n-1}-x_{n-1} \equiv y_{k}-x_{k} \neq 0(\bmod p)$,
$y_{n}-x_{n} \equiv k\left(y_{k}-x_{k}\right) \not \equiv 0(\bmod p)$.
Therefore, $y_{n-1} \neq x_{n-1}, y_{n} \neq x_{n}$, in this case, $X$ and $Y$ also differ in 3 corresponding components.
In summary, the maximum number of elements in the set $A$ is $p^{n-2}$.