Language: C++

int mod_pow(int a, int n, int mod){
    int ret = 1;
	while(n){
		if(n & 1) ret = (long long)ret * a % mod;
		a = (long long)a * a % mod;
		n >>= 1;
	}
	return ret;
}

template<int mod>
class NTT {
public:
	int get_mod() const { return mod; }
	void _ntt(vector<int>& a, int sign){
		const int n = (int)a.size();
		const int g = 3; //g is primitive root of mod
		int h = mod_pow(g, (mod - 1) / n, mod); // h^n = 1
		if(sign == -1) h = mod_pow(h, mod-2, mod); //h = h^-1 % mod
        int s,x,m,j,k;
        int i = 0;
		for(j = 1; j < n - 1; ++j){
			for(k = n >> 1; k >(i ^= k); k >>= 1);
			if (j < i) swap(a[i], a[j]);
		}
		for (m = 1; m < n; m *= 2){
			const int m2 = 2 * m;
			const int base = mod_pow(h, n / m2, mod);
			int w = 1;
			for(x = 0; x < m; x++){
				for(s = x; s < n; s += m2){
					unsigned int u = a[s];
					unsigned int d = (long long)a[s + m] * w % mod;
					a[s] = (u + d) % mod;
					a[s + m] = (u + mod - d) % mod;
				}
				w = (long long)w * base % mod;
			}
		}
	}
	void ntt(vector<int>& input){
		_ntt(input, 1);
	}
	void intt(vector<int>& input){
		_ntt(input, -1);
		const int n_inv = mod_pow((int)(input.size()), mod-2, mod);
		for(auto& x : input) x = (long long)x * n_inv % mod;
	}
	void _convolution(const vector<int>& a, const vector<int>& b, vector<int>& _a, vector<int>& _b){
		int ntt_size = 1;
		while (ntt_size < (int)(a.size()) + (int)(b.size())) ntt_size *= 2;
        _a = a, _b = b;
		_a.resize(ntt_size); _b.resize(ntt_size);
		ntt(_a), ntt(_b);
		for(int i = 0; i < ntt_size; i++){
			_a[i] = (long long)_a[i] * _b[i] % mod;
		}
		intt(_a);
	}
};

typedef NTT<167772161> NTT_1;
typedef NTT<469762049> NTT_2;
typedef NTT<1224736769> NTT_3;

void convolution(const vector<int>& a, const vector<int>& b, vector<int>& res){
	NTT_1 ntt1; NTT_2 ntt2; NTT_3 ntt3;
    vector<int> x,_x,y,_y,z,_z;
	ntt1._convolution(a, b, x, _x), ntt2._convolution(a, b, y, _y), ntt3._convolution(a, b, z, _z);
	const int m1 = ntt1.get_mod(), m2 = ntt2.get_mod(), m3 = ntt3.get_mod();
	const int m1_inv_m2 = mod_pow(m1, m2-2, m2);
	const int m12_inv_m3 = mod_pow((long long)m1 * m2 % m3, m3-2, m3);
	const int m12_mod = (long long)m1 * m2 % MOD;
	res.resize((int)(x.size()));
	for(int i = 0; i < (int)(x.size()); i++){
	    int v1 = ((long long)y[i] + m2 - x[i]) *  m1_inv_m2 % m2;
	    int v2 = ((long long)z[i] + m3 - (x[i] + (long long)m1 * v1) % m3) * m12_inv_m3 % m3;
	    res[i] = (x[i] + (long long)m1 * v1 + (long long)m12_mod * v2) % MOD;
	}
}

Compiler output:
a.cc:15:19: error: 'vector' has not been declared
   15 |         void _ntt(vector<int>& a, int sign){
      |                   ^~~~~~
a.cc:15:25: error: expected ',' or '...' before '<' token
   15 |         void _ntt(vector<int>& a, int sign){
      |                         ^
a.cc:41:18: error: 'vector' has not been declared
   41 |         void ntt(vector<int>& input){
      |                  ^~~~~~
a.cc:41:24: error: expected ',' or '...' before '<' token
   41 |         void ntt(vector<int>& input){
      |                        ^
a.cc:44:19: error: 'vector' has not been declared
   44 |         void intt(vector<int>& input){
      |                   ^~~~~~
a.cc:44:25: error: expected ',' or '...' before '<' token
   44 |         void intt(vector<int>& input){
      |                         ^
a.cc:49:33: error: 'vector' does not name a type
   49 |         void _convolution(const vector<int>& a, const vector<int>& b, vector<int>& _a, vector<int>& _b){
      |                                 ^~~~~~
a.cc:49:39: error: expected ',' or '...' before '<' token
   49 |         void _convolution(const vector<int>& a, const vector<int>& b, vector<int>& _a, vector<int>& _b){
      |                                       ^
a.cc: In member function 'void NTT<mod>::_ntt(int)':
a.cc:16:36: error: 'a' was not declared in this scope
   16 |                 const int n = (int)a.size();
      |                                    ^
a.cc:19:20: error: 'sign' was not declared in this scope; did you mean 'signed'?
   19 |                 if(sign == -1) h = mod_pow(h, mod-2, mod); //h = h^-1 % mod
      |                    ^~~~
      |                    signed
a.cc:24:36: error: there are no arguments to 'swap' that depend on a template parameter, so a declaration of 'swap' must be available [-fpermissive]
   24 |                         if (j < i) swap(a[i], a[j]);
      |                                    ^~~~
a.cc:24:36: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
a.cc: In member function 'void NTT<mod>::ntt(int)':
a.cc:42:22: error: 'input' was not declared in this scope; did you mean 'int'?
   42 |                 _ntt(input, 1);
      |                      ^~~~~
      |                      int
a.cc: In member function 'void NTT<mod>::intt(int)':
a.cc:45:22: error: 'input' was not declared in this scope; did you mean 'int'?
   45 |                 _ntt(input, -1);
      |                      ^~~~~
      |                      int
a.cc: In member function 'void NTT<mod>::_convolution(int)':
a.cc:51:41: error: 'a' was not declared in this scope
   51 |                 while (ntt_size < (int)(a.size()) + (int)(b.size())) ntt_size *= 2;
      |                                         ^
a.cc:51:59: error: 'b' was not declared in this scope
   51 |                 while (ntt_size < (int)(a.size()) + (int)(b.size())) ntt_size *= 2;
      |                                                           ^
a.cc:52:9: error: '_a' was not declared in this scope
   52 |         _a = a, _b = b;
      |         ^~
a.cc:52:14: error: 'a' was not declared in this scope
   52 |         _a = a, _b = b;
      |              ^
a.cc:52:17: error: '_b' was not declared in this scope
   52 |         _a = a, _b = b;
      |                 ^~
a.cc:52:22: error: 'b' was not declared in this scope
   52 |         _a = a, _b = b;
      |                      ^
a.cc: At global scope:
a.cc:66:24: error: 'vector' does not name a type
   66 | void convolution(const vector<int>& a, const vector<int>& b, vector<int>& res){
      |                        ^~~~~~
a.cc:66:30: error: expected ',' or '...' before '<' token
   66 | void convolution(const vector<int>& a, const vector<int>& b, vector<int>& res){
      |                              ^
a.cc: In function 'void convolution(int)':
a.cc:68:5: error: 'vector' was not declared in this scope
   68 |     vector<int> x,_x,y,_y,z,_z;
      |     ^~~~~~
a.cc:68:12: error: expected primary-expression before 'int'
   68 |     vector<int> x,_x,y,_y,z,_z;
      |            ^~~
a.cc:69:27: error: 'a' was not declared in this scope
   69 |         ntt1._convolution(a, b, x, _x), ntt2._convolution(a, b, y, _y), ntt3._convolution(a, b, z, _z);
      |                           ^
a.cc:69:30: error: 'b' was not declared in this scope
   69 |         ntt1._convolution(a, b, x, _x), ntt2._convolution(a, b, y, _y), ntt3._convolution(a, b, z, _z);
      |                              ^
a.cc:69:33: error: 'x' was not declared in this scope
   69 |         ntt1._convolution(a, b, x, _x), ntt2._convolution(a, b, y, _y), ntt3._convolution(a, b, z, _z);
      |                                 ^
a.cc:69:36: error: '_x' was not declared in this scope
   69 |         ntt1._convolution(a, b, x, _x), ntt2._convolution(a, b, y, _y), ntt3._convolution(a, b, z, _z);
      |                                    ^~
a.cc:69:65: error: 'y' was not declared in this scope
   69 |         ntt1._convolution(a, b, x, _x), ntt2._convolution(a, b, y, _y), ntt3._convolution(a, b, z, _z);
      |                                                                 ^
a.cc:69:68: error: '_y' was not declared in this scope
   69 |         ntt1._convolution(a, b, x, _x), ntt2._convolution(a, b, y, _y), ntt3._convolution(a, b, z, _z);
      |                                                                    ^~
a.cc:69:97: error: 'z' was not declared in this scope
   69 |         ntt1._convolution(a, b, x, _x), ntt2._convolution(a, b, y, _y), ntt3._convolution(a, b, z, _z);
      |                                                                                                 ^
a.cc:69:100: error: '_z' was not declared in this scope
   69 |         ntt1._convolution(a, b, x, _x), ntt2._convolution(a, b, y, _y), ntt3._convolution(a, b, z, _z);
      |                                                                                                    ^~
a.cc:73:50: error: 'MOD' was not declared in this scope
   73 |         const int m12_mod = (long long)m1 * m2 % MOD;
      |                                                  ^~~
a.cc:74:9: error: 'res' was not declared in this scope
   74 |         res.resize((int)(x.size()));
      |         ^~~