Example 3 (2003 Beijing Competition Problem) Given $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_{i}$ 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 a positive 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}$. Proceeding similarly, we have
$$
\begin{array}{l}
a<\underbrace{a+2 a_{1}<a+2 a_{2}<\cdots<a+2 a_{n}}_{n \uparrow} \\
<\underbrace{a+1 \uparrow}_{n+2 a_{n}+2 a_{1}<\cdots<a+2 a_{n}+2 a_{n-1}} \\
<\underbrace{a+2 \uparrow}_{n-2 a_{n}+2 a_{n-1}+2 a_{1}<\cdots<a+2 a_{n}+2 a_{n-1}+2 a_{n-2}} \\
<\cdots \\
<\underbrace{a+2 a_{n}+\cdots+2 a_{3}+2 a_{1}<a+2 a_{n}+\cdots+2 a_{3}+2 a_{2}}_{1 \uparrow} \\
<\underbrace{a+2 a_{n}+2 a_{n-1}+\cdots+2 a_{2}+2 a_{1}}_{2 \uparrow} \\
=a+2\left(a_{1}+a_{2}+\cdots+a_{n}\right) \\
=a_{1}+a_{2}+\cdots+a_{n} .
\end{array}
$$

Each of the integers in the above sequence 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$). They total
$$
1+n+(n-1)+(n-2)+\cdots+2+1=1+\frac{n(n+1)}{2}=\frac{n^{2}+n+2}{2}
$$

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.