8000 Update polynomial.md · cp-algorithms/cp-algorithms@77ef08a · GitHub
[go: up one dir, main page]

Skip to content

Commit 77ef08a

Browse files
peltoratoradamant-pwn
authored andcommitted
Update polynomial.md
1 parent ac5eef2 commit 77ef08a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/algebra/polynomial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ The coefficient of $x^{n+r}$ of the product of the polynomials $A_0(x) = \sum\li
384384
Assume you need to calculate $A(x_1), \dots, A(x_n)$. As mentioned earlier, $A(x) \equiv A(x_i) \pmod{x-x_i}$. Thus you may do the following:
385385

386386
1. Compute a segment tree such that in the segment $[l,r)$ stands the product $P_{l, r}(x) = (x-x_l)(x-x_{l+1})\dots(x-x_{r-1})$.
387-
2. Starting with $l=0$ and $r=n$ at the root node. Let $m=\lfloor(l+r)/2\rfloor$. Let's move down to $[l,m)$ with the polynomial $A(x) \pmod{P_{l,m}(x)}$.
387+
2. Starting with $l=1$ and $r=n+1$ at the root node. Let $m=\lfloor(l+r)/2\rfloor$. Let's move down to $[l,m)$ with the polynomial $A(x) \pmod{P_{l,m}(x)}$.
388388
3. This will recursively compute $A(x_l), \dots, A(x_{m-1})$, now do the same for $[m,r)$ with $A(x) \pmod{P_{m,r}(x)}$.
389389
4. Concatenate the results from the first and second recursive call and return them.
390390

0 commit comments

Comments
 (0)
0