5. Given two sets of real numbers $A=\left\{a_{1}, a_{2}, \cdots, a_{100}\right\}$ and $B=\left\{b_{1}, b_{2}, \cdots, b_{50}\right\}$, if the mapping $f$ from $A$ to $B$ makes each element in $B$ have a preimage, and $f\left(a_{1}\right) \leqslant f\left(a_{2}\right) \leqslant \cdots \leqslant f\left(a_{100}\right)$, then the number of such mappings is
A. $C_{100}^{50}$
B. $C_{99}^{50}$
C. $C_{100}^{49}$
D. $C_{99}^{49}$
This problem is equivalent to finding the positive integer solutions of $x_{1}+x_{2}+\cdots+x_{50}=100$, which means placing 100 balls into 50 boxes such that no box is empty. The result is $C_{99}^{49}$, so the answer is $D$.