12. For a positive integer $n \leqslant 500$, it has the property: when an element $m$ is randomly selected from the set $\{1,2, \cdots, 500\}$, the probability that $m \mid n$ is $\frac{1}{100}$. Then the maximum value of $n$ is $\qquad$
12. 81 .

From the problem, we know that $n$ has exactly 5 positive divisors. Let the prime factorization of $n$ be $n=p_{1}^{\alpha_{1}} p_{1}^{\alpha_{2}} \cdots p_{k}^{\alpha_{k}}$.
Then the number of positive divisors of $n$ is
$$
\left(\alpha_{1}+1\right)\left(\alpha_{2}+1\right) \cdots\left(\alpha_{k}+1\right)=5 \text {. }
$$

Therefore, $n$ must be of the form $p^{4}$ (where $p$ is a prime number).
Since $3^{4}=81,5^{4}=625>500$, the maximum value of $n$ is 81.