Skip to content

Commit 7873722

Browse files
Update Polynomial.cpp
1 parent 4630bc2 commit 7873722

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

数学/Polynomial.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ namespace Poly {
1111
}
1212
}
1313

14-
1514
// res = 1 / poly
1615
void inv (int poly[], int res[], int n) {
1716
int deg = n - 1;
@@ -65,26 +64,6 @@ namespace Poly {
6564
fft::conv (tmp3, res, n, n, mod, res);
6665
memset (res + n, 0, sizeof (*res) * n);
6766
}
68-
69-
// res = sqrt(poly), poly[0] should be 1
70-
void sqrt (int poly[], int res[], int n) {
71-
if (n == 1) {
72-
res[0] = 1;
73-
return;
74-
}
75-
sqrt (poly, res, n>>1);
76-
inv (res, tmp2, n);
77-
int s = n<<1;
78-
memcpy (tmp1, poly, sizeof (*poly) * n);
79-
memset (tmp1 + n, 0, sizeof (*tmp1) * n);
80-
memset (res + n, 0, sizeof (*res) * n);
81-
// NTT::trans(tmp1, s, 1); NTT::trans(res, s, 1); NTT::trans(tmp2, s, 1);
82-
for (int i = 0; i < s; ++i) {
83-
res[i] = ((ll) res[i] * res[i] + tmp1[i]) % mod * iv[2] % mod * tmp2[i] % mod;
84-
}
85-
// NTT::trans(res, s, -1)
86-
memset (res + n, 0, sizeof (*res) * n);
87-
}
8867
}
8968

9069
// polynomial arithmetic in O(n^2)

0 commit comments

Comments
 (0)