Language: C++

#inlude<iostream>
#define rep(i,n) for(int i=0;i<(n); ++i)
using namespace std;
typedef Long Long ll;

int main(){
	int N;
	cin>>N;
	vector<int> A(N);
	rep(i,n)cin>>A[i];
	vector<int> B(N);
	rep(i,n)cin>>B[i];
	vector<int> C(N-1);
	rep(i,n-1)cin>>C[i];
	rep(i,n) A[i]--;
	
	int ans = 0;
	rep(i,n){
		ans += B[a[i]];
	}
	
	rep(i,n-1){
		if(A[i]+1 == A[i+1]){
			ans += C[A[i]];
		}
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
    1 | #inlude<iostream>
      |  ^~~~~~
      |  include
a.cc:4:9: error: 'Long' does not name a type; did you mean 'long'?
    4 | typedef Long Long ll;
      |         ^~~~
      |         long
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin>>N;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlude<iostream>
a.cc:9:9: error: 'vector' was not declared in this scope
    9 |         vector<int> A(N);
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #inlude<iostream>
a.cc:9:16: error: expected primary-expression before 'int'
    9 |         vector<int> A(N);
      |                ^~~
a.cc:10:15: error: 'n' was not declared in this scope
   10 |         rep(i,n)cin>>A[i];
      |               ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<(n); ++i)
      |                                 ^
a.cc:10:22: error: 'A' was not declared in this scope
   10 |         rep(i,n)cin>>A[i];
      |                      ^
a.cc:11:16: error: expected primary-expression before 'int'
   11 |         vector<int> B(N);
      |                ^~~
a.cc:12:15: error: 'n' was not declared in this scope
   12 |         rep(i,n)cin>>B[i];
      |               ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<(n); ++i)
      |                                 ^
a.cc:12:22: error: 'B' was not declared in this scope
   12 |         rep(i,n)cin>>B[i];
      |                      ^
a.cc:13:16: error: expected primary-expression before 'int'
   13 |         vector<int> C(N-1);
      |                ^~~
a.cc:14:15: error: 'n' was not declared in this scope
   14 |         rep(i,n-1)cin>>C[i];
      |               ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<(n); ++i)
      |                                 ^
a.cc:14:24: error: 'C' was not declared in this scope
   14 |         rep(i,n-1)cin>>C[i];
      |                        ^
a.cc:15:15: error: 'n' was not declared in this scope
   15 |         rep(i,n) A[i]--;
      |               ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<(n); ++i)
      |                                 ^
a.cc:15:18: error: 'A' was not declared in this scope
   15 |         rep(i,n) A[i]--;
      |                  ^
a.cc:18:15: error: 'n' was not declared in this scope
   18 |         rep(i,n){
      |               ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<(n); ++i)
      |                                 ^
a.cc:19:24: error: 'B' was not declared in this scope
   19 |                 ans += B[a[i]];
      |                        ^
a.cc:19:26: error: 'a' was not declared in this scope
   19 |                 ans += B[a[i]];
      |                          ^
a.cc:22:15: error: 'n' was not declared in this scope
   22 |         rep(i,n-1){
      |               ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<(n); ++i)
      |                                 ^
a.cc:23:20: error: 'A' was not declared in this scope
   23 |                 if(A[i]+1 == A[i+1]){
      |                    ^
a.cc:24:32: error: 'C' was not declared in this scope
   24 |                         ans += C[A[i]];
      |                                ^
a.cc:27:9: error: 'cout' was not declared in this scope
   27 |         cout<<ans<<endl;
      |         ^~~~
a.cc:27:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:20: error: 'endl' was not declared in this scope
   27 |         cout<<ans<<endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlude<iostream>