Skip to content

Commit 5136241

Browse files
committed
fix convolution mod 1e9+7, add convolution large
1 parent 4a98dae commit 5136241

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

verify/poly/convolution107.test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
}

0 commit comments

Comments
 (0)