5. $\sum_{i=0}^{1009}(2 k+1)-\sum_{i=1}^{1009} 2 k=(\quad)$.
(A) -1010
(B) -1009
(C) 1008
(D) 1009
(E) 1010
5. E.

Rearrange the given expression as
$$
\begin{array}{l}
1+(3-2)+(5-4)+\cdots+ \\
(2017-2016)+(2019-2018) \\
=1+1+\cdots+1,
\end{array}
$$

where the number of 1's is the number of terms in the sequence $\{1,3, \cdots, 2019\}$. Therefore, the answer is 1010.