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

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

int main() {
  ll N,A,B,C;
  cin>>N>>A>>B>>C;
  sort<A,A+N,greater<int>());
  int ans=0;
  for(int i=0;i<N;i++){
    ans+=B[i];
    if(A[i]+1==A[i+1]){
      ans+=C[i];
    }
  }
  cout<<ans<<endl;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: the value of 'A' is not usable in a constant expression
    9 |   sort<A,A+N,greater<int>());
      |            ^
a.cc:7:8: note: 'long long int A' is not const
    7 |   ll N,A,B,C;
      |        ^
a.cc:9:3: error: parse error in template argument list
    9 |   sort<A,A+N,greater<int>());
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:9:28: error: expected ';' before ')' token
    9 |   sort<A,A+N,greater<int>());
      |                            ^
      |                            ;
a.cc:9:3: error: statement cannot resolve address of overloaded function
    9 |   sort<A,A+N,greater<int>());
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:11: error: invalid types 'long long int[int]' for array subscript
   12 |     ans+=B[i];
      |           ^
a.cc:13:9: error: invalid types 'long long int[int]' for array subscript
   13 |     if(A[i]+1==A[i+1]){
      |         ^
a.cc:13:17: error: invalid types 'long long int[int]' for array subscript
   13 |     if(A[i]+1==A[i+1]){
      |                 ^
a.cc:14:13: error: invalid types 'long long int[int]' for array subscript
   14 |       ans+=C[i];
      |             ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  int sum = 0;
  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];
    sum += B[i];
  }
  vector<int> C(N-1);
  for (int i = 0; i < N-1; i++) cin >> C[i];
  for (int i = 0; i < N-1; i++) {
    if (A[i]+1 == A[i+1]) sum += C[A[i];
  }
  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:40: error: expected ']' before ';' token
   18 |     if (A[i]+1 == A[i+1]) sum += C[A[i];
      |                                        ^
      |                                        ]
Language: C++

#include <bits/stdc++.h>
#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];
  int sum = 0;
  rep(i,n){
    int sum += b[i];
    if (i > 0 && a[i] - a[i-1] == 1) sum += c[a[i-1]]; 
  }
  cout << sum << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: expected initializer before '+=' token
   17 |     int sum += b[i];
      |             ^~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vctor' was not declared in this scope
    9 |   vctor<int> a(n);
      |   ^~~~~
a.cc:9:9: error: expected primary-expression before 'int'
    9 |   vctor<int> a(n);
      |         ^~~
a.cc:10:19: error: 'a' was not declared in this scope
   10 |   rep(i,n) cin >> a[i];
      |                   ^
a.cc:11:9: error: expected primary-expression before 'int'
   11 |   vctor<int> b(n);
      |         ^~~
a.cc:12:19: error: 'b' was not declared in this scope
   12 |   rep(i,n) cin >> b[i];
      |                   ^
a.cc:13:9: error: expected primary-expression before 'int'
   13 |   vctor<int> c(n-1);
      |         ^~~
a.cc:14:21: error: 'c' was not declared in this scope
   14 |   rep(i,n-1) cin >> c[i];
      |                     ^
a.cc:17:13: error: expected initializer before '+=' token
   17 |     int sum += b[i];
      |             ^~
a.cc:18:9: error: 'a' was not declared in this scope
   18 |     if (a[i+1] - a[i] == 1) sum += c[i];
      |         ^
a.cc:18:36: error: 'c' was not declared in this scope
   18 |     if (a[i+1] - a[i] == 1) sum += c[i];
      |                                    ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vctor' was not declared in this scope
    9 |   vctor<int> a(n);
      |   ^~~~~
a.cc:9:9: error: expected primary-expression before 'int'
    9 |   vctor<int> a(n);
      |         ^~~
a.cc:10:19: error: 'a' was not declared in this scope
   10 |   rep(i,n) cin >> a[i];
      |                   ^
a.cc:11:9: error: expected primary-expression before 'int'
   11 |   vctor<int> b(n);
      |         ^~~
a.cc:12:19: error: 'b' was not declared in this scope
   12 |   rep(i,n) cin >> b[i];
      |                   ^
a.cc:13:9: error: expected primary-expression before 'int'
   13 |   vctor<int> c(n-1);
      |         ^~~
a.cc:14:21: error: 'c' was not declared in this scope
   14 |   rep(i,n-1) cin >> c[i];
      |                     ^
a.cc:16:13: error: expected initializer before '+=' token
   16 |     int sum += b[i];
      |             ^~
a.cc:17:9: error: 'a' was not declared in this scope
   17 |     if (a[i+1] - a[i] == 1) sum += c[i];
      |         ^
a.cc:17:29: error: 'sum' was not declared in this scope
   17 |     if (a[i+1] - a[i] == 1) sum += c[i];
      |                             ^~~
a.cc:17:36: error: 'c' was not declared in this scope
   17 |     if (a[i+1] - a[i] == 1) sum += c[i];
      |                                    ^
a.cc:19:11: error: 'sum' was not declared in this scope
   19 |   cout << sum << endl;
      |           ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
int main()	{
  int n,sum=0;
  cin>>n;
  vector<int> a(n),b(n),c(n-1);
  rep(i,n) {
    cin>>a[i];
    a[i]--;
  }
  rep(i,n) cin>>b[i];
  rep(i,n-1) cin>>c[i];
  rep(i,n){
    sum+=b[a[i]];
    if(i>0 && a[i-1]+1=a[i])
      sum+=c[a[i-1]];
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: lvalue required as left operand of assignment
   27 |     if(i>0 && a[i-1]+1=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-1;i++){
    cin>>c.at(i);
  }
  int s=b.at(0);
  for(int i=1;i<N;i++){
    s+=b.at(i);
    if(a.at(i)-1==a.at(i-1)){
      s+=c.at(a.at(i-1);
    }
  }
  cout<<s<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:24: error: expected ')' before ';' token
   21 |       s+=c.at(a.at(i-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-1;i++){
    cin>>c.at(i);
  }
  int s=b.at(0);
  for(int i=1;i<N;i++){
    s+=b.at(i);
    if(a.at(i)-1==a.at(i-1)){
      s+=c.at(i-1);
    }
  }
  cout<<s<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: 'c' was not declared in this scope
   15 |     cin>>c.at(i);
      |          ^
a.cc:21:10: error: 'c' was not declared in this scope
   21 |       s+=c.at(i-1);
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
int main()	{
  int n,sum=0;
  cin>>n;
  vector<int>a(n),b(n),c(n);
  rep(i,n) {
    cin>>a[i];
    a[i]--;
  rep(i,n) cin>>b[i];
  rep(i,n-1) cin>>c[i];
  rep(i,n){
    sum+=b[a[i]];
    if(i>0)
      sum+=c[a[i-1]];
  }
  cout<<sum<<endl;
}

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

#include <bits/stdc++.h>
#define rep(i,n) for(int 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-1);
  int satisfied=0;
  rep(i,n) {
    cin >> a[i];
    cin >> b[i];
    satisfied+=a[i]+b[i];}
  rep(i,n-1) {
    cin >> c[i];
    satisfide+=c[i]; }
  cout << satisfide << endl;
  return 0;
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'satisfide' was not declared in this scope; did you mean 'satisfied'?
   17 |     satisfide+=c[i]; }
      |     ^~~~~~~~~
      |     satisfied
a.cc:18:11: error: 'satisfide' was not declared in this scope; did you mean 'satisfied'?
   18 |   cout << satisfide << endl;
      |           ^~~~~~~~~
      |           satisfied
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int 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-1);
  int satisfide=0;
  rep(i,n) {
    cin >> a[i];
    cin >> b[i];
    satisfide+=a[i]+b[i];}
  rep(i,n-1) {
    cin >> c[i];
    satisfide+=c[i]; }
  cout << satisfide << endl;
  return 0;
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:2:39: error: expected ')' before ';' token
    2 | #define rep(i,n) for(int i=0;i<(n);++i;)
      |                     ~                 ^
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(i,n) {
      |   ^~~
a.cc:2:40: error: expected primary-expression before ')' token
    2 | #define rep(i,n) for(int i=0;i<(n);++i;)
      |                                        ^
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(i,n) {
      |   ^~~
a.cc:2:39: error: expected ')' before ';' token
    2 | #define rep(i,n) for(int i=0;i<(n);++i;)
      |                     ~                 ^
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(i,n-1) {
      |   ^~~
a.cc:2:40: error: expected primary-expression before ')' token
    2 | #define rep(i,n) for(int i=0;i<(n);++i;)
      |                                        ^
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(i,n-1) {
      |   ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int 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-1);
  int satisfied=0;
  rep(i,n) {
    cin >> a[i];
    cin >> b[i];
    satisfied+=a[i]+b[i];}
  rep(i,n-1) {
    cin >> c[i];
    satisfide+=c[i]; }
  cout << satisfide << endl;
  return 0;
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:2:39: error: expected ')' before ';' token
    2 | #define rep(i,n) for(int i=0;i<(n);++i;)
      |                     ~                 ^
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(i,n) {
      |   ^~~
a.cc:2:40: error: expected primary-expression before ')' token
    2 | #define rep(i,n) for(int i=0;i<(n);++i;)
      |                                        ^
a.cc:11:3: note: in expansion of macro 'rep'
   11 |   rep(i,n) {
      |   ^~~
a.cc:2:39: error: expected ')' before ';' token
    2 | #define rep(i,n) for(int i=0;i<(n);++i;)
      |                     ~                 ^
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(i,n-1) {
      |   ^~~
a.cc:2:40: error: expected primary-expression before ')' token
    2 | #define rep(i,n) for(int i=0;i<(n);++i;)
      |                                        ^
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(i,n-1) {
      |   ^~~
a.cc:18:11: error: 'satisfide' was not declared in this scope; did you mean 'satisfied'?
   18 |   cout << satisfide << endl;
      |           ^~~~~~~~~
      |           satisfied
Language: C

#include<stdio.h>
int main(void){
  int l,i,j,sum=0,ban;
  scanf("%d",&l);
  int num[3+1][l+1];
  for(i=1;i<=3;i++){
    for(j=1;j<=l;j++){
      scanf("%d",&num[i][j]);
      if(i=3&&j==l-1){
        break;
      }
    }
  }
  for(i=1;i<=l;i++){
    ban=num[1][i];
    sum+=[2][ban];
    if(num[1][i]-1==num[1][i-1]){
      sum+=num[3][i-1];
    }
  }
  printf("%d",sum);
  return 0;
}
  

Compiler output:
main.c: In function 'main':
main.c:16:10: error: expected expression before '[' token
   16 |     sum+=[2][ban];
      |          ^
Language: C++

n = input()
line1 = input()
line2 = input()
line3 = input()

a_list = line1.split(" ")
a_list = [int(a) for a in a_list]
b_list = line2.split(" ")
b_list = [int(b) for b in b_list]
c_list = line3.split(" ")
c_list = [int(c) for c in c_list]

temp = a_list[0]
ans = 0
for a in a_list:
    if a == temp + 1:
        ans = ans + b_list[a-1] + c_list[temp-1]
        print(ans)
    else:
        ans = ans + b_list[a-1]
        print(ans)
    temp = a
print(ans)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = input()
      | ^
Language: C++

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

int main(){
    int n; 
  cin>>n;
    int a[n],c[n];
    int count = 0;
    for(int i=0;i<n;i++){
      cin>>a[i];
    }
    for(int i=0;i<n;i++){
        int b; 
      cin>>b;
        copunt+=b;
    }
    
    for(int i=0;i<n-1;i++){ 
      cin>>c[i];
    }
                           

    for(int i=0;i<n-1;i++){
        if(a[i]+1==a[i+1]) 
          count+=c[a[i]-1];
    }
    cout<<count<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'copunt' was not declared in this scope; did you mean 'count'?
   15 |         copunt+=b;
      |         ^~~~~~
      |         count
Language: C++


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

Compiler output:
a.cc:2:5: error: expected declaration before '}' token
    2 |     }
      |     ^
a.cc:3:5: error: expected unqualified-id before 'for'
    3 |     for(int i=1; i<=n; i++){
      |     ^~~
a.cc:3:18: error: 'i' does not name a type
    3 |     for(int i=1; i<=n; i++){
      |                  ^
a.cc:3:24: error: 'i' does not name a type
    3 |     for(int i=1; i<=n; i++){
      |                        ^
a.cc:6:5: error: expected unqualified-id before 'for'
    6 |     for(int i=1; i<n; i++){
      |     ^~~
a.cc:6:18: error: 'i' does not name a type
    6 |     for(int i=1; i<n; i++){
      |                  ^
a.cc:6:23: error: 'i' does not name a type
    6 |     for(int i=1; i<n; i++){
      |                       ^
a.cc:9:5: error: expected unqualified-id before 'for'
    9 |     for(int i=1; i<=n; i++){
      |     ^~~
a.cc:9:18: error: 'i' does not name a type
    9 |     for(int i=1; i<=n; i++){
      |                  ^
a.cc:9:24: error: 'i' does not name a type
    9 |     for(int i=1; i<=n; i++){
      |                        ^
a.cc:15:5: error: 'cout' does not name a type
   15 |     cout << resp << endl;
      |     ^~~~
a.cc:16:5: error: expected unqualified-id before 'return'
   16 |     return 0;
      |     ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

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

int main(){

    int n;
    cin>>n;
    int ans=0;
    int before=n+1;
    vector<int> a(n),b(n),c(n);

    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);

    for(int i=0;i<n;i++){

        ans+=b.at(a.at(i));
        if(a.at(i)-1=before) ans+=c.at(i);
        before=a.at(i);

    }
    cout<<ans<<endl;





    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: lvalue required as left operand of assignment
   19 |         if(a.at(i)-1=before) ans+=c.at(i);
      |            ~~~~~~~^~
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:29: error: 'i' was not declared in this scope
   10 |     vector<int> a(n),b(n),c(i);
      |                             ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;
  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=0; i<N-1; i++) cin>>C[i];
  int sum=0;
  for (int i=0; i<N; i++) sum+=B[i];
  int tum=0;
  for (int i=0; i<N-1; i++){
    if (A[i]+1==A[i+1]) tum+=c[i];
  }
  cout<<sum+tum<<endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: 'c' was not declared in this scope
   14 |     if (A[i]+1==A[i+1]) tum+=c[i];
      |                              ^
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define IO(i, o) freopen(i, "r", stdin), freopen(o, "w", stdout)

using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

int n, a[51], b[51], c[51];
int main(){
	//IO("input.txt", "output.txt");
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> a[i];
	for(int i = 1; i <= n; i++) cin >> b[i];
	for(int i = 1; i < n; i++) cin >> c[i];
	int sum = 0;
	for(int i = 1; i <= n; i++){
		sum += b[a[i]];
		sum += c[a[i - 1]]
	}
	cout << sum << "\n";
	return 0;
}

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

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


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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: lvalue required as left operand of assignment
   15 |         if(a[i]+1=a[i+1])ans+=c[a[i]];
      |            ~~~~^~
Language: C++

*H,=map(int,open(0).read().split());N=H[0];A=H[1:N+1]+[0];B=H[N+1:2*N+1];C=H[-N+1:];a=i=0
while i<N:
    a+=B[i]
    if A[i+1]-A[i]==1:a+=C[A[i]-1]
    i+=1
print(a)


Compiler output:
a.cc:1:3: error: expected constructor, destructor, or type conversion before ',' token
    1 | *H,=map(int,open(0).read().split());N=H[0];A=H[1:N+1]+[0];B=H[N+1:2*N+1];C=H[-N+1:];a=i=0
      |   ^
a.cc:1:4: error: expected unqualified-id before '=' token
    1 | *H,=map(int,open(0).read().split());N=H[0];A=H[1:N+1]+[0];B=H[N+1:2*N+1];C=H[-N+1:];a=i=0
      |    ^
a.cc:1:37: error: 'N' does not name a type
    1 | *H,=map(int,open(0).read().split());N=H[0];A=H[1:N+1]+[0];B=H[N+1:2*N+1];C=H[-N+1:];a=i=0
      |                                     ^
a.cc:1:44: error: 'A' does not name a type
    1 | *H,=map(int,open(0).read().split());N=H[0];A=H[1:N+1]+[0];B=H[N+1:2*N+1];C=H[-N+1:];a=i=0
      |                                            ^
a.cc:1:59: error: 'B' does not name a type
    1 | *H,=map(int,open(0).read().split());N=H[0];A=H[1:N+1]+[0];B=H[N+1:2*N+1];C=H[-N+1:];a=i=0
      |                                                           ^
a.cc:1:74: error: 'C' does not name a type
    1 | *H,=map(int,open(0).read().split());N=H[0];A=H[1:N+1]+[0];B=H[N+1:2*N+1];C=H[-N+1:];a=i=0
      |                                                                          ^
a.cc:1:85: error: 'a' does not name a type
    1 | *H,=map(int,open(0).read().split());N=H[0];A=H[1:N+1]+[0];B=H[N+1:2*N+1];C=H[-N+1:];a=i=0
      |                                                                                     ^
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-1; i++){
    cin>>c.at(i);
  }
  int s=0,pre=-5;
  for(int i=0; i<n; i++){
    //printf("%d %d\n",a[i],pre);
    s+=b[a[i]-1];
    if(a[i]==pre+1) s+=c[pre-1];
    pre=a[i];
  }
  cout<<s<<endl;
}

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

#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cfloat>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define rep(i,n) for(int i = 0;i < n; i++)
#define REP(i,n) for(int i = 1;i <= n; i++)
// ----GCC ONLY---- //
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// ----        ---- //
#define ll long long
#define MOD 10000007
#define PB push_back
 
using namespace std;

int main(){


    int a,b,c;
    cin >> a >> b >> c;

    int ans = c - (a - b);


    if(ans > 0){
        cout << ans <<endl;
    }else if(ans =< 0){
        cout << 0 <<endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:19: error: expected primary-expression before '<' token
   48 |     }else if(ans =< 0){
      |                   ^
Language: C++

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

int main(){
    int n;
    cin >> n;
    int sum = 0;
    vector<int> a(n),b(n),c(n);
    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);
    }

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

    cout << sum << endl;
    return 0;
}

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

#include<stdio.h>
int main(void){
  int n;
  printf("%d",&n);
  int a[n],b[n],k=0,c[1000000];
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<n;i++){
    scanf("%d",&b[i]);
  }
  for(i=0;i<n-1;i++){
    scanf("%d",&c[i]);
  }
  for(i=0;i<n;i++){
    sum+=b[a[i]-1];
    if(i>=1&&a[i-1]==a[i]-1) {
      sum+=c[k];
      k++;
  }
  }
  printf("%d",&sum);
    return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:6:7: error: 'i' undeclared (first use in this function)
    6 |   for(i=0;i<n;i++){
      |       ^
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:16:5: error: 'sum' undeclared (first use in this function)
   16 |     sum+=b[a[i]-1];
      |     ^~~
Language: C

#include<stdio.h>
int main(void){
  int n;
  printf("%d",&n);
  int a[n],b[n],k=0;
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<n;i++){
    scanf("%d",&b[i]);
  }
  for(i=0;i<n-1;i++){
    scanf("%d",&c[i]);
  }
  for(i=0;i<n;i++){
    sum+=b[a[i]-1];
    if(i>=1&&a[i-1]==a[i]-1) {
      sum+=c[k];
      k++;
  }
  }
  printf("%d",&sum);
    return 0;
  }

Compiler output:
main.c: In function 'main':
main.c:6:7: error: 'i' undeclared (first use in this function)
    6 |   for(i=0;i<n;i++){
      |       ^
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:17: error: 'c' undeclared (first use in this function)
   13 |     scanf("%d",&c[i]);
      |                 ^
main.c:16:5: error: 'sum' undeclared (first use in this function)
   16 |     sum+=b[a[i]-1];
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int A[N] , B[N] , 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 - 1; i++){
    cin >> C[i];
  }
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    ans += B[A[i]];
    if (i > 0 && A[i] == A[i-1]+1) {
      ans += C[A[i-1]];
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'for'
    7 |   for(int i = 0; i < N; i++){
      |   ^~~
a.cc:7:18: error: 'i' was not declared in this scope
    7 |   for(int i = 0; i < N; i++){
      |                  ^
a.cc:15:12: error: 'C' was not declared in this scope
   15 |     cin >> C[i];
      |            ^
a.cc:21:14: error: 'C' was not declared in this scope
   21 |       ans += C[A[i-1]];
      |              ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
  int m;
  cin >> n;
  vector<int> a(n), b(n), c(n);
  REP(i, n) cin >> a[i];
  REP(i, n) cin >> b[i];
  REP(i, n) cin >> c[i];
  REP(i, n) a[i]--;
  int ans = 0;
  REP(i, n) {
    ans += b[a[i]];
    if (i!=n-1 && a[i+1]==a[i]+1) ans += c[i]; 
  }
  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: 'n' was not declared in this scope
   19 |   cin >> n;
      |          ^
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] jun = new int[N];
    int[] moreHappy = new int[N-1];
    int sum = 0;
    for(int i=0; i<N; i++){
      jun[i] = Sc.nextInt();
    }
    for(int i=0; i<N; i++){
      sum += sc.nextInt();
    }
    for(int i=0; i<N-1; i++){
      moreHappy[i] = sc.nextInt();
    }
    for(int i=1; i<N; i++){
      if(jun[i] - jun[i-1] == 1){
        sum += moreHappy[i-1];
      }
    }
    System.out.print(sum);
  }
}
       

Compiler output:
Main.java:10: error: cannot find symbol
      jun[i] = Sc.nextInt();
               ^
  symbol:   variable Sc
  location: class Main
1 error
Language: C++

/*by freesteed*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define pb push_back
#define fill(x,c) memset(x,c,sizeof(x))
#define fi first
#define se second
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define caset int ___T; cin>>___T; for(int cs=1;cs<=___T;cs++)
#define get_be(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
//get_be biger & equal
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
const ll mod=1e9+7;
const ll oo=1e9+10;
const int Max = 1e6+10;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll c[Max];
ll n,A[Max],B[Max],ans,f=1;
void solve(){
	cin>>n;
	rep(i,0,n)cin>>A[i];
	rep(i,0,n)cin>>B[i];
	ans = B[0];
	rep(i,1,n){
		ans+=B[i];
		if(A[i]-A[i-1] == 1){
			ans+=C[i-1];
		}
	}
	cout<<ans;
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//caset{
		solve();
	//}
  	return 0;
}





Compiler output:
a.cc: In function 'void solve()':
a.cc:31:30: error: 'C' was not declared in this scope
   31 |                         ans+=C[i-1];
      |                              ^
Language: C++

/*by freesteed*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define pb push_back
#define fill(x,c) memset(x,c,sizeof(x))
#define fi first
#define se second
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define caset int ___T; cin>>___T; for(int cs=1;cs<=___T;cs++)
#define get_be(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
//get_be biger & equal
typedef long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
const ll mod=1e9+7;
const ll oo=1e9+10;
const int Max = 1e6+10;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll c[Max];
ll n,A[Max],B[Max],ans,f=1;
void solve(){
	cin>>n;
	rep(i,0,n)cin>>A[i];
	rep(i,0,n)cin>>B[i];
	ans = B[0];
	rep(i,1,n){
		ans+=B[i];
		if(A[i]-A[i-1] == ){
			ans+=C[i-1];
		}
	}
	cout<<ans;
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//caset{
		solve();
	//}
  	return 0;
}





Compiler output:
a.cc: In function 'void solve()':
a.cc:30:35: error: expected primary-expression before ')' token
   30 |                 if(A[i]-A[i-1] == ){
      |                                   ^
a.cc:31:30: error: 'C' was not declared in this scope
   31 |                         ans+=C[i-1];
      |                              ^
Language: C++

#include "stdafx.h" //プリインクルードされている場合はコメントアウト
#include <iostream>
#include <string>
#include <cstdlib> //func147bでインクルード
#include <vector>  //func146b
using namespace std;

void func140b() {
    int n, a, b, c;

    cin >> n;
    vector<int> v1;
    vector<int> v2;
    vector<int> v3;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        v1.emplace_back(a);
    }
    for (int i = 0; i < n; ++i) {
        cin >> b;
        v2.emplace_back(b);
    }
    for (int i = 0; i < n - 1; ++i) {
        cin >> c;
        v3.emplace_back(c);
    }
    int num = v2[v1[0] - 1];
    for (int i = 1; i < n; ++i) {
        num += v2[v1[i] - 1];
        if (v1[i] == v1[i - 1] + 1) num += v3[v1[i - 1] - 1];
    }
    cout << num << endl;
}
int main()
{
  func140b();
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h" //プリインクルードされている場合はコメントアウト
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

int main() {
  int ans =0
  for (int i=0 ;i= N ;i++){ 
  if (  A(i+1) - Ai =1)
    ans += Bi +Ci
    else 
      ans+=Bi
  }
    
  cout << ans << endl;
}


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

#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
 
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 ans=0;
  for(int i=0; i<N; i++) ans+=B[A[i]-1];
  for(int i=0; i<N-1; i++){
    if (A[i+1]-A[i]==1) ans+=C[i];
  }
  cout << ans <<endl;
}
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

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 ans=0;
  for(int i=0; i<N; i++) ans+=B[A[i]-1];
  for(int i=0; i<N-1; i++){
    if (A[i+1]-A[i]==1) ans+=C[A[i]];
  }
  cout << ans <<endl;
}

Compiler output:
a.cc:28:5: error: redefinition of 'int main()'
   28 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

#include "pch.h"
#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <string>
#include <math.h>
#include <iomanip>


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

using namespace std;

int main()
{
  int N;
  cin >> N;

  int sum = 0;
  vector<int> A(N), C(N - 1);
  for (int i = 0; i < N; ++i)
  {
    int B;
    cin >> A[i] >> B;
    if (i != N - 1)cin >> C[i];

    sum += B;
  }

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

  cout << sum << endl;
}

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

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

int main(){

int N ;
cin >> N;
vector<int> A(N),B(N),C(N);
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);
  } 
 
 
//calculate

int ans=0;

for(int i -0;i<N;i++1){
  ans+=B[A[i]];
 if(i>0 &&A[i]==A[i-1]+1){
  ans+=C[A[i-1]]
 }

}

cout << ans <<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:10: error: expected ';' before '-' token
   26 | for(int i -0;i<N;i++1){
      |          ^~
      |          ;
a.cc:26:17: error: expected ')' before ';' token
   26 | for(int i -0;i<N;i++1){
      |    ~            ^
      |                 )
a.cc:26:18: error: 'i' was not declared in this scope
   26 | for(int i -0;i<N;i++1){
      |                  ^
Language: C++

#include "stdafx.h"
#include <iostream>
#include <string>

using namespace std;

int main()
{
    int sumSatis = 0;
    int n;
    cin >> n;

    int* dishes = new int[n];
    for(int i = 0; i < n; ++i) cin >> dishes[i];

    int* satis = new int[n];
    for(int i = 0; i < n; ++i) cin >> satis[i];

    int* addiSatis = new int[n - 1];
    for(int i = 0; i < n - 1; ++i) cin >> addiSatis[i];

    for(int i = 0; i < n; ++i) {
        sumSatis += satis[dishes[i] - 1];
        if(i > 0 && dishes[i] - 1 == dishes[i - 1])
            sumSatis += addiSatis[dishes[i - 1] - 1];
    }

    cout << sumSatis;
    return 0;
}


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

#include <stdio.h>

int main()
{
	int n, s, i;
	int a[20], b[50], c[50];
	scanf("%d", &n);
	for(i = 0; i < n; i++){
		scanf("%d", &a[i]);
	}
	for(i = 0; i < n; i++){
		scanf("%d", &b[i]);
	}
	for(i = 0; i < n - 1; i++){
		scanf("%d", &c[i]);
	}n = 3
	  1 2 3
	a 2 1 3
	b      
	s = b[0];
	for(i = 1; i < n; i++){
		s += b[a[i]];
		if(a[i] < n && a[i + 1] == a[i] + 1){
			s += c[i];
		}
	}
	printf("%d\n", s);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:15: error: expected ';' before numeric constant
   16 |         }n = 3
      |               ^
      |               ;
   17 |           1 2 3
      |           ~
Language: C++

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




    int main(){
        int n;
        std::cin >> n;
        std::vector<int> a(n), b(n), c(n-1);
        rep(i, n) std::cin >> a[i];
        rep(i, n) std::cin >> b[i];
        rep(i, n) std::cin >> c[i];
        int cnt = b[a[0]-1];
        for (int i = 1; i < n; ++i)
        {
            cnt += b[a[0]-1];
            if (a[i-1] == a[i]-1)
            {
                /* code */cnt += c[a[i-1]-1]
            }
        }
        std::cout << cnt << "\n";
        return 0;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:22:45: error: expected ';' before '}' token
   22 |                 /* code */cnt += c[a[i-1]-1]
      |                                             ^
      |                                             ;
   23 |             }
      |             ~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n, a[20], b[20], c[20], count=0;
  cin >> n;
  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-1; ++i) cin >> c[i];
  
  for(int i=0; i<n; ++i){
    count += b[a[i]];
    if(a[i] == a[i-1]+1) count += c[a[i-1]];
  }
  cout << count << endl;
}


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

#include <iostream>
using namespace std;

int main()
{
  int n, a[20], b[20], c[20], count=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=1; i<n; ++i){
    count += b[a[i-1]];
    if(!(a[i-1]-a[i])) count += c[i-1]
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:39: error: expected ';' before '}' token
   14 |     if(!(a[i-1]-a[i])) count += c[i-1]
      |                                       ^
      |                                       ;
   15 |   }
      |   ~
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[] = new int[n];
    int b[] = new int[n];
    int c[] = new int[n-1];
    int sum = 0 ;

    for (int i = 0 ; i < n ; i++ ) {
      a[i] = sc.nextInt();
    }

    for (int i = 0 ; i < n ; i++ ) {
      b[i] = sc.nextInt();
      sum = sum + b[i];
    }

    for (int i = 0 ; i < n-1 ; i++ ) {
      c[i] = sc.nextInt();
    }

    for (int i = 0 ; i < n-1 ; i++ ) {
      if (a[i+1] + a[i] == 1) {
        sum = sum + c[a[i]-1];
      }
    }

    System.out.println(sum);
    }
  }
}


Compiler output:
Main.java:36: error: class, interface, enum, or record expected
}
^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> A(N+10,INT_MAX);
    vector<int> B(N+10,INT_MAX);
    vector<int> C(N+10,INT_MAX);

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

    int score = 0;
    for(int i=1;i<=N;i++){
        score += B[A[i]];
        if(A[i]-1 == A[i-1]) {
            score += C[A[i-1]];
            }
    }

    cout << score << endl;

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: 'INT_MAX' was not declared in this scope
    9 |     vector<int> A(N+10,INT_MAX);
      |                        ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <cmath>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

N = int(input())
A, B, C = [input().split() for i in range(3)]
A = [int(num) for num in A]
B = [int(num) for num in B]
C = [int(num) for num in C]
A.insert(0,0)
B.insert(0,0)
C.insert(0,0)
p = 0
for i in range(1,N+1):
  p += B[A[i]]
  if A[i-1] == A[i] - 1:
    p += C[A[i-1]]
print(p)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector <int> data1(n);
  vector <int> data2(n);
  vectro <int> data3(n-1);
  for (int i = 0; i < n; i++) {
    cin >> data1.at(i);
  }
  for (int i = 0; i < n; i++) {
    cin >> data2.at(i);
  }
  for (int i = 0; i < (n-1); i++) {
    cin >> data3.at(i);
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += data2.at(data1.at(i));
  }
  for (int i = 0; i < (n-1); i++) {
    if (data1.at(i+1) - data1.at(i) == 1) {
      ans += data3.at(i);
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vectro' was not declared in this scope
    9 |   vectro <int> data3(n-1);
      |   ^~~~~~
a.cc:9:11: error: expected primary-expression before 'int'
    9 |   vectro <int> data3(n-1);
      |           ^~~
a.cc:17:12: error: 'data3' was not declared in this scope; did you mean 'data2'?
   17 |     cin >> data3.at(i);
      |            ^~~~~
      |            data2
a.cc:25:14: error: 'data3' was not declared in this scope; did you mean 'data2'?
   25 |       ans += data3.at(i);
      |              ^~~~~
      |              data2
Language: C++

#include <iostream>

using namespace std;

int main(){
    int a;
    int b;
    int c;
    cin >> a >> b >> c;
    int result = 0;
    for(int i = 1; i < 10000; i++){
        for(int j = 1; j < 10000; j++){
            for(int k = 1; k < 1000; k++){
                for(int l = 1; l < 1000;){
                    for(){
                        cout << "result" << endl;
                    }
                }
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: expected primary-expression before ')' token
   15 |                     for(){
      |                         ^
a.cc:18:17: error: expected primary-expression before '}' token
   18 |                 }
      |                 ^
a.cc:17:22: error: expected ';' before '}' token
   17 |                     }
      |                      ^
      |                      ;
   18 |                 }
      |                 ~     
a.cc:18:17: error: expected primary-expression before '}' token
   18 |                 }
      |                 ^
a.cc:17:22: error: expected ')' before '}' token
   17 |                     }
      |                      ^
      |                      )
   18 |                 }
      |                 ~     
a.cc:15:24: note: to match this '('
   15 |                     for(){
      |                        ^
a.cc:18:17: error: expected primary-expression before '}' token
   18 |                 }
      |                 ^
Language: C++

//vectorを使ったコード
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(
    int n;
    cin >> n;

    vector<int> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
        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; i++){
        cin >> c[i];
    }

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

Compiler output:
a.cc:9:10: error: expected ')' before ';' token
    9 |     int n;
      |          ^
      |          )
a.cc:8:9: note: to match this '('
    8 | int main(
      |         ^
a.cc:8:5: warning: 'int main(int)' takes only zero or two arguments [-Wmain]
    8 | int main(
      |     ^~~~
a.cc:10:5: error: 'cin' does not name a type
   10 |     cin >> n;
      |     ^~~
a.cc:12:19: error: 'n' was not declared in this scope
   12 |     vector<int> a(n);
      |                   ^
a.cc:13:5: error: expected unqualified-id before 'for'
   13 |     for(int i = 0; i < n; i++){
      |     ^~~
a.cc:13:20: error: 'i' does not name a type
   13 |     for(int i = 0; i < n; i++){
      |                    ^
a.cc:13:27: error: 'i' does not name a type
   13 |     for(int i = 0; i < n; i++){
      |                           ^
a.cc:17:19: error: 'n' was not declared in this scope
   17 |     vector<int> b(n);
      |                   ^
a.cc:18:5: error: expected unqualified-id before 'for'
   18 |     for(int i = 0; i < n; i++){
      |     ^~~
a.cc:18:20: error: 'i' does not name a type
   18 |     for(int i = 0; i < n; i++){
      |                    ^
a.cc:18:27: error: 'i' does not name a type
   18 |     for(int i = 0; i < n; i++){
      |                           ^
a.cc:21:19: error: 'n' was not declared in this scope
   21 |     vector<int> c(n - 1);
      |                   ^
a.cc:22:5: error: expected unqualified-id before 'for'
   22 |     for(int i = 0; i < n; i++){
      |     ^~~
a.cc:22:20: error: 'i' does not name a type
   22 |     for(int i = 0; i < n; i++){
      |                    ^
a.cc:22:27: error: 'i' does not name a type
   22 |     for(int i = 0; i < n; i++){
      |                           ^
a.cc:27:5: error: expected unqualified-id before 'for'
   27 |     for(int i = 0; i < n; i++){
      |     ^~~
a.cc:27:20: error: 'i' does not name a type
   27 |     for(int i = 0; i < n; i++){
      |                    ^
a.cc:27:27: error: 'i' does not name a type
   27 |     for(int i = 0; i < n; i++){
      |                           ^
a.cc:33:5: error: 'cout' does not name a type
   33 |     cout << result << endl;
      |     ^~~~
a.cc:34:1: error: expected declaration before '}' token
   34 | }
      | ^
Language: C++

#include <iostream>

using namespace std;

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 'nn' was not declared in this scope; did you mean 'n'?
    5 |   cin>>nn;
      |        ^~
      |        n
a.cc:16:15: error: expected ']' before ';' token
   16 |       s+=c[i+1;
      |               ^
      |               ]
a.cc:20:13: error: expected '}' at end of input
   20 |            }
      |             ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: lvalue required as left operand of assignment
   10 |   rep(i,n-1) if(a[i]+1=a[i+1]) ans+=c[i];