atcoder / ac-library

AtCoder Library
Creative Commons Zero v1.0 Universal
1.89k stars 240 forks source link

Got "Segmentation fault" while using <atcoder/convolution> #135

Closed danielsun3164 closed 2 years ago

danielsun3164 commented 2 years ago

My program at https://atcoder.jp/contests/abc214/submissions/30708618 got "Segmentation fault". gdb shows following: Program received signal SIGSEGV, Segmentation fault. atcoder::internal::butterfly<atcoder::static_modint<1000000007, (void*)0>, (void*)0> (a=std::vector of length 2048, capacity 2048 = {...}) at ../../../include/atcoder/convolution.hpp:107 107 rot *= info.rate3[bsf(~(unsigned int)(s))]; My program worked after I changed line 65, as https://atcoder.jp/contests/abc214/submissions/30709044 Am I using in a wrong way?

yosupo06 commented 2 years ago

We cannot use convolution with mod 10^9 + 7. Please refer this comment https://github.com/atcoder/ac-library/issues/124#issuecomment-913659725

danielsun3164 commented 2 years ago

Thank you very much for your comment. I understand.