Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<ll, ll>;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
using Graph = VV;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
int Inf = (1 << 30);
ll inf = (1LL << 60);
const int MOD = 1e9 + 7;
int main() {
	int n;
	cin >> n;
	int i;
	V a(n);
	V b(n);
	V c(n);
	for (i = 0; i < n; i++) {
		cin >> a[i];
		a[i]--;
	}
	for (i = 0; i < n; i++) {
		cin >> b[i];
	}
	for (i = 0; i < n - 1; i++) {
		cin >> c[i];
	}
	int ans = 0;
	int zen = -2;
	for (i = 0; i < n; i++) {
		ans += b[a[i]];
		if (a[i] - zen == 1) ans += c[zen];
		zen = a[i];
	}
	cout << ans;
	return 0;
}#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<ll, ll>;
using V = vector<int>;
using VV = vector<vector<int>>;
using VVV = vector<vector<vector<int>>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VVVL = vector<vector<vector<ll>>>;
using Graph = VV;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
int Inf = (1 << 30);
ll inf = (1LL << 60);
const int MOD = 1e9 + 7;
int main() {
	int n;
	cin >> n;
	int i;
	V a(n);
	V b(n);
	V c(n);
	for (i = 0; i < n; i++) {
		cin >> a[i];
		a[i]--;
	}
	for (i = 0; i < n; i++) {
		cin >> b[i];
	}
	for (i = 0; i < n - 1; i++) {
		cin >> c[i];
	}
	int ans = 0;
	int zen = -2;
	for (i = 0; i < n; i++) {
		ans += b[a[i]];
		if (a[i] - zen == 1) ans += c[zen];
		zen = a[i];
	}
	cout << ans;
	return 0;
}

Compiler output:
a.cc:43:2: error: stray '#' in program
   43 | }#include<bits/stdc++.h>
      |  ^
a.cc:43:3: error: 'include' does not name a type
   43 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:54:31: error: redefinition of 'template<class T> bool chmax(T&, T)'
   54 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:12:31: note: 'template<class T> bool chmax(T&, T)' previously declared here
   12 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:55:31: error: redefinition of 'template<class T> bool chmin(T&, T)'
   55 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:13:31: note: 'template<class T> bool chmin(T&, T)' previously declared here
   13 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
      |                               ^~~~~
a.cc:56:5: error: redefinition of 'int Inf'
   56 | int Inf = (1 << 30);
      |     ^~~
a.cc:14:5: note: 'int Inf' previously defined here
   14 | int Inf = (1 << 30);
      |     ^~~
a.cc:57:4: error: redefinition of 'll inf'
   57 | ll inf = (1LL << 60);
      |    ^~~
a.cc:15:4: note: 'll inf' previously defined here
   15 | ll inf = (1LL << 60);
      |    ^~~
a.cc:58:11: error: redefinition of 'const int MOD'
   58 | const int MOD = 1e9 + 7;
      |           ^~~
a.cc:16:11: note: 'const int MOD' previously defined here
   16 | const int MOD = 1e9 + 7;
      |           ^~~
a.cc:59:5: error: redefinition of 'int main()'
   59 | int main() {
      |     ^~~~
a.cc:17:5: note: 'int main()' previously defined here
   17 | int main() {
      |     ^~~~