设矩阵 $A =\left(\begin{array}{ccc}1 & 1 & 1 \\ 1 & 2 & a \\ 1 & 4 & a^2\end{array}\right), b =\left(\begin{array}{c}1 \\ d \\ d^2\end{array}\right)$, 若集合 $\Omega=\{1,2\}$, 则线性方程组 $A x = b$ 有无穷多解的充分必要条件为
$\text{A.}$ $a \notin \Omega, d \notin \Omega$.
$\text{B.}$ $a \notin \Omega, d \in \Omega$.
$\text{C.}$ $a \in \Omega, d \notin \Omega$.
$\text{D.}$ $a \in \Omega, d \in \Omega$.