$12 \cdot 1$ There is a pile of 100 small weights, with a total weight of 500 grams. It is known that there are only 1-gram, 10-gram, and 50-gram weights. In this pile of weights, how many of each type of weight are there?
（9th All-Russian Mathematical Olympiad, 1983）
[Solution] Let the number of 1g, 10g, and 50g weights be $x$, $y$, and $z$ respectively. From the problem, we get the system of equations
$$
\left\{\begin{array}{l}
x+y+z=100, \\
x+10 y+50 z=500 .
\end{array}\right.
$$

Eliminating $x$ gives
$$
\begin{array}{c}
9 y+49 z=400, \\
9(y+5 z)=4(100-z) .
\end{array}
$$

From this, we can deduce
$$
4 \mid y+5 z \text {. }
$$

Let $y+5 z=4 t, t \in \mathbb{Z}$, then
$$
\begin{array}{l}
100-z=9 t, \\
z=100-9 t, \\
y=4 t-5 z=49 t-500 .
\end{array}
$$

By $y \geqslant 1, z \geqslant 1$, we get
$$
10<\frac{501}{49} \leqslant t \leqslant 11 .
$$

Thus, $t=11, z=1, y=39, x=60$.
Therefore, in this pile of weights, there are 60 of 1g, 39 of 10g, and 1 of 50g.