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 | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
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 :)