Skip to content

Commit 4b4f443

Browse files
committed
Updated in response to comments
1 parent 936726e commit 4b4f443

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

content/number-theory/ModularArithmetic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ struct Mod {
2828
Mod r = *this ^ (e / 2); r = r * r;
2929
return e&1 ? *this * r : r;
3030
}
31-
operator ll(){ return x; }
31+
explicit operator ll(){ return x; }
3232
};

content/numerical/FFTPolynomial.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ poly exp(poly a) {
107107
return modK(b, sz(a));
108108
}
109109
poly pow(poly a, ll m) {
110-
int p = 0; int n = sz(a);
110+
int p = 0, n = sz(a);
111111
while (p < sz(a) && a[p].x == 0)
112112
++p;
113+
if (ll(m)*p >= sz(a)) return poly(sz(a));
113114
num j = a[p];
114115
a = {a.begin() + p, a.end()};
115116
a = a * (num(1) / j);

0 commit comments

Comments
 (0)