summaryrefslogtreecommitdiff
path: root/content/math/transforms/multiplyNTT.cpp
blob: aec2a61dfc9cc4a7f25fa75f8997bafb3c29cd07 (plain)
1
2
3
4
5
6
7
8
vector<ll> mul(vector<ll> a, vector<ll> b) {
	int n = 1 << (__lg(ssize(a) + ssize(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;
}