Five. (15 points) Suppose there are $n$ distinct positive integers $a_{1}, a_{2}$, $\cdots, a_{n}$. Then among the integers of the form $t_{1} a_{1}+t_{2} a_{2}+\cdots+t_{n} a_{n}$ (where $t_{1}$ takes 1 or $-1, i=1,2, \cdots, n)$, there exist $\frac{n^{2}+n+2}{2}$ distinct integers that are either all odd or all even.
Let's assume $a_{1}<a_{2}<\cdots<a_{n}$, then $a=-a_{1}-a_{2}-\cdots-a_{n}$ is the smallest integer of the form $t_{1} a_{1}+t_{2} a_{2}+\cdots+t_{n} a_{n}$. $a+2 a_{1}=a_{1}-a_{2}-\cdots-a_{n}$ is also an integer of the form $t_{1} a_{1}+t_{2} a_{2}+\cdots+t_{n} a_{n}$. Generally, $a+2 a_{1}+2 a_{2}$ is also an integer of the form $t_{1} a_{1}+t_{2} a_{2}+\cdots+t_{n} a_{n}$. And so on, then
$$
\begin{array}{l}
\underset{1 \uparrow}{a}<\underbrace{a+2 a_{1}<a+2 a_{2}<\cdots<a+2 a_{n}}_{n \uparrow} \\
<\underbrace{a+2 a_{n}+2 a_{1}<\cdots<a+2 a_{n}+2 a_{n-1}}_{n-1 \uparrow} \\
<\underbrace{a+2 a_{n}+2 a_{n-1}+2 a_{1}<\cdots<a+2 a_{n}+2 a_{n-1}+2 a_{n-2}}_{n-2 \uparrow} \\
<\cdots<\underbrace{a+2 a_{n}+\cdots+2 a_{3}+2 a_{1}<a+2 a_{n}+\cdots+2 a_{3}+2 a_{2}}_{2} \\
<\underbrace{a+2 a_{n}+2 a_{n-1}+\cdots+2 a_{2}+2 a_{1}}_{1} \\
=a+2\left(a_{1}+a_{2}+\cdots+a_{n}\right) \\
=a_{1}+a_{2}+\cdots+a_{n} \text {. } \\
\end{array}
$$

Each integer in the above expression is a different number of the form $t_{1} a_{1}+t_{2} a_{2}+\cdots+t_{n} a_{n}$ (where $t_{i}$ is 1 or -1, $i=1,2, \cdots, n$). There are
$$
\begin{array}{l}
1+n+(n-1)+(n-2)+\cdots+2+1 \\
=1+\frac{n(n+1)}{2}=\frac{n^{2}+n+2}{2}
\end{array}
$$

distinct numbers.
It is easy to see that when $a$ is even, these $\frac{n^{2}+n+2}{2}$ distinct integers are all even; when $a$ is odd, these $\frac{n^{2}+n+2}{2}$ distinct integers are all odd.