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 936726e commit 4b4f443Copy full SHA for 4b4f443
content/number-theory/ModularArithmetic.h
@@ -28,5 +28,5 @@ struct Mod {
28
Mod r = *this ^ (e / 2); r = r * r;
29
return e&1 ? *this * r : r;
30
}
31
- operator ll(){ return x; }
+ explicit operator ll(){ return x; }
32
};
content/numerical/FFTPolynomial.h
@@ -107,9 +107,10 @@ poly exp(poly a) {
107
return modK(b, sz(a));
108
109
poly pow(poly a, ll m) {
110
- int p = 0; int n = sz(a);
+ int p = 0, n = sz(a);
111
while (p < sz(a) && a[p].x == 0)
112
++p;
113
+ if (ll(m)*p >= sz(a)) return poly(sz(a));
114
num j = a[p];
115
a = {a.begin() + p, a.end()};
116
a = a * (num(1) / j);
0 commit comments