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 d6d3c8c commit 24b7295Copy full SHA for 24b7295
atcoder/convolution.hpp
@@ -132,7 +132,7 @@ void butterfly_inv(std::vector<mint>& a) {
132
irot.val();
133
;
134
}
135
- irot *= info.irate2[bsf(~(unsigned int)(s))];
+ if (s + 1 != (1 << len)) irot *= info.irate2[bsf(~(unsigned int)(s))];
136
137
len--;
138
} else {
@@ -163,7 +163,7 @@ void butterfly_inv(std::vector<mint>& a) {
163
(a0 + (mint::mod() - a1) + (mint::mod() - a2na3iimag)) *
164
irot3.val();
165
166
- irot *= info.irate3[bsf(~(unsigned int)(s))];
+ if (s + 1 != (1 << len)) irot *= info.irate3[bsf(~(unsigned int)(s))];
167
168
len -= 2;
169
0 commit comments