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