8. Let $p$ be a prime number, and $A$ be a set of positive integers, satisfying the following conditions:
(1) The set of prime factors of the elements in $A$ contains $p-1$ elements;
(2) For any non-empty subset of $A$, the product of its elements is not a $p$-th power of an integer.
Find the maximum number of elements in $A$.
(Iran provided)
Solution: The maximum value is $(p-1)^{2}$.
Let $r=p-1$, and assume the distinct primes are $p_{1}$, $p_{2}, \cdots, p_{r}$, define
$$
B_{i}=\left\{p_{i}, p_{i}^{p+1}, p_{i}^{2 p+1}, \cdots, p_{i}^{(r-1) p+1}\right\} .
$$

Let $B=\bigcup_{i=1}^{\prime} B_{i}$, then $B$ has $r^{2}$ elements, and satisfies conditions (1) and (2).

Assume $|A| \geqslant r^{2}+1$, and $A$ satisfies conditions (1) and (2). We will prove that the product of elements in a non-empty subset of $A$ is a $p$-th power of an integer, leading to a contradiction.

Let $p_{1}, p_{2}, \cdots, p_{r}$ be $r$ distinct primes, such that each $t \in A$ can be expressed as $t=p_{1}^{a} p_{2}^{a} \cdots p_{r}^{a}$. Let $t_{1}, t_{2}, \cdots, t_{r}^{2}+1$ $\in A$, for each $i$, denote the vector of the powers of the prime factors of $t_{i}$ as $\boldsymbol{v}_{i}=\left(\alpha_{11}, \alpha_{12}, \cdots, \alpha_{4}\right)$. We will prove that the sum of some vectors $\boldsymbol{v}_{i}$ modulo $p$ is the zero vector, thus the conclusion holds.
To do this, we only need to prove that the following system of congruences has a non-zero solution.
$$
\begin{array}{l}
F_{1}=\sum_{i=1}^{r^{2}+1} \alpha_{i 1} x_{i}^{r} \equiv 0(\bmod p), \\
F_{2}=\sum_{i=1}^{t^{2}+1} \alpha_{i 2} x_{i}^{\prime} \equiv 0(\bmod p), \\
\cdots \cdots . \\
F_{r}=\sum_{i=1}^{t^{2}+1} \alpha_{i} x_{i}^{\prime} \equiv 0(\bmod p) .
\end{array}
$$

In fact, if $\left(x_{1}, x_{2}, \cdots, x_{2}+1\right)$ is a non-zero solution to the above system of congruences, since $x_{i}^{\prime} \equiv 0$ or $1(\bmod p)$, there must be some vectors $\boldsymbol{v}_{1}$ (satisfying $x_{1}^{\prime} \equiv 1(\bmod p)$ for some $i$) whose sum modulo $p$ is the zero vector.

To prove that the above system of congruences has a non-zero solution, we only need to prove that the congruence
$$
F=F_{1}^{\prime}+F_{2}^{\prime}+\cdots+F_{r}^{\prime} \equiv 0(\bmod p)
$$

has a non-zero solution.
Since each $F_{1}^{r} \equiv 0$ or $1(\bmod p)$, the congruence (1) is equivalent to $F_{t}^{\prime} \equiv 0(\bmod p), 1 \leqslant i \leqslant r$. Since $p$ is a prime, $F_{t}^{\prime} \equiv 0(\bmod p)$ is equivalent to $F_{1} \equiv 0(\bmod p), 1 \leqslant i \leqslant r$.

We will prove that the number of solutions to the congruence (1) is divisible by $p$. For this, we only need to prove
$$
\sum F^{\prime}\left(x_{1}, x_{2}, \cdots, x_{t_{2}+1}\right) \equiv 0(\bmod p),
$$

where “ $\sum$ ” denotes the sum over all possible $\left(x_{1}, x_{2}, \cdots, x_{2} r_{+1}\right)$. In fact, since $x_{i}$ modulo $p$ has $p$ possible values, there are $p^{2^{2}+1}$ terms.

Since $F^{\prime} \equiv 0$ or $1(\bmod p)$, the terms of $F^{\prime}$ modulo $p$ that are 1 can be divided by $p$. Therefore, the terms of $F^{\prime} \equiv 0(\bmod p)$ can also be divided by $p$. Thus, the terms of $F \equiv 0(\bmod p)$ can also be divided by $p$. Since $p$ is a prime, the trivial solution $(0,0, \cdots, 0)$ is the only one, so there must be a non-zero solution.

Consider each monomial of $F^{\prime}$. Since each $F_{i}^{\prime}$ has at most $r$ variables, each monomial of $F^{r}$ has at most $r^{2}$ variables, so each monomial is missing at least one variable.

Assume the monomial is of the form $b x_{j_{1}}^{a_{1}} x_{j_{2}}^{a_{2}} \cdots x_{j_{k}}^{a_{k}}$, where $1 \leqslant k \leqslant r^{2}$. When the other $r^{2}+1-k$ variables vary, the monomial of the form $b x_{j_{1}}^{\alpha_{1}} x_{j_{2}}^{a_{2}} \cdots x_{j_{k}}^{a_{k}}$ appears $p^{t^{2}+1-k}$ times, so each monomial of $\sum F^{\prime}\left(x_{1}, x_{2}, \cdots\right.$, $\left.x_{I+1}\right)$ can be divided by $p$.
Therefore, $\sum F^{\prime}\left(x_{1}, x_{2}, \cdots, x_{r_{2}+1}\right) \equiv 0(\bmod p)$.
In summary, the maximum value is $(p-1)^{2}$.