Let $p$ be a prime number and let $A$ be a set of positive integers that satisfies the following conditions:

(i) the set of prime divisors of the elements in $A$ consists of $p-1$ elements;

(ii) for any nonempty subset of $A$, the product of its elements is not a perfect $p$-th power. 

What is the largest possible number of elements in $A$ ?
1. **Interpretation and Setup**:
   - Let \( p \) be a prime number.
   - Let \( A \) be a set of positive integers.
   - The set of prime divisors of the elements in \( A \) consists of \( p-1 \) elements.
   - For any nonempty subset of \( A \), the product of its elements is not a perfect \( p \)-th power.

2. **Vector Representation**:
   - Each number in \( A \) can be represented as a vector in \( \mathbb{F}_p^{p-1} \) where the entries correspond to the exponents of the prime factors modulo \( p \).
   - We need to find the largest multiset of vectors such that no nonempty subset of them sums to the zero vector.

3. **Construction**:
   - Consider \( p-1 \) copies of each of the \( p-1 \) vectors with one entry equal to 1 and the rest 0.
   - This gives us \( (p-1)^2 \) vectors.

4. **Proof of Impossibility for \( k > (p-1)^2 \)**:
   - Suppose we have \( k \) vectors \( v_1, \ldots, v_k \) where the \( j \)-th element of \( v_i \) is \( a_{ij} \).
   - Consider the polynomial in \( \mathbb{F}_p[x_1, \ldots, x_k] \):
     \[
     P(x) := \prod_{i=1}^{k} (1 - x_i) - \prod_{j=1}^{p-1} \left(1 - \left(\sum_{i=1}^k a_{ij} x_i\right)^{p-1}\right).
     \]
   - If we restrict \( x_i \in \{0, 1\} \) for all \( i \), then choosing some subset of the vectors and summing them is equivalent to setting some subset of the \( x_i \) to 1 (and the rest 0).
   - If we choose the empty set, i.e., \( x_i = 0 \) always, then the first and second products are both 1.
   - Otherwise, the first product clearly vanishes, and by hypothesis, since some entry of their sum is nonzero, Fermat's Little Theorem guarantees that the second product vanishes as well.
   - Thus, \( P \) vanishes for any choice of \( (x_1, \ldots, x_k) \in \{0, 1\}^k \).
   - Since \( k > (p-1)^2 \), \( P \) contains the maximal-degree term \( (-1)^k x_1 \ldots x_k \), which yields a contradiction by the Combinatorial Nullstellensatz.

\(\blacksquare\)

The final answer is \( \boxed{ (p-1)^2 } \)