criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> B(N);
  vector<int> C(N-1);
  for(int i = 0;i < N;i++){
  cin >> A.at(i);
  }
  for(int i = 0;i < N;i++){
  cin >> B.at(i);
  }
  for(int i = 0;i < N-1;i++){
  cin >> C.at(i);
  }
  int ans = 0;
  for(int i = 0; i < N; i++){
  if(A.at(i) == A.at(i+1) - 1){
  ans += B.at(A.at(i));
  ans += C.at(A.at(i));
  }else{
  ans += B.at(i);
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

#include <bits/stdc++.h>
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define divceil(A, B) ((A + (B - 1)) / B)
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define CERR if(false) cerr

typedef long long ll;

using namespace std;

int main(){


    int n;
    cin >> n;

    vector<int> a;
    vector<int> b;
    vector<int> c;

    int sum = 0;

    rep(i,n){
        int tmp;
        cin >> tmp;

        a.pback(tmp);
    }

    rep(i,n){
        int tmp;
        cin >> tmp;

        b.pback(tmp);

        sum += tmp;
    }

    rep(i,n - 1){
        int tmp;
        cin >> tmp;

        c.pback(tmp);
    }

    rep(i,n - 1){
        if(a[i + 1] - 1 == a[i]){
            sum += c[a[i] - 1];
        }
    }

    cout << sum << endl;

    return 0;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++


#include<iostream>
using namespace std;

int main()
{
int N,C[100],k,sum=0,i;
cin>>N;
int  A[100],B[100];
for(i=0;i<N;i++)
{
cin>>A[i];
cin>>B[i];
}

for(i=0;i<N-1;i++)
{
cin>>C[i];
}

for(i=0;i<2;i++)
{
k=A[i];
sum=sum+B[k];
}
for(i=2;i<N-1;i++)
{
k=A[i];
sum=sum+C[k]+B[K];;
}
cout<<sum;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:16: error: 'K' was not declared in this scope
   29 | sum=sum+C[k]+B[K];;
      |                ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
int N,C[100],k,sum;
cin>>N;
int  A[100],B[100];
for(i=0;i<N;i++)
{
cin>>A[i];

}
for(i=0;i<N;i++)
{
cin>>B[i];
} 
for(i=0;i<N-1;i++)
{
cin>>C[i];
}

for(i=0;i<2;i++)
{
k=A[i];
sum=sum+B[k];
}
for(i=2;i<N-1;i++)
{
k=A[i];
sum=sum+C[k];
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'i' was not declared in this scope
    8 | for(i=0;i<N;i++)
      |     ^
a.cc:13:5: error: 'i' was not declared in this scope
   13 | for(i=0;i<N;i++)
      |     ^
a.cc:17:5: error: 'i' was not declared in this scope
   17 | for(i=0;i<N-1;i++)
      |     ^
a.cc:22:5: error: 'i' was not declared in this scope
   22 | for(i=0;i<2;i++)
      |     ^
a.cc:27:5: error: 'i' was not declared in this scope
   27 | for(i=2;i<N-1;i++)
      |     ^
Language: C++

{
    // Your code here!
    int N;
    cin>>N;
    vector<int>A(N) ;
    vector<int>B(N) ;
    vector<int>C(N) ;
    int S=0;
    for(int i=0;i<N;i++){
        cin>>A[i];
    }
    for(int i=0;i<N;i++){
        cin>>B[i];
        S+=B[i];
    }
    for(int i=0;i<N;i++){
        cin>>C[i];
    }
    for(int i=0;i<N;i++){
        if(A[i]+1==A[i+1]){
            S+=C[A[i]-1];
        }
    }
    cout<<S<<endl;
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {
      | ^
Language: C++

{
    // Your code here!
    int N;
    cin>>N;
    vector<int>A(N) ;
    vector<int>B(N) ;
    vector<int>C(N) ;
    int S=0;
    for(int i=0;i<N;i++){
        cin>>A[i];
    }
    for(int i=0;i<N;i++){
        cin>>B[i];
        S+=B[i];
        //cout<<S<<endl;
    }
    for(int i=0;i<N;i++){
        cin>>C[i];
    }
    for(int i=0;i<N;i++){
        if(A[i]+1==A[i+1]){
            S+=C[A[i]-1];
        }
    }
    cout<<S<<endl;
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {
      | ^
Language: C++

using namespace std;
int main(void){
    // Your code here!
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    vector<int> b(n);
    for(int i = 0; i < n; i++) cin >> b[i];
    vector<int> c(n-1);
    for(int i = 0; i < n-1; i++) cin >> c[i];
    
    for(int i = 0; i < n; i++) a[i]--;
    
    int ans = 0;
    for(int i = 0; i < n; i++){
        //a[i]--にしていることに注意
        ans += b[a[i]];
    }
    for(int i = 0; i < n-1; i++){
        if(a[i]+1 == a[i+1]){
            ans += c[a[i]];
        }
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     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 | using namespace std;
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     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 | using namespace std;
a.cc:6:12: error: expected primary-expression before 'int'
    6 |     vector<int> a(n);
      |            ^~~
a.cc:7:39: error: 'a' was not declared in this scope
    7 |     for(int i = 0; i < n; i++) cin >> a[i];
      |                                       ^
a.cc:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> b(n);
      |            ^~~
a.cc:9:39: error: 'b' was not declared in this scope
    9 |     for(int i = 0; i < n; i++) cin >> b[i];
      |                                       ^
a.cc:10:12: error: expected primary-expression before 'int'
   10 |     vector<int> c(n-1);
      |            ^~~
a.cc:11:41: error: 'c' was not declared in this scope
   11 |     for(int i = 0; i < n-1; i++) cin >> c[i];
      |                                         ^
a.cc:13:32: error: 'a' was not declared in this scope
   13 |     for(int i = 0; i < n; i++) a[i]--;
      |                                ^
a.cc:18:16: error: 'b' was not declared in this scope
   18 |         ans += b[a[i]];
      |                ^
a.cc:18:18: error: 'a' was not declared in this scope
   18 |         ans += b[a[i]];
      |                  ^
a.cc:21:12: error: 'a' was not declared in this scope
   21 |         if(a[i]+1 == a[i+1]){
      |            ^
a.cc:22:20: error: 'c' was not declared in this scope
   22 |             ans += c[a[i]];
      |                    ^
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << ans;
      |     ^~~~
a.cc:25:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C

#include<stdio.h>
int main(){
  int ans,ct,n;
  ans = 0;
  int a[100],b[100],c[100];
  scanf("&d",&n);
  for(ct=0;ct<n;ct++){scanf("%d",&a[ct]);}/*配列に整数を順に代入*/
  for(ct=0;ct<n;ct++){scanf("%d",&b[ct]);}/*配列に整数を順に代入*/
  for(ct=0;ct<n-1;ct++){scanf("%d",&c[ct]);}/*配列に整数を順に代入*/
  for(ct=0;ct<n,ct++){ans += b[a[ct]-1]};/*AiとBi*/
  for(ct=0;ct<n;ct++){if(a[ct]==a[ct+1]+1) ans += c[ct-1];}/*AiとCi*/
  printf("%d",ans);
}
/*
3
3 1 2
2 5 4
3 6

高橋くんはまず料理 3を食べ、満足度 4を得ました。
高橋くんは次に料理 1を食べ、満足度 2を得ました。
高橋くんは最後に料理 2を食べ、満足度 5を得ました。
配列Aiにiからi+1に連続する部分があればボーナスを計算

Compiler output:
main.c: In function 'main':
main.c:10:21: error: expected ';' before ')' token
   10 |   for(ct=0;ct<n,ct++){ans += b[a[ct]-1]};/*AiとBi*/
      |                     ^
      |                     ;
main.c:10:40: error: expected ';' before '}' token
   10 |   for(ct=0;ct<n,ct++){ans += b[a[ct]-1]};/*AiとBi*/
      |                                        ^
      |                                        ;
main.c: At top level:
main.c:14:1: error: unterminated comment
   14 | /*
      | ^
Language: C++

# include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
  // taking n value
  cin >> n;
  int A[n];
  int temp; B = 0;
  int C[n];
  // filling the order in which he eats
  for (int i = 0; i < n; i++){
  	cin >> A[i];
  }
  // satisfaction when he eats a dish
  for(int i = 0; i < n; i++){
  	cin >> temp;
    B += temp;
  }
  // additional satisfaction array
  for (int i = 0; i < n-1; i++){
  	cin >> C[i];
  }  
  // adding
  for (int i = 0; i < n-1; i++){
  	if(A[i] == A[i]+1)
      B += C[i];
  }
  cout << B <<'\n';
	
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'B' was not declared in this scope
    8 |   int temp; B = 0;
      |             ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include <limits>

using namespace std;

int main(){
	int n,a[21],b[21],c[21];
	int ans=0;
	
	cin >> n;
	
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	for(int i=0;i<n;i++){
		cin >> b[i];
	}
	for(int i=0;i<n-1;i++){
		cin >> c[i];
	}
	
	for(int i=0;i<n;i++){
		if(i==0)ans += b[a[0]-1];
		else if(a[i] - a[i-1] == 1)ans = ans + b[a[i]-1] + c[a[i]-2];
		else ans = ans + b[a[i]-1);
	}
	
	cout << ans << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:42: error: expected ']' before ')' token
   29 |                 else ans = ans + b[a[i]-1);
      |                                          ^
      |                                          ]
a.cc:29:42: error: expected ';' before ')' token
   29 |                 else ans = ans + b[a[i]-1);
      |                                          ^
      |                                          ;
Language: Java

public class Main{
	public static void main(String[] a){
    	buffet();
    }
  	public static void buffet(){
    	Scanner s = new Scanner(System.in);
    	int n = s.nextInt();
    	int[] as = new int[n];
    	int[] bs = new int[n];
		int[] cs = new int[n-1];
    	for (int i = 0; i < n; i++){
    		as[i] = s.nextInt();
		}
		for (int i = 0; i < n; i++){
			bs[i] = s.nextInt();
		}
		for (int i = 0; i < n - 1; i++){
			cs[i] = s.nextInt();
		}

		int sum = 0;
		for (int a : as){
			sum += bs[a-1];
		}
		for (int i=0; i < n - 1; i++){
			if (as[i] + 1 == as[i + 1])
				sum += cs[as[i] - 1];
		}
		System.out.println(sum);
	}

}

Compiler output:
Main.java:6: error: cannot find symbol
    	Scanner s = new Scanner(System.in);
    	^
  symbol:   class Scanner
  location: class Main
Main.java:6: error: cannot find symbol
    	Scanner s = new Scanner(System.in);
    	                ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include "../bits/stdc++.h"
using namespace std;

 int main() {
   int N;
   cin >> N;
   vector<int> a(N);
   vector<int> b(N);
   vector<int> c(N-1);

   for(int i=0;i<N;i++) {
     cin >> a[i];
   }

   for(int i=0;i<N;i++) {
     cin >> b[i];
   }

   for(int i=0;i<N-1;i++) {
     cin >> c[i];
   }

   int total = 0;

   for(int i=0;i<N;i++) {
     total += b[a[i]-1];
     if(i != 0) {
       if(a[i] == a[i-1] + 1) {
         total += c[a[i]-2];
       }
     }
   }

   cout << total << endl;

   return 0;
 }

Compiler output:
a.cc:1:10: fatal error: ../bits/stdc++.h: No such file or directory
    1 | #include "../bits/stdc++.h"
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define MOD 1000000007
int main(){
  int N,ans=0;
  vector<int> A(N),B(N),C(N-1);
  rep(i,N) cin>>A.at(i);
  rep(i,N){cin>>B.at(i);
           ans+=B.at(i);
           }
  rep(i,N-1){cin>>C.at(i);
             if(A.at(i)+1=A.at(i+1))
               ans+=C.at(i);
             }
  cout<<ans<<endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: lvalue required as left operand of assignment
   13 |              if(A.at(i)+1=A.at(i+1))
      |                 ~~~~~~~^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,sum=0,i;
    cin>>n;
    int a[n],b[n],c[n];
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    for(i=0;i<n;i++){
        cin>>b[i];
    }
    for(i=0;i<n-1;i++){
        cin>>c[i];
    }
    c[n-1]=0;
    for(i=0;i<n;i++){
        
        sum=sum+b[a[i]-1];
        if(i>0&&a[i]=a[i-1]+1)
        sum=sum+c[a[i-1]-1];
    }
    cout<<sum;
    
  return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: lvalue required as left operand of assignment
   24 |         if(i>0&&a[i]=a[i-1]+1)
      |            ~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int>food(N);
  for(int i=0;i<N;i++) {
    cin>>food[i];
   food[i]--p;
  }
  vector<int> sat(N);
  for(int i=0;i<N;i++) cin>>sat[i];
  vector<int> C(N-1);
  for(int i=0;i<N-1;i++) cin>>C[i];
  int S=0;
  for(int i=0;i<N;i++){
    S+=sat[food[i]-1];
	if(i!=0&&food[i]==food[i-1]+1) S+=C[food[i-1]];
  }
  cout<<S<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected ';' before 'p'
    9 |    food[i]--p;
      |             ^
      |             ;
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

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-i)cin >> c[i];

  int ans = 0;
  rep(i,n){
    aans += 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: In function 'int main()':
a.cc:21:5: error: 'aans' was not declared in this scope; did you mean 'ans'?
   21 |     aans += b[a[i]];
      |     ^~~~
      |     ans
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    scanf("%d",&n);
    int a[n];
    int b[n];
    int c[n-1];
    for(int i=0;i<n;i++) scanf("%d",&a[i]);
    for(int i=0;i<n;i++) scanf("%d",&b[i]);
    for(int i=0;i<n-1;i++) scanf("%d",&c[i]);
    int ans=0;
    for(int i=0;i<n;i++){
        ans+=b[a[i]-1];
        if(i!=0 && a[i]==a[i-1]+1) ans+=c[a[i-1]-1];å
    }
    printf("%d\n",ans);

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:53: error: '\U000000e5' was not declared in this scope
   16 |         if(i!=0 && a[i]==a[i-1]+1) ans+=c[a[i-1]-1];å
      |                                                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> a(N);
     vector<int> b(N); 
      vector<int> c(N-1);
    for(int i=0;i<N;i++)
    cin >> a[i];
    --a[i];

        for(int i=0;i<N;i++)
    cin >> b[i];
        for(int i=0;i<N;i++)
    cin >> c[i];
    int ans=0;
    for(int i=0;i<N;i++){
    ans += b[a[i]];
    if(a[i-1]+1==a[i] && i>0)
    ans += c[a[i-1]] ;   
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'i' was not declared in this scope
   11 |     --a[i];
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N),B(N),C(N-1);
  for (int i=0 ; i<N ; i++)
    cin >> A.at(i);
  for (int i=0 ; i<N ; i++)
    cin >> B.at(i);
  for (int i=0 ; i<N ; i++)
    cin >> C.at(i);
  
  int MANZOK=0;
  for (int i=0 ; i<N ; i++){
     MANZOK+=B.at(A.at(i)-1);
    if (i==0)
      continue
    if (A.at(i)-A.at(i-1)==1){
     MANZOK+=C.at(A.at(i)-2);
    }
  }
  cout << MANZOK << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: expected ';' before 'if'
   19 |       continue
      |               ^
      |               ;
   20 |     if (A.at(i)-A.at(i-1)==1){
      |     ~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N),B(N),C(N-1);
  for (int i=0 ; i<N ; i++)
    cin >> A.at(i);
  for (int i=0 ; i<N ; i++)
    cin >> B.at(i);
  for (int i=0 ; i<N ; i++)
    cin >> C.at(i);
  
  int MANZOK=0
  for (int i=0 ; i<N ; i++){
     MANZOK+=B.at(A.at(i));
    if (A.at(i)-A.at(i-1)==1)
     MANZOK+=C.at(i-1);
    }
  cout << MANZOK << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: expected ',' or ';' before 'for'
   16 |   for (int i=0 ; i<N ; i++){
      |   ^~~
a.cc:16:18: error: 'i' was not declared in this scope
   16 |   for (int i=0 ; i<N ; i++){
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> A(N),B(N),C(N-1);
  for (int i=0 ; i<N ; i++)
    cin >> A.at(i);
  for (int i=0 ; i<N ; i++)
    cin >> B.at(i);
  for (int i=0 ; i<N ; i++)
    cin >> C.at(i);
  
  int MANZOK=0
  for (int i=0 ; i<N ; i++){
     MANZOK+=B.at(A.at(i))
    if (A.at(i)-A.at(i-1)==1)
     MANZOK+=C.at(i-1)
    }
  cout << MANZOK << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: expected ',' or ';' before 'for'
   16 |   for (int i=0 ; i<N ; i++){
      |   ^~~
a.cc:16:18: error: 'i' was not declared in this scope
   16 |   for (int i=0 ; i<N ; i++){
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#def rep(i,n) for(int i = 0; i < n; i++)
int main(){
    int N, count = 0;
    cin >> N;
    vector<int> a(N);
    vector<int> b(N);
    vectot<int> c(N);
    rep(i,N){
        cin >> a[i];
    };
    rep(i,N){
        cin >> b[i];
    };
    rep(i,N - 1){
        cin >> c[i];
    }
    c[N - 1] = 0;
    rep(i,N){
        if(a[i] == a[i - 1] + 1)
        count += (b[i] + c[i]);
        else
        {
            count += b[i];
        }
        
    };
    cout << count << endl;
    }

Compiler output:
a.cc:3:2: error: invalid preprocessing directive #def; did you mean #ifdef?
    3 | #def rep(i,n) for(int i = 0; i < n; i++)
      |  ^~~
      |  ifdef
a.cc: In function 'int main()':
a.cc:9:5: error: 'vectot' was not declared in this scope
    9 |     vectot<int> c(N);
      |     ^~~~~~
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vectot<int> c(N);
      |            ^~~
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     rep(i,N){
      |         ^
a.cc:10:5: error: 'rep' was not declared in this scope
   10 |     rep(i,N){
      |     ^~~
a.cc:19:5: error: 'c' was not declared in this scope
   19 |     c[N - 1] = 0;
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> a(N);
     vector<int> b(50); 
      vector<int> c(50);
    for(int i=0;i<N;i++)
    cin >> a[i];
  a[i]--
        for(int i=0;i<N;i++)
    cin >> b[i];
        for(int i=0;i<N;i++)
    cin >> c[i];
    int ans;
    for(int i=0;i<N;i++){
    ans += b[a[i]];
    if(a[i-1]+1==a[i]&&i>0)
    ans += c[a[i-1]] ;   
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'i' was not declared in this scope
   11 |   a[i]--
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> a(N);
     vector<int> b(50); 
      vector<int> c(50);
    for(int i=0;i<N;i++)
    cin >> a(i);
        for(int i=0;i<N;i++)
    cin >> b(i);
        for(int i=0;i<N;i++)
    cin >> c(i);
    int ans;
    for(int i=0;i<N;i++){
    ans += b[a[i]];
    if(a[i-1]+1=a[i]&&i>0)
    ans += c[a[i-1]]    
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin >> a(i);
      |            ~^~~
a.cc:12:13: error: no match for call to '(std::vector<int>) (int&)'
   12 |     cin >> b(i);
      |            ~^~~
a.cc:14:13: error: no match for call to '(std::vector<int>) (int&)'
   14 |     cin >> c(i);
      |            ~^~~
a.cc:18:14: error: lvalue required as left operand of assignment
   18 |     if(a[i-1]+1=a[i]&&i>0)
a.cc:19:21: error: expected ';' before '}' token
   19 |     ans += c[a[i-1]]
      |                     ^
      |                     ;
   20 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  
  int N;
  cin >> N;
  
  int num = N - 1;
  
  vector<int> A(N);
  vector<int> B(N);
  vector<int> C(num);
  
  int num2 = 0;
  
  for(int i = 0;i < N;++i){
    cin >> A[i];
  }
  
  for(int i = 0;i < N;++i){
    cin >> B[i];
  }
  
  for(int i = 0;i < num;++i){
    cin >> C[i];
  }
  
  for(int i = 0;i < N;++i){
    num2 = B[i] + num2;
  }
  
  for(int i  0;i < N;++i){
    if(A[i] + 1 == A[i + 1]){
      num2 = C[i] + num2;
    }
  }
  
  cout << num2 << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:12: error: expected ';' before numeric constant
   32 |   for(int i  0;i < N;++i){
      |            ^ ~
      |            ;
a.cc:32:21: error: expected ')' before ';' token
   32 |   for(int i  0;i < N;++i){
      |      ~              ^
      |                     )
a.cc:32:24: error: 'i' was not declared in this scope
   32 |   for(int i  0;i < N;++i){
      |                        ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int x=0;
    int a[n];
    int b[n];
    int c[n];
    int d=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
    }
    for(int i2=0;i2<n;i2++)
    {
        cin>>b[i2];
    }
    for(int i3=0;i3<n;i3++)
    {
        cin>>c[i3];
    }
    for(int i4=0;i4<n;i4++)
    {
        x+=b[i4];
    }
    for(int m=0;m<n;m++)
    {
        if(a[m+1]-a[m]==1)
        {
            d=a[m]
            x+=d;
        }
    }
    cout<<x;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:19: error: expected ';' before 'x'
   34 |             d=a[m]
      |                   ^
      |                   ;
   35 |             x+=d;
      |             ~
Language: C++

#include<bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   rep(i, N) cin >> A[i];
      |       ^
a.cc:8:3: error: 'rep' was not declared in this scope
    8 |   rep(i, N) cin >> A[i];
      |   ^~~
Language: C++

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

Compiler output:
a.cc:2:8: error: expected constructor, destructor, or type conversion before '(' token
    2 |     rep(i, N){
      |        ^
a.cc:5:9: error: expected constructor, destructor, or type conversion before '(' token
    5 |      rep(i, N){
      |         ^
a.cc:9:8: error: expected constructor, destructor, or type conversion before '(' token
    9 |     rep(i, N){
      |        ^
a.cc:12:8: error: expected constructor, destructor, or type conversion before '(' token
   12 |     rep(i, N-1){
      |        ^
a.cc:15:5: error: 'cout' does not name a type
   15 |     cout << ans;
      |     ^~~~
a.cc:16:5: error: expected unqualified-id before 'return'
   16 |     return 0;
      |     ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.out.println);
    int n=sc.nextInt();
    int[] a=new int[n];
    for(int i=0;i<n;i++){
      a[i]=sc.nextInt()-1;
    }
    int[] b=new int[n];
    for(int i=0;i<n;i++){
      b[i]=sc.nextInt();
    }
    int[] c=new int[n-1];
    for(int i=0;i<n-1;i++){
      c[i]=sc.nextInt();
    }
    int sum=0;
    for(int i=0;i<n;i++){
      sum+=b[a[i]];
      if(a[i]==a[i-1]+1){
        sum+=c[a[i]];
      }
    }
    System.out.println(sum);
  }
}

Compiler output:
Main.java:5: error: cannot find symbol
    Scanner sc=new Scanner(System.out.println);
                                     ^
  symbol:   variable println
  location: variable out of type PrintStream
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n, i, sum = 0;
    cin >> n;
    int a[n], b[n], c[n];
    for(i=0; i<n; i++) cin >> a[i];
    for(i=0; i<n; i++) cin >> b[i];
    for(i=0; i<n; i++) cin >> c[i];
    for(i=0; i<n; i++){
        sum += b[a[i]-1];
        if(i>0 && a[i]-a[i-1] == 1){
            sum += c[a[i-1]-1]
        }
    }
    cout << sum;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: expected ';' before '}' token
   14 |             sum += c[a[i-1]-1]
      |                               ^
      |                               ;
   15 |         }
      |         ~
Language: C++

#include<iostream>
#include<unordered_set>

int main(void)
{
  int n = 0;
  std::cin >> n;
  
  int order = 0;
  int preOrder = -1;
  std::unordered_set<int> bonus;
  for(int count = 0; n > count; ++count)
  {
    std::cin >> order;
    if(1 == order - preOder)
    {
      bonus.emplace(order);
    }
    preOrder = order;
  }
  int sum = 0;
  int satisfaction = 0;
  for(int count = 0; n > count; ++count)
  {
    std::cin >> satisfaction;
    sum += satisfaction;
  }
  for(int index = 0; n - 1 > index; ++index)
  {
    std::cin >> satisfaction;
    if(bonus.end() != bonus.find(index))
    {
      sum += satisfaction;
    }
  }
  std::cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: 'preOder' was not declared in this scope; did you mean 'preOrder'?
   15 |     if(1 == order - preOder)
      |                     ^~~~~~~
      |                     preOrder
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int ny;
		int a[] = new int[N+1];
		int b[] = new int[N+1];
		
		for(int i=0;N < i; i++){
			a[i] = sc.nextInt();
		}
		
		for(int i=0;N < i; i++){
			b[i] = sc.nextInt();
		}
		
		if(a[i] = )
	}

}


Compiler output:
Main.java:22: error: illegal start of expression
		if(a[i] = )
		          ^
Main.java:23: error: illegal start of statement
	}
	^
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
vector<int> b(n);
vector<int> c(n-1);
  for(int i=0;i<n;i++){
  cin >> a.at(i);}
  for(int i=0;i<n;i++){
  cin >> b.at(i);}
  for(int i=0;i<n-1;i++){
  cin >> c.at(i);}
}
int satis=0;
 for(int i=0;i<n;i++){
 satis+=b.at(a.at(i));
  if(i>0 && a.at(i)==a.at(i-1)+1){satis+=c.at(i-1);}}
cout << satis << endl;
}

Compiler output:
a.cc:17:2: error: expected unqualified-id before 'for'
   17 |  for(int i=0;i<n;i++){
      |  ^~~
a.cc:17:14: error: 'i' does not name a type
   17 |  for(int i=0;i<n;i++){
      |              ^
a.cc:17:18: error: 'i' does not name a type
   17 |  for(int i=0;i<n;i++){
      |                  ^
a.cc:20:1: error: 'cout' does not name a type
   20 | cout << satis << endl;
      | ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
vector<int> b(n);
vector<int> c(n-1);
  for(int i=0;i<n;i++){
  cin >> a.at(i);}
  for(int i=0;i<n;i++){
  cin >> b.at(i);}
  for(int i=0;i<n-1;i++){
  cin >> c.at(i);}
}
int satis=0;
 for(int i=0;i<n;i++){
 satis+=b.at(a.at(i));
  if(i>0 && a.at(i)==a.at(i-1)+1){satis+=c.at(i-1);}}
cout << satis << endl;

Compiler output:
a.cc:17:2: error: expected unqualified-id before 'for'
   17 |  for(int i=0;i<n;i++){
      |  ^~~
a.cc:17:14: error: 'i' does not name a type
   17 |  for(int i=0;i<n;i++){
      |              ^
a.cc:17:18: error: 'i' does not name a type
   17 |  for(int i=0;i<n;i++){
      |                  ^
a.cc:20:1: error: 'cout' does not name a type
   20 | cout << satis << endl;
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
vector<int> a(n);
vector<int> b(n);
vector<int> c(n-1);
  for(int i=0;i<n;i++){
  cin >> a.at(i)}
  for(int i=0;i<n;i++){
  cin >> b.at(i)}
  for(int i=0;i<n-1;i++){
  cin >> a.at(i)}
}
int satis=0;
 for(int i=0;i<n;i++){
 satis+=b.at(a.at(i));
  if(i>0 && a.at(i)==a.at(i-1)+1){satis+=c.at(i-1);}}
cout << satis << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: expected ';' before '}' token
   10 |   cin >> a.at(i)}
      |                 ^
      |                 ;
a.cc:12:17: error: expected ';' before '}' token
   12 |   cin >> b.at(i)}
      |                 ^
      |                 ;
a.cc:14:17: error: expected ';' before '}' token
   14 |   cin >> a.at(i)}
      |                 ^
      |                 ;
a.cc: At global scope:
a.cc:17:2: error: expected unqualified-id before 'for'
   17 |  for(int i=0;i<n;i++){
      |  ^~~
a.cc:17:14: error: 'i' does not name a type
   17 |  for(int i=0;i<n;i++){
      |              ^
a.cc:17:18: error: 'i' does not name a type
   17 |  for(int i=0;i<n;i++){
      |                  ^
a.cc:20:1: error: 'cout' does not name a type
   20 | cout << satis << endl;
      | ^~~~
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int[] b = new int[a];
    int[] c = new int[a];
    int[] d = new int[a-1];
    int ans = 0;
    for(i = 0;i < b.length;i++){
      b[i] = sc.nextInt();
    }
    for(j = 0;j < c.length;j++){
      c[j] = sc.nextInt();
    }
    for(x = 0;x < d.length;x++){
      d[x] = sc.nextInt();
    }
    for(y = 0;y < b.length;y++){
      ans += c[b[y]];
      if(b[y] == b[y+1]+1){
        ans += d[b[y]];
      }
    }  
    System.out.println(ans);
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
    for(i = 0;i < b.length;i++){
        ^
  symbol:   variable i
  location: class Main
Main.java:10: error: cannot find symbol
    for(i = 0;i < b.length;i++){
              ^
  symbol:   variable i
  location: class Main
Main.java:10: error: cannot find symbol
    for(i = 0;i < b.length;i++){
                           ^
  symbol:   variable i
  location: class Main
Main.java:11: error: cannot find symbol
      b[i] = sc.nextInt();
        ^
  symbol:   variable i
  location: class Main
Main.java:13: error: cannot find symbol
    for(j = 0;j < c.length;j++){
        ^
  symbol:   variable j
  location: class Main
Main.java:13: error: cannot find symbol
    for(j = 0;j < c.length;j++){
              ^
  symbol:   variable j
  location: class Main
Main.java:13: error: cannot find symbol
    for(j = 0;j < c.length;j++){
                           ^
  symbol:   variable j
  location: class Main
Main.java:14: error: cannot find symbol
      c[j] = sc.nextInt();
        ^
  symbol:   variable j
  location: class Main
Main.java:16: error: cannot find symbol
    for(x = 0;x < d.length;x++){
        ^
  symbol:   variable x
  location: class Main
Main.java:16: error: cannot find symbol
    for(x = 0;x < d.length;x++){
              ^
  symbol:   variable x
  location: class Main
Main.java:16: error: cannot find symbol
    for(x = 0;x < d.length;x++){
                           ^
  symbol:   variable x
  location: class Main
Main.java:17: error: cannot find symbol
      d[x] = sc.nextInt();
        ^
  symbol:   variable x
  location: class Main
Main.java:19: error: cannot find symbol
    for(y = 0;y < b.length;y++){
        ^
  symbol:   variable y
  location: class Main
Main.java:19: error: cannot find symbol
    for(y = 0;y < b.length;y++){
              ^
  symbol:   variable y
  location: class Main
Main.java:19: error: cannot find symbol
    for(y = 0;y < b.length;y++){
                           ^
  symbol:   variable y
  location: class Main
Main.java:20: error: cannot find symbol
      ans += c[b[y]];
                 ^
  symbol:   variable y
  location: class Main
Main.java:21: error: cannot find symbol
      if(b[y] == b[y+1]+1){
           ^
  symbol:   variable y
  location: class Main
Main.java:21: error: cannot find symbol
      if(b[y] == b[y+1]+1){
                   ^
  symbol:   variable y
  location: class Main
Main.java:22: error: cannot find symbol
        ans += d[b[y]];
                   ^
  symbol:   variable y
  location: class Main
19 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String args[]{
    int a = sc.nextInt();
    int[] b = new int[a];
    int[] c = new int[a];
    int[] d = new int[a-1];
    int ans = 0;
    for(i = 0;i < b.length;i++){
      b[i] = sc.nextInt();
    }
    for(j = 0;j < c.length;j++){
      c[j] = sc.nextInt();
    }
    for(x = 0;x < d.length;x++){
      d[x] = sc.nextInt();
    }
    for(y = 0;y < b.length;y++){
      ans += c[b[y]];
      if(b[y] == b[y+1]+1){
        ans += d[b[y]];
      }
    }  
    System.out.println(ans);
  }
}

Compiler output:
Main.java:3: error: ',', ')', or '[' expected
  public static void main(String args[]{
                                       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,a,ans=0;
  vec<int> A(N),B(N),C(N);
  cin >> N >> A >> B >> C;
  for(int i=1;i<N+1;i++){
    if(A.at(a)==i){
    ans+=B.at(a);
      if(A.at(a+1)==i+1)
        ans+=C.at(a);
    }
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vec' was not declared in this scope
    6 |   vec<int> A(N),B(N),C(N);
      |   ^~~
a.cc:6:7: error: expected primary-expression before 'int'
    6 |   vec<int> A(N),B(N),C(N);
      |       ^~~
a.cc:7:15: error: 'A' was not declared in this scope
    7 |   cin >> N >> A >> B >> C;
      |               ^
a.cc:7:20: error: 'B' was not declared in this scope
    7 |   cin >> N >> A >> B >> C;
      |                    ^
a.cc:7:25: error: 'C' was not declared in this scope
    7 |   cin >> N >> A >> B >> C;
      |                         ^
Language: C

#include<stdio.h>
 
int main(){
  int n,i,j,k,sum=0;
  scanf("%d",&n);
  int a[n+1];//+1しとく
  int b[n+1];
  int c[n];
  
  for(i=1;i<=n;i++){
    scanf("%d",&a[i]);}
  
    for(i=1;i<=n;i++){
      scanf("%d",&j);
      b[i]=j;
      sum+=j;}
  
  for(i=1;i<n;i++){
    scanf("%d",&c[i]);
  
      for(i=1;i<n;i++){
      	if(a[i]==a[i+1]-1)//そしたらエラー出ない
          sum+=c[a[i]];//ここが鬼門
      }
  
	printf("%d\n",sum);
 
 
return 0;}

Compiler output:
main.c: In function 'main':
main.c:29:1: error: expected declaration or statement at end of input
   29 | return 0;}
      | ^~~~~~
Language: C

#include<stdio.h>
 
int main(){
  int n,i,j,k,sum=0;
  scanf("%d",&n);
  int a[n+1];//+1しとく
  int b[n+1];
  int c[n];
  
  for(i=1;i<=n;i++){
    scanf("%d",&a[i]);}
    for(i=1;i<=n;i++){
      scanf("%d",&j);
      b[i]=j;
      sum+=j;}
      for(i=1;i<n;i++){
      	if(a[i]==a[i+1]-1)//そしたらエラー出ない
          sum+=c[a[i]];//ここが鬼門
      }
  
	printf("%d\n",sum);
}

  
  

return 0;}

Compiler output:
main.c:27:1: error: expected identifier or '(' before 'return'
   27 | return 0;}
      | ^~~~~~
main.c:27:10: error: expected identifier or '(' before '}' token
   27 | return 0;}
      |          ^
Language: C

#include<stdio.h>
 
int main(){
  int N,i,j,k;
  scanf("%d",&N);
  int A[N];
  int B[N];
  int C[N-1];
  
  for(i=1;i<N;i++){
    scanf("%d",&A[i]);}
    for(j=0j<N;j++){
      scanf("%d",&B[j]);}
      for(k=0k<N-1;k++){
      scanf("%d",&C[k]);}
  
  if(A[i]-A[i-1])
    printf("%d",A[i]+B[j]+C[i]);
  else
    printf("%d",A[i]+B[j]);
return 0;}

Compiler output:
main.c: In function 'main':
main.c:12:13: error: invalid operands to binary < (have 'complex int' and 'int')
   12 |     for(j=0j<N;j++){
      |             ^
main.c:12:19: error: expected ';' before ')' token
   12 |     for(j=0j<N;j++){
      |                   ^
      |                   ;
main.c:14:13: error: fixed-point types not supported for this target
   14 |       for(k=0k<N-1;k++){
      |             ^~
main.c:14:23: error: expected ';' before ')' token
   14 |       for(k=0k<N-1;k++){
      |                       ^
      |                       ;
Language: C

#include<stdio.h>
 
int main(){
  int N,i,j,k;
  scanf("%d",&N);
  int A[N];
  int B[N];
  int C[N-1];
  
  for(i=1;i<=N;i++){
    scanf("%d",&A[i]);}
    for(j=1;j<=N;j++){
      scanf("%d",&B[j]);}
      for(k=1;k<=N-1;k++){
      scanf("%d",&C[k]);}
  
  if(A[i+1]=A[i]-1 || A[i]=A[i+1]-1)
    printf("%d",A[i]+B[j]+C[i]);
  else
    printf("%d",A[i]+B[j]);
return 0;}

Compiler output:
main.c: In function 'main':
main.c:17:27: error: lvalue required as left operand of assignment
   17 |   if(A[i+1]=A[i]-1 || A[i]=A[i+1]-1)
      |                           ^
Language: C

#include<stdio.h>
 
int main(){
  int N,i,j,k;
  scanf("%d",&N);
  int A[N];
  int B[N];
  int C[N-1];
  
  for(i=1;i<=N;i++){
    scanf("%d",&A[i]);}
    for(j=1;j<=N;j++){
      scanf("%d",&B[j]);}
      for(k=1;k<=N-1;k++){
      scanf("%d",&C[k]);}
  
  if(A[i+1]=A[i]-1 | A[i]=A[i+1]-1)
    printf("%d",A[i]+B[j]+C[i]);
  else
    printf("%d",A[i]+B[j]);
return 0;}

Compiler output:
main.c: In function 'main':
main.c:17:26: error: lvalue required as left operand of assignment
   17 |   if(A[i+1]=A[i]-1 | A[i]=A[i+1]-1)
      |                          ^
Language: C

#include<stdio.h>

int main(){
  int N,i,j,k;
  scanf("%d",&N);
  int A[N];
  int B[N];
  int C[N-1];
  
  for(i=1;i<N;i++){
    scanf("%d",&A[i]);
    for(j=1;j<N;j++){
      scanf("%d",&B[j]);
      for(k=1;k<N-1;k++){
      scanf("%d",&C[k]);
      }
    }
  }
  if(j=i+1)
    printf("%d",A[i]+B[j]+C[i);
  else
    printf("%d",A[i]+B[j]);
return 0;}
        

Compiler output:
main.c: In function 'main':
main.c:20:30: error: expected ']' before ')' token
   20 |     printf("%d",A[i]+B[j]+C[i);
      |                              ^
      |                              ]
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int n;
  cin >>n;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(n-1);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  for(int i=0;i<n;i++){
    cin >> b[i];
  }
  for(int i=0;i<n-1;i++){
    cin >> c[i];
  }
  int score=0;
  for(int i=0;i<n;i++){
    score += b[a[i]];
  }
  for(int i=0;i<n-1;i++){
    if(a[i]=a[i+1]){
    score += c[a[i]];
  }
  cout << score << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int n;
  cin >>n;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(n-1);
  for(int i=0;i<n,i++){
    cin >> a[i];
  }
  for(int i=0;i<n,i++){
    cin >> b[i];
  }
  for(int i=0;i<n-1,i++){
    cin >> c[i];
  }
  int score=0;
  for(int i=0;i<n;i++){
    score += b[a[i]];
  }
  for(int i=0;i<n-1;i++){
    if(a[i]=a[i+1]){
    score += c[a[i]];
  }
  cout << score << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before ')' token
   11 |   for(int i=0;i<n,i++){
      |                      ^
      |                      ;
a.cc:14:22: error: expected ';' before ')' token
   14 |   for(int i=0;i<n,i++){
      |                      ^
      |                      ;
a.cc:17:24: error: expected ';' before ')' token
   17 |   for(int i=0;i<n-1,i++){
      |                        ^
      |                        ;
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  int a[25],b[25],c[25];
  cin>>n;
  for(int i=0;i<n;++i)cin>>a[i];
  for(int i=0;i<n;++i)cin>>b[i];
  for(int i=0;i<n;++i)cin>>c[i];
  int res=0;
  for(int i=0;i<n;++i){
    res+=b[a[i]-1];
    if(a[i]+1==a[i+1])res+=c[a[i]-1];
  }
  out<<res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'out' was not declared in this scope
   16 |   out<<res;
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  int a[25],b[25],c[25];
  cin>>n;
  for(int i=0;i<n;++i)cin>>a[i];
  for(int i=0;i<n;++i)cin>>bi];
  for(int i=0;i<n;++i)cin>>ci];
  int res=0;
  for(int i=0;i<n;++i){
    res+=b[a[i]-1];
    if(a[i]+1==a[i+1])res+=c[a[i]-1];
  }
  out<<res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: 'bi' was not declared in this scope; did you mean 'i'?
    9 |   for(int i=0;i<n;++i)cin>>bi];
      |                            ^~
      |                            i
a.cc:10:28: error: 'ci' was not declared in this scope; did you mean 'i'?
   10 |   for(int i=0;i<n;++i)cin>>ci];
      |                            ^~
      |                            i
a.cc:16:3: error: 'out' was not declared in this scope
   16 |   out<<res;
      |   ^~~
Language: C++


#include <bits/stdc++.h>

3 using namespace std;
4
5 int main() {
6 int N; cin >> N;
7 // input
8 vector<int> A(N);
9 for (int i = 0; i < N; ++i) {
10 cin >> A[i];
11 --A[i];
12 }
13 vector<int> B(N);
14 for (int i = 0; i < N; ++i) {
15 cin >> B[i];
16 }
17 vector<int> C(N-1);
18 for (int i = 0; i < N; ++i) {
19 cin >> C[i];
20 }
21 // calc
22 int ans = 0;
23 for (int i = 0; i < N; ++i) {
24 ans += B[A[i]];
25 if (i > 0 && A[i] == A[i-1]+1) {
26 ans += C[A[i-1]];
27 }
28 }
29 // output
30 cout << ans << endl;
31 }

Compiler output:
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 3 using namespace std;
      | ^
a.cc:5:1: error: expected unqualified-id before numeric constant
    5 | 4
      | ^
Language: C++


}#include <bits/stdc++.h>
2
3 using namespace std;
4
5 int main() {
6 int N; cin >> N;
7 // input
8 vector<int> A(N);
9 for (int i = 0; i < N; ++i) {
10 cin >> A[i];
11 --A[i];
12 }
13 vector<int> B(N);
14 for (int i = 0; i < N; ++i) {
15 cin >> B[i];
16 }
17 vector<int> C(N-1);
18 for (int i = 0; i < N; ++i) {
19 cin >> C[i];
20 }
21 // calc
22 int ans = 0;
23 for (int i = 0; i < N; ++i) {
24 ans += B[A[i]];
25 if (i > 0 && A[i] == A[i-1]+1) {
26 ans += C[A[i-1]];
27 }
28 }
29 // output
30 cout << ans << endl;
31 }

Compiler output:
a.cc:2:2: error: stray '#' in program
    2 | }#include <bits/stdc++.h>
      |  ^
a.cc:2:1: error: expected declaration before '}' token
    2 | }#include <bits/stdc++.h>
      | ^
a.cc:2:3: error: 'include' does not name a type
    2 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:5:1: error: expected unqualified-id before numeric constant
    5 | 4
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n, sum = 0;
  cin >> n;
  int a[n], b[n], c[n];

  for(int i = 0; i < n; i++){
      cin >> a[i];
  }
  for(int i = 0; i < n; i++){
      cin >> b[i];
  }
  for(int i = 1; i < n; i++){
      cin >> c[i];
  }
  for(int i = 0; i < n; i++){
      if(i > 0 && a[i] == a[i-1]+1]){
          sum = sum + b[i] + c[i-1];
      }
      else{
          sum = sum + b[i];
      }
  }
  cout << sum << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:19:35: error: expected ')' before ']' token
   19 |       if(i > 0 && a[i] == a[i-1]+1]){
      |         ~                         ^
      |                                   )
a.cc:19:35: error: expected primary-expression before ']' token
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(n);
  rep(i, n) {
    cin >> a[i];
    a[i]--;
  }

  rep(i, n) {
    cin >> b[i];
  }
  rep(i, n-1) {
    cin >> c[i];
  }
  int ans = 0;
  int prev = -2;
  rep(i, n) {
    ans += b[a[i]];
    if (a[i] == prev + 1) {
      ans += c[prev];
    }
    prev = a[i];
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:23: error: 'll' was not declared in this scope
    2 | #define rep(i,n) for (ll i = 0; i < n; ++i)
      |                       ^~
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(i, n) {
      |   ^~~
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   rep(i, n) {
      |       ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (ll i = 0; i < n; ++i)
      |                                 ^
a.cc:2:23: error: 'll' was not declared in this scope
    2 | #define rep(i,n) for (ll i = 0; i < n; ++i)
      |                       ^~
a.cc:16:3: note: in expansion of macro 'rep'
   16 |   rep(i, n) {
      |   ^~~
a.cc:16:7: error: 'i' was not declared in this scope
   16 |   rep(i, n) {
      |       ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (ll i = 0; i < n; ++i)
      |                                 ^
a.cc:2:23: error: 'll' was not declared in this scope
    2 | #define rep(i,n) for (ll i = 0; i < n; ++i)
      |                       ^~
a.cc:19:3: note: in expansion of macro 'rep'
   19 |   rep(i, n-1) {
      |   ^~~
a.cc:19:7: error: 'i' was not declared in this scope
   19 |   rep(i, n-1) {
      |       ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (ll i = 0; i < n; ++i)
      |                                 ^
a.cc:2:23: error: 'll' was not declared in this scope
    2 | #define rep(i,n) for (ll i = 0; i < n; ++i)
      |                       ^~
a.cc:24:3: note: in expansion of macro 'rep'
   24 |   rep(i, n) {
      |   ^~~
a.cc:24:7: error: 'i' was not declared in this scope
   24 |   rep(i, n) {
      |       ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (ll i = 0; i < n; ++i)
      |                                 ^
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int A[];
    A = new int[N];
    int B[];
    B = new int[N];
    int C[];
    C = new int [N -1];
    int count = 0;
    for(int  i = 1; i <= N; i++){
      A[i] = sc.nextInt();
      B[i] = sc.nextInt();
      C[i] = sc.nextInt();
      count += B[A[i]];
        if(B[i + 1] - B[i] == 1){
          coutn += C[i];
        }
    }
    System.out.println(count);
  }
}
    
   
      

Compiler output:
Main.java:20: error: cannot find symbol
          coutn += C[i];
          ^
  symbol:   variable coutn
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int A[];
    A = new int[N];
    int B[];
    B = new int[N];
    int C[];
    C = new int [N -1];
    int count = 0;
    for(int  i = 1; i <= N; i++){
      A[i] = sc.nextInt();
      B[i] = sc.nextInt();
      C[i] = sc.nextInt();
      count += B[A[i]]
        if(B[i + 1] - B[i] == 1){
          coutn += C[i]
        }
    }
    System.out.println(count);
  }
}
    
   
      

Compiler output:
Main.java:18: error: ';' expected
      count += B[A[i]]
                      ^
Main.java:20: error: ';' expected
          coutn += C[i]
                       ^
2 errors
Language: C++

#include <bits/stdc++.h>

#define endl '\n'
#define PB push_back
#define PF push_front
#define MP make_pair
#define fi first
#define se second
#define all(v) v.begin(),v.end()

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

const int INF = 1e9 + 7;
const ll LINF = 1e18 + 14;

int main(){
    ios_base::sync_with_stdio(false); //cin.tie(nullptr); cout.tie(nullptr);
    int n;
    cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++){
        cin >> v[i];
    }
    int sum = 0;
    for (int i = 0; i < n; i++){
        int b;
        cin >> b;
        sum += b;
    }
    for (int i = 0; i < n; i++){
        int c;
        cin >> c;
        if (i > 0 && v[i-1] = v[i] + 1)
            sum += c;
    }
    cout << sum;
    return 0;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:41:19: error: lvalue required as left operand of assignment
   41 |         if (i > 0 && v[i-1] = v[i] + 1)