5. Three people, A, B, and C, are playing a game. Each of them writes 100 different Chinese characters, and then they compare the characters written by each person. If a character is written by at least two people, it is deleted until there are no more identical characters. A, B, and C deleted 31, 27, and 39 characters, respectively. If from the 300 characters written by these three people, the maximum number of different characters that can be selected is $\mathrm{m}$, then the minimum value of $\mathrm{m}$ is ( ).
(A) 228
(B) 240
(C) 242
(D) 243
5.C.

Suppose there are $a$ Chinese characters that are the same for all three people, $b$ Chinese characters that are the same only for person A and B, $c$ Chinese characters that are the same only for person A and C, and $d$ Chinese characters that are the same only for person B and C. From the problem, we have:
$$
\left\{\begin{array}{l}
a+b+c=31, \\
a+b+d=27, \\
a+c+d=39 .
\end{array}\right.
$$
(1) - (2) gives $d=c-4$.
(2) - (3) gives $b=c-12$.

Thus, $a=43-2c$.
To satisfy $\left\{\begin{array}{l}a \geqslant 0, \\ b \geqslant 0, \\ c \geqslant 0, \\ d \geqslant 0,\end{array}\right.$ we have $\left\{\begin{array}{l}43-2c \geqslant 0, \\ c-12 \geqslant 0, \\ c \geqslant 0, \\ c-4 \geqslant 0 .\end{array}\right.$

Solving this, we get $12 \leqslant c \leqslant 21.5$.
Thus, the minimum value of $c$ is 12, and the maximum value is 21.
Therefore, the maximum number of different Chinese characters that can be selected is
$$
\begin{array}{l}
m=300-2a-b-c-d \\
=300-2(43-2c)-(c-12)-c-(c-4) \\
=230+c \geqslant 242 .
\end{array}
$$