@@ -221,20 +221,19 @@ std::vector<mint> convolution(std::vector<mint>&& a, std::vector<mint>&& b) {
221
221
if (!n || !m) return {};
222
222
223
223
int z = (int )internal::bit_ceil ((unsigned int )(n + m - 1 ));
224
- assert (mint::mod () % z == 1 );
224
+ assert (( mint::mod () - 1 ) % z == 0 );
225
225
226
226
if (std::min (n, m) <= 60 ) return convolution_naive (a, b);
227
227
return internal::convolution_fft (a, b);
228
228
}
229
-
230
229
template <class mint , internal::is_static_modint_t <mint>* = nullptr >
231
230
std::vector<mint> convolution (const std::vector<mint>& a,
232
231
const std::vector<mint>& b) {
233
232
int n = int (a.size ()), m = int (b.size ());
234
233
if (!n || !m) return {};
235
234
236
235
int z = (int )internal::bit_ceil ((unsigned int )(n + m - 1 ));
237
- assert (mint::mod () % z == 1 );
236
+ assert (( mint::mod () - 1 ) % z == 0 );
238
237
239
238
if (std::min (n, m) <= 60 ) return convolution_naive (a, b);
240
239
return internal::convolution_fft (a, b);
@@ -250,7 +249,7 @@ std::vector<T> convolution(const std::vector<T>& a, const std::vector<T>& b) {
250
249
using mint = static_modint<mod>;
251
250
252
251
int z = (int )internal::bit_ceil ((unsigned int )(n + m - 1 ));
253
- assert (mint::mod () % z == 1 );
252
+ assert (( mint::mod () - 1 ) % z == 0 );
254
253
255
254
std::vector<mint> a2 (n), b2 (m);
256
255
for (int i = 0 ; i < n; i++) {
0 commit comments