Let $P(x)=x^n+a_{n-1}x^{n-1}+\cdots+a_0$ be a polynomial of degree $n\geq 3.$ Knowing that $a_{n-1}=-\binom{n}{1}$ and $a_{n-2}=\binom{n}{2},$ and that all the roots of $P$ are real, find the remaining coefficients. Note that $\binom{n}{r}=\frac{n!}{(n-r)!r!}.$
1. Let \( P(x) = x^n + a_{n-1}x^{n-1} + a_{n-2}x^{n-2} + \cdots + a_0 \) be a polynomial of degree \( n \geq 3 \).
2. Given that \( a_{n-1} = -\binom{n}{1} \) and \( a_{n-2} = \binom{n}{2} \), we need to find the remaining coefficients of \( P(x) \).
3. Let \( \alpha_1, \alpha_2, \ldots, \alpha_n \) be the \( n \) real roots of \( P(x) \). By Vieta's formulas, we know:
   \[
   \sum_{i=1}^n \alpha_i = -a_{n-1} = \binom{n}{1} = n
   \]
   \[
   \sum_{1 \leq i < j \leq n} \alpha_i \alpha_j = a_{n-2} = \binom{n}{2} = \frac{n(n-1)}{2}
   \]
4. Consider the polynomial \( Q(x) = P(x+1) \). The roots of \( Q(x) \) are \( \beta_i = \alpha_i - 1 \) for \( 1 \leq i \leq n \).
5. By the binomial theorem, we can expand \( Q(x) \) as:
   \[
   Q(x) = (x+1)^n + a_{n-1}(x+1)^{n-1} + a_{n-2}(x+1)^{n-2} + \cdots + a_0
   \]
6. Since \( a_{n-1} = -n \) and \( a_{n-2} = \frac{n(n-1)}{2} \), we can write:
   \[
   Q(x) = (x+1)^n - n(x+1)^{n-1} + \frac{n(n-1)}{2}(x+1)^{n-2} + \cdots + a_0
   \]
7. By Vieta's formulas for \( Q(x) \), we have:
   \[
   \sum_{i=1}^n \beta_i = 0
   \]
   \[
   \sum_{1 \leq i < j \leq n} \beta_i \beta_j = 0
   \]
8. Since \( \beta_i = \alpha_i - 1 \), we have:
   \[
   \sum_{i=1}^n (\alpha_i - 1) = 0 \implies \sum_{i=1}^n \alpha_i - n = 0 \implies \sum_{i=1}^n \alpha_i = n
   \]
   \[
   \sum_{1 \leq i < j \leq n} (\alpha_i - 1)(\alpha_j - 1) = 0
   \]
9. Expanding the second equation:
   \[
   \sum_{1 \leq i < j \leq n} (\alpha_i \alpha_j - \alpha_i - \alpha_j + 1) = 0
   \]
   \[
   \sum_{1 \leq i < j \leq n} \alpha_i \alpha_j - \sum_{1 \leq i < j \leq n} \alpha_i - \sum_{1 \leq i < j \leq n} \alpha_j + \sum_{1 \leq i < j \leq n} 1 = 0
   \]
   \[
   \sum_{1 \leq i < j \leq n} \alpha_i \alpha_j - (n-1)\sum_{i=1}^n \alpha_i + \binom{n}{2} = 0
   \]
10. Substituting the known values:
    \[
    \frac{n(n-1)}{2} - (n-1)n + \frac{n(n-1)}{2} = 0
    \]
    \[
    \frac{n(n-1)}{2} - n(n-1) + \frac{n(n-1)}{2} = 0
    \]
    \[
    n(n-1) - n(n-1) = 0
    \]
11. This confirms that all \( \beta_i \) are zero, implying \( \alpha_i = 1 \) for all \( i \).
12. Therefore, \( P(x) = (x-1)^n \).

The final answer is \( \boxed{ P(x) = (x-1)^n } \).