设 $A=\left(\begin{array}{ll}1 & 2 \\ 2 & 1\end{array}\right)$ ,则在实数域上与 $A$ 合同的矩阵为
A. $\left(\begin{array}{cc}-2 & 1 \\ 1 & -2\end{array}\right)$
B. $\left(\begin{array}{cc}2 & -1 \\ -1 & 2\end{array}\right)$
C. $\left(\begin{array}{ll}2 & 1 \\ 1 & 2\end{array}\right)$
D. $\left(\begin{array}{cc}1 & -2 \\ -2 & 1\end{array}\right)$