summaryrefslogtreecommitdiff
path: root/math/transforms/multiplyNTT.cpp
blob: 806d12490de5e66ad033442201ddd5b8c828588b (plain)
1
2
3
4
5
6
7
8
vector<ll> mul(vector<ll> a, vector<ll> b) {
	int n = 1 << (__lg(sz(a) + sz(b) - 1) + 1);
	a.resize(n), b.resize(n);
	ntt(a), ntt(b);
	for (int i=0; i<n; i++) a[i] = a[i] * b[i] % mod;
	ntt(a, true);
	return a;
}