Skip to content

Commit 9849611

Browse files
committed
Fix
1 parent 7dfdf5f commit 9849611

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cp-algo/math/fft.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ namespace cp_algo::math::fft {
271271
}
272272
void mul_truncate(auto &a, auto const& b, size_t k) {
273273
using base = std::decay_t<decltype(a[0])>;
274+
if(size(b) == 0) {
275+
a.clear();
276+
return;
277+
}
274278
auto n = std::max(flen, std::bit_ceil(
275279
std::min(k, size(a)) + std::min(k, size(b)) - 1
276280
) / 2);

0 commit comments

Comments
 (0)