@@ -221,20 +221,19 @@ std::vector<mint> convolution(std::vector<mint>&& a, std::vector<mint>&& b) {
221221 if (!n || !m) return {};
222222
223223 int z = (int )internal::bit_ceil ((unsigned int )(n + m - 1 ));
224- assert (mint::mod () % z == 1 );
224+ assert (( mint::mod () - 1 ) % z == 0 );
225225
226226 if (std::min (n, m) <= 60 ) return convolution_naive (a, b);
227227 return internal::convolution_fft (a, b);
228228}
229-
230229template <class mint , internal::is_static_modint_t <mint>* = nullptr >
231230std::vector<mint> convolution (const std::vector<mint>& a,
232231 const std::vector<mint>& b) {
233232 int n = int (a.size ()), m = int (b.size ());
234233 if (!n || !m) return {};
235234
236235 int z = (int )internal::bit_ceil ((unsigned int )(n + m - 1 ));
237- assert (mint::mod () % z == 1 );
236+ assert (( mint::mod () - 1 ) % z == 0 );
238237
239238 if (std::min (n, m) <= 60 ) return convolution_naive (a, b);
240239 return internal::convolution_fft (a, b);
@@ -250,7 +249,7 @@ std::vector<T> convolution(const std::vector<T>& a, const std::vector<T>& b) {
250249 using mint = static_modint<mod>;
251250
252251 int z = (int )internal::bit_ceil ((unsigned int )(n + m - 1 ));
253- assert (mint::mod () % z == 1 );
252+ assert (( mint::mod () - 1 ) % z == 0 );
254253
255254 std::vector<mint> a2 (n), b2 (m);
256255 for (int i = 0 ; i < n; i++) {
0 commit comments