Given a polynomial p(x) If degree is A.P(1)=P(2)=P(3).....=P(A)=1. Also P(A+1)=B Tell P(A+C).
# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
Given a polynomial p(x) If degree is A.P(1)=P(2)=P(3).....=P(A)=1. Also P(A+1)=B Tell P(A+C).
Name |
---|
We know that $$$deg P = A$$$. Let $$$W(x)$$$ be $$$W(x) = P(x)-1$$$. Since $$$P(1) = P(2) = ... = P(A) = 1$$$, then $$$W(1) = W(2) = ... = W(A) = 0$$$. Let's observe that $$$deg W = deg P$$$, which means that numbers $$$1, 2, ..., A$$$ are all roots of polynomial $$$W(x)$$$. Thus,
for some real number a. Now, we know that $P(A+1) = B$ , so $$$W(A+1) = B-1 = a(A+1-1)(A+1-2)...(A+1-A) = a \times A! \implies a = (B-1)/A!$$$. So we know $$$W(x)$$$ polynomial formula — and thus, the formula for $$$P(x)$$$ (it's enough to add one). Hope I haven't made any mistake :)