| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 18 | 9 | 7 | 53.846% |
You are given an integer $N$ and an array of integers $[y_1, y_2, \ldots, y_N]$ of size $N$.
You want to construct the following:
and the construction satisfies $P(x_1) = y_1$, $P(x_2) = y_2$, $\ldots$, $P(x_N) = y_N$.
It can be proven that such a construction always exists. Your task is to find the minimum polynomial degree $d$ that you can construct.
The first line contains an integer $N$ ($1 \leq N \leq 100000$). The second line contains $N$ integers representing $y_i$ ($-10^9 \leq y_i \leq 10^9$).
Output the minimum degree $d$ in a single line.
5 2 -1 1 1 0
3
5 1 0 0 0 1
4
3 0 0 0
0
Explanation of Sample 1: We can construct a polynomial $\frac{29}{3} x^0 + 8x^1 + 0 x^2 - \frac{2}{3} x^3$, and array $[-2.81273..., -2, -1.24361..., 3.86937..., 3.91423...]$.
ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2025 C번