Language: C++

#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long LL;
typedef pair<int, int> PI;
typedef vector<int> VI;
const LL MOD = 1000000007LL;
LL Pow[401][401]; //i^j
LL Sum[401][401][401]; //Σx^iをx=j~kまで足し合わせる
int A[400];
int B[400];
int N, C;
LL memo[400][401];
LL f(int k, int c) {
	if (k == N) return c == 0;
	if (memo[k][c] != -1) return memo[k][c];
	LL sum = 0;
	rep(i, c + 1) {
		LL add = Sum[i][A[k]][B[k]];
		add = (add * f(k + 1, c - i)) % MOD;
		sum = (sum + add) % MOD;
	}
	return memo[k][c] = sum;
}
int main() {
	rep(i, 401) {
		Pow[i][0] = 1;
		REP(j, 1, 401) {
			Pow[i][j] = (Pow[i][j - 1] * i) % MOD;
		}
	}
	rep(i, 401) {
		rep(j, 401) {
			Sum[i][j][j] = Pow[j][i];
			REP(k, j + 1, 401) {
				Sum[i][j][k] = (Sum[i][j][k - 1] + Pow[k][i]) % MOD;
			}
		}
	}
	cin >> N >> C;
	rep(i, N) {
		cin >> A[i];
	}
	rep(i, N) {
		cin >> B[i];
	}
	memset(memo, -1, sizeof(memo));
	cout << f(0, C) << endl;
}#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,x,n) for(int i=x;i<n;i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long LL;
typedef pair<int, int> PI;
typedef vector<int> VI;
const LL MOD = 1000000007LL;
LL Pow[401][401]; //i^j
LL Sum[401][401][401]; //Σx^iをx=j~kまで足し合わせる
int A[400];
int B[400];
int N, C;
LL memo[400][401];
LL f(int k, int c) {
	if (k == N) return c == 0;
	if (memo[k][c] != -1) return memo[k][c];
	LL sum = 0;
	rep(i, c + 1) {
		LL add = Sum[i][A[k]][B[k]];
		add = (add * f(k + 1, c - i)) % MOD;
		sum = (sum + add) % MOD;
	}
	return memo[k][c] = sum;
}
int main() {
	rep(i, 401) {
		Pow[i][0] = 1;
		REP(j, 1, 401) {
			Pow[i][j] = (Pow[i][j - 1] * i) % MOD;
		}
	}
	rep(i, 401) {
		rep(j, 401) {
			Sum[i][j][j] = Pow[j][i];
			REP(k, j + 1, 401) {
				Sum[i][j][k] = (Sum[i][j][k - 1] + Pow[k][i]) % MOD;
			}
		}
	}
	cin >> N >> C;
	rep(i, N) {
		cin >> A[i];
	}
	rep(i, N) {
		cin >> B[i];
	}
	memset(memo, -1, sizeof(memo));
	cout << f(0, C) << endl;
}

Compiler output:
a.cc:51:2: error: stray '#' in program
   51 | }#include "bits/stdc++.h"
      |  ^
a.cc:51:3: error: 'include' does not name a type
   51 | }#include "bits/stdc++.h"
      |   ^~~~~~~
a.cc:59:10: error: redefinition of 'const LL MOD'
   59 | const LL MOD = 1000000007LL;
      |          ^~~
a.cc:9:10: note: 'const LL MOD' previously defined here
    9 | const LL MOD = 1000000007LL;
      |          ^~~
a.cc:60:4: error: redefinition of 'LL Pow [401][401]'
   60 | LL Pow[401][401]; //i^j
      |    ^~~
a.cc:10:4: note: 'LL Pow [401][401]' previously declared here
   10 | LL Pow[401][401]; //i^j
      |    ^~~
a.cc:61:4: error: redefinition of 'LL Sum [401][401][401]'
   61 | LL Sum[401][401][401]; //Σx^iをx=j~kまで足し合わせる
      |    ^~~
a.cc:11:4: note: 'LL Sum [401][401][401]' previously declared here
   11 | LL Sum[401][401][401]; //Σx^iをx=j~kまで足し合わせる
      |    ^~~
a.cc:62:5: error: redefinition of 'int A [400]'
   62 | int A[400];
      |     ^
a.cc:12:5: note: 'int A [400]' previously declared here
   12 | int A[400];
      |     ^
a.cc:63:5: error: redefinition of 'int B [400]'
   63 | int B[400];
      |     ^
a.cc:13:5: note: 'int B [400]' previously declared here
   13 | int B[400];
      |     ^
a.cc:64:5: error: redefinition of 'int N'
   64 | int N, C;
      |     ^
a.cc:14:5: note: 'int N' previously declared here
   14 | int N, C;
      |     ^
a.cc:64:8: error: redefinition of 'int C'
   64 | int N, C;
      |        ^
a.cc:14:8: note: 'int C' previously declared here
   14 | int N, C;
      |        ^
a.cc:65:4: error: redefinition of 'LL memo [400][401]'
   65 | LL memo[400][401];
      |    ^~~~
a.cc:15:4: note: 'LL memo [400][401]' previously declared here
   15 | LL memo[400][401];
      |    ^~~~
a.cc:66:4: error: redefinition of 'LL f(int, int)'
   66 | LL f(int k, int c) {
      |    ^
a.cc:16:4: note: 'LL f(int, int)' previously defined here
   16 | LL f(int k, int c) {
      |    ^
a.cc:77:5: error: redefinition of 'int main()'
   77 | int main() {
      |     ^~~~
a.cc:27:5: note: 'int main()' previously defined here
   27 | int main() {
      |     ^~~~