12. Determine the number of distinct integers among the numbers
$$
\left\lfloor\frac{1^{2}}{2007}\right\rfloor,\left\lfloor\left\lfloor\frac{2^{2}}{2007}\right\rfloor, \quad \cdots \quad,\left\lfloor\frac{2007^{2}}{2007}\right\rfloor .\right.
$$
12. Ans: 1506
Let $a_{i}=\left\lfloor i^{2} / 2007\right\rfloor$. Note that $\frac{(n+1)^{2}}{2007}-\frac{n^{2}}{2007}=\frac{2 n+1}{2007} \leq 1$ if and only if $n \leq$ $2006 / 2=1003$. Since, $a_{1}=0$, and $a_{1003}=501$, we see that $a_{1}, \ldots, a_{1003}$ assume all the values from 0 to 501 . We also conclude that $a_{1004}, \ldots, a_{2007}$ are mutually distinct integers. Therefore, the answer is $502+1004=1506$.