File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 11// @brief Convolution mod $10^9+7$
2- #define PROBLEM " https://judge.yosupo.jp/problem/convolution_mod_large "
2+ #define PROBLEM " https://judge.yosupo.jp/problem/convolution_mod_1000000007 "
33#pragma GCC optimize("Ofast,unroll-loops")
44#define CP_ALGO_CHECKPOINT
55#include < bits/stdc++.h>
Original file line number Diff line number Diff line change 1+ // @brief Convolution (Large)
2+ #define PROBLEM " https://judge.yosupo.jp/problem/convolution_mod_large"
3+ #pragma GCC optimize("Ofast,unroll-loops")
4+ #define CP_ALGO_CHECKPOINT
5+ #include < bits/stdc++.h>
6+ #include " blazingio/blazingio.min.hpp"
7+ #include " cp-algo/math/fft.hpp"
8+
9+ using namespace std ;
10+ using namespace cp_algo ::math;
11+
12+ const int mod = 998244353 ;
13+ using base = modint<mod>;
14+
15+ void solve () {
16+ int n, m;
17+ cin >> n >> m;
18+ vector<base, cp_algo::big_alloc<base>> a (n), b (m);
19+ for (auto &x: a) {cin >> x;}
20+ for (auto &x: b) {cin >> x;}
21+ cp_algo::checkpoint (" read" );
22+ fft::mul (a, b);
23+ for (auto x: a) {cout << x << " " ;}
24+ cp_algo::checkpoint (" write" );
25+ }
26+
27+ signed main () {
28+ // freopen("input.txt", "r", stdin);
29+ ios::sync_with_stdio (0 );
30+ cin.tie (0 );
31+ int t = 1 ;
32+ while (t--) {
33+ solve ();
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments