1. Given arrays $\left(a_{1}, a_{2}, \cdots, a_{n}\right)$ and $\left(b_{1}, b_{2}, \cdots, b_{n}\right)$ are both permutations of $1,2, \cdots, n$. Then
$$
a_{1} b_{1}+a_{2} b_{2}+\cdots+a_{n} b_{n}
$$

the maximum value is
$$
-1 . \frac{n(n+1)(2 n+1)}{6} \text {. }
$$

Notice that, $1<2<\cdots<n$.
By the rearrangement inequality, we know that when $a_{i}=b_{i}=i(i=1,2, \cdots, n)$, the value of the sum $a_{1} b_{1}+a_{2} b_{2}+\cdots+a_{n} b_{n}$ is the maximum. At this time,
$$
\begin{array}{l}
a_{1} b_{1}+a_{2} b_{2}+\cdots+a_{n} b_{n}=1^{2}+2^{2}+\cdots+n^{2} \\
=\frac{n(n+1)(2 n+1)}{6} .
\end{array}
$$