We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4630bc2 commit 7873722Copy full SHA for 7873722
数学/Polynomial.cpp
@@ -11,7 +11,6 @@ namespace Poly {
11
}
12
13
14
-
15
// res = 1 / poly
16
void inv (int poly[], int res[], int n) {
17
int deg = n - 1;
@@ -65,26 +64,6 @@ namespace Poly {
65
64
fft::conv (tmp3, res, n, n, mod, res);
66
memset (res + n, 0, sizeof (*res) * n);
67
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
87
88
89
90
// polynomial arithmetic in O(n^2)
0 commit comments