5. Let $a_{1}=1, a_{n+1}=2 a_{n}+n^{2}$, then the general term formula $a_{n}$ is
A. $7 \times 2^{n-1}-n^{2}-2 n-3$
B. $5 \times 2^{n}-n^{2}-4 n-5$
C. $7 \times 2^{n-1}-3 n^{2}-2 n-1$
D. $5 \times 2^{n}-4 n^{2}-5 n-1$
5. Let $a_{n}=b_{n}+s n^{2}+t n+k(s, t, k$ be undetermined constants), then $b_{n+1}+s(n+1)^{2}+t(n+1)+k=2 b_{n}+2 s n^{2}+2 t n+2 k+n^{2}$,
which means $b_{n+1}=2 b_{n}+(s+1) n^{2}+(t-2 s) n+k-t-s$. Let $\left\{\begin{array}{l}s+1=0, \\ t-2 s=0, \\ k-t-s=0 .\end{array}\right.$ Solving, we get $\left\{\begin{array}{l}s=-1, \\ t=-2, \\ k=-3 .\end{array}\right.$
Therefore, $b_{n}=7 \times 2^{n-1}$.
Thus, $a_{n}=7 \times 2^{n-1}-n^{2}-2 n-3$. Hence, the answer is A.