$1 \cdot 29$ Let $P$ be an odd prime. Consider the set $\{1,2, \cdots, 2 p\}$ and its subsets $A$ that satisfy the following two conditions:
(1) $|A|=p$;
(2) The sum of all elements in $A$ is divisible by $p$. Find the number of all such subsets $A$.
[Solution 1] Let $W=\{1,2, \cdots, 2 p\}$ and
$$
U=\{1,2, \cdots, p\}, V=\{p+1, p+2, \cdots, 2 p\} .
$$

It is easy to see that for any $p$-element subset $E$ of $W$ other than $U$ and $V$, we have
$$
E \cap U \neq \emptyset, E \cap V \neq \emptyset \text {. }
$$

If two $p$-element subsets $S$ and $T$ of $W$ that satisfy condition (1) also satisfy the following two conditions:
(i) $S \cap V=T \cap V$;
(ii) For appropriate numbering, the elements $s_{1}, s_{2}, \cdots, s_{m}$ of $S \cap U$ and the elements $t_{1}, t_{2}, \cdots, t_{m}$ of $T \cap U$ satisfy, for some $k \in\{0,1, \cdots, p-1\}$,
$$
s_{i}-t_{i} \equiv k(\bmod p), i=1,2, \cdots, m .
$$

we will classify these two subsets $S$ and $T$ into the same class.
For different subsets $S$ and $T$ in the same class, it is clear that $k \neq 0$. Therefore,
$$
\sum_{i=1}^{p} s_{i}-\sum_{i=1}^{p} t_{i} \equiv m k \not=0(\bmod p) \text {. }
$$

This indicates that the sums of the elements of different subsets in the same class are distinct modulo $p$, so each class contains at most $p$ subsets.

On the other hand, for each $p$-element subset $S$ of $W$ other than $U$ and $V$, by keeping the elements of $S \cap V$ fixed and cyclically permuting the elements of $S \cap U$ within $U$, we can obtain $p-1$ more $p$-element subsets. These $p$ subsets naturally belong to the same class. Therefore, each class contains exactly $p$ subsets, and among these, exactly one subset has a sum of elements divisible by $p$.
In summary, the total number of subsets of $W$ that satisfy conditions (1) and (2) is
$$
\frac{1}{p}\left(C_{2 p}^{\rho}-2\right)+2 \text {. }
$$

[Solution 2] To calculate the number of subsets of $W$ that satisfy conditions (1) and (2), we consider the following generating function:
$$
g(t, x)=(t+x)\left(t+x^{2}\right) \cdots\left(t+x^{2 p}\right)=\sum_{k, m} a_{k m} t^{k} x^{m},
$$

where $a_{k m}$ is the coefficient of the $t^{k} x^{m}$ term in the expansion, which represents the number of subsets of $W$ that satisfy the following two conditions:
(i) The subset has $2 p-k$ elements;
(ii) The sum of the elements of the subset is $m$.
Let $\varepsilon=e^{i \frac{2 \pi}{p}}$ and $E=\left\{\varepsilon^{0}, \varepsilon^{1}, \cdots, \varepsilon^{p-1}\right\}$. Then by (1) we have
$$
\begin{aligned}
\sum_{t \in E} \sum_{x \in E} g(t, x) & =\sum_{t \in E}\left(\sum_{k, m} a_{k m} t^{k}\left(\sum_{r \in E} x^{m}\right)\right) \\
& =\sum_{t \in E}\left(\sum_{k, m, p, m} a_{k m} t^{k}\right) p=\left(\sum_{p|k, p| m} a_{k, m}\right) p^{2} .
\end{aligned}
$$

In the above calculation, we used the following relation:
$$
\sum_{j=0}^{p-1} \varepsilon^{j n}=\left\{\begin{array}{l}
0, \text { when } p \nmid n, \\
p, \text { when } p \mid n .
\end{array}\right.
$$

On the other hand, we compute the same sum using the definition of $g(t, x)$ without using its expansion:
$$
\begin{aligned}
& \sum_{t \in E} \sum_{x \in E} g(t, x)=\sum_{t \in E} \sum_{x \in E}(t+x)\left(t+x^{2}\right) \cdots\left(t+x^{2 p}\right) \\
= & \sum_{t \in E}\left((t+1)^{2 p}+\sum_{x \in E \in 11}(t+x)\left(t+x^{2}\right) \cdots\left(t+x^{2 p}\right)\right) \\
= & \sum_{t \in E}\left((t+1)^{2 p}+(p-1)\left(t^{p}+1\right)^{2}\right) \\
= & \sum_{t \in E}(t+1)^{2 p}+4 p(p-1) \\
= & \sum_{t \in E}\left(1+C{ }_{2 p}^{1} t+\cdots+C_{2 p}^{2 p} t^{2 p}\right)+4 p(p-1) \\
= & p\left(1+C e_{p}^{p_{p}}+1\right)+4 p(p-1)=p \quad\left(C p_{p}+4 p-2\right) .
\end{aligned}
$$

Comparing (2) and (3), we get
$$
\sum_{p|k, p| m} a_{k m}=\frac{1}{p}\left(C \xi_{p}+4 p-2\right)=\frac{1}{p}\left(C \xi_{p}-2\right)+4 .
$$

The left-hand side of the above equation, excluding the two terms $a_{o p(2 p+1)}=1=a_{2 p o}$, is the sum of the remaining terms, which is the total number of subsets that satisfy conditions (1) and (2). Therefore, the total number of such subsets is
$$
\sum_{|k, p| m} a_{k m}-2=\frac{1}{p}\left(C \sum_{p}-2\right)+2 .
$$