2. Equation
$$
x^{2}-31 x+220=2^{x}\left(31-2 x-2^{x}\right)
$$

The sum of the squares of all real roots is $\qquad$ .
2. 25 .

Let $y=x+2^{x}$. Then the original equation is equivalent to
$$
\begin{array}{l}
y^{2}-31 y+220=0 \\
\Rightarrow y_{1}=11, y_{2}=20 \\
\Rightarrow x_{1}+2^{x_{1}}=11 \text { and } x_{2}+2^{x_{2}}=20 .
\end{array}
$$

Since $f(x)=x+2^{x}$ is a monotonically increasing function, each equation has at most one real root, which are $3$ and $4$, respectively. Therefore, the sum of the squares of all real roots of the original equation is 25.