Skip to content

Commit 24b7295

Browse files
committed
fix
1 parent d6d3c8c commit 24b7295

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

atcoder/convolution.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void butterfly_inv(std::vector<mint>& a) {
132132
irot.val();
133133
;
134134
}
135-
irot *= info.irate2[bsf(~(unsigned int)(s))];
135+
if (s + 1 != (1 << len)) irot *= info.irate2[bsf(~(unsigned int)(s))];
136136
}
137137
len--;
138138
} else {
@@ -163,7 +163,7 @@ void butterfly_inv(std::vector<mint>& a) {
163163
(a0 + (mint::mod() - a1) + (mint::mod() - a2na3iimag)) *
164164
irot3.val();
165165
}
166-
irot *= info.irate3[bsf(~(unsigned int)(s))];
166+
if (s + 1 != (1 << len)) irot *= info.irate3[bsf(~(unsigned int)(s))];
167167
}
168168
len -= 2;
169169
}

0 commit comments

Comments
 (0)