criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.NoSuchElementException;
import java.util.Scanner;

import utility.FastScanner;

public class Main {
	public static void main(String args[]) {

		FastScanner sc = new FastScanner();
		int n = sc.nextInt();

		int a[] = new int[n];
		int b[] = new int[n];
		int c[] = new int[n - 1];

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

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

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

		int result = Arrays.stream(b).sum();
		for (int i = 0;i < n;i++) {
			result += (a[i] + 1 == a[i] ? c[a[i] - 1] : 0);
		}

		System.out.println(result);
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}

Compiler output:
Main.java:7: error: package utility does not exist
import utility.FastScanner;
              ^
1 error
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); 
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
  
  vector<int> b(n); 
for (int i = 0; i < n; i++) {
cin >> b.at(i);
}

  vector<int> c(n); 
for (int i = 0; i < n; i++) {
cin >> c.at(i);
}

int ans =0;


  
  for(int i=0; i<n-1; i++){
    ans = ans + b.at(a.at(i)-1);
    
    if(a.at(i+1)-a.at(i)==1){
    
    ans=ans+c.at(a.at(i));
  }
  }



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

  
  
  
  
  cout<<ans<<endl;

  

  
  return 0;
}

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

#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
typedef long long int ll;
using namespace std;

int n;
int a[20], b[20], c[20];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: expected primary-expression before ',' token
   21 |   cout << ans <, endl;
      |                ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n, t;
  long long int ans = 0;
  cin >> n;
  vector<int> a, b, c;
  for(int i=0;i<n;i++){
    cin >> t;
    a.push_back(t);
  }
  for(int i=0;i<n;i++){
    cin >> t;
    b.push_back(t);
    ans += t;
  }
  for(int i=0;i<n-1;i++){
    cin >> t;
    c.push_back(t);
  }
  int prev = -2;
  for(int i=0;i<n;i++){
    if(prev+1=a[i]) ans += c[prev];
    prev = a[i];
  }
  cout << ans << endl;
}

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

#include<iostream>
#include<vector>
int main(){
  int n, t;
  long long int ans = 0;
  cin >> n;
  vector<int> a, b, c;
  for(int i=0;i<n;i++){
    cin >> t;
    a.push_back(t);
  }
  for(int i=0;i<n;i++){
    cin >> t;
    b.push_back(t);
    ans += t;
  }
  for(int i=0;i<n-1;i++){
    cin >> t;
    c.push_back(t);
  }
  int prev = -2;
  for(int i=0;i<n;i++){
    if(prev+1=a[i]) ans += c[prev];
    prev = a[i];
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> a, b, c;
      |   ^~~~~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> a, b, c;
      |          ^~~
a.cc:10:5: error: 'a' was not declared in this scope
   10 |     a.push_back(t);
      |     ^
a.cc:14:5: error: 'b' was not declared in this scope
   14 |     b.push_back(t);
      |     ^
a.cc:19:5: error: 'c' was not declared in this scope
   19 |     c.push_back(t);
      |     ^
a.cc:23:15: error: 'a' was not declared in this scope
   23 |     if(prev+1=a[i]) ans += c[prev];
      |               ^
a.cc:23:28: error: 'c' was not declared in this scope
   23 |     if(prev+1=a[i]) ans += c[prev];
      |                            ^
a.cc:24:12: error: 'a' was not declared in this scope
   24 |     prev = a[i];
      |            ^
a.cc:26:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:26:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   26 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int mmain()':
a.cc:19:3: error: 'i' was not declared in this scope
   19 |   i=0;
      |   ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[n][n];
  for (int i=0; i<n;i++)
      for (int j=0; j<n;j++){
        if(i!=n-1 && j!=n-1)
          continue;
  		cin >> a[i][j];
      }
 int points = 0
      for (int j=0; j<n;j++){
        if(i!=n-1 && j!=n-1)
          continue;
  		points += a[1][j] ;
        if (j>0 && (a[0][j] == (a[0][j-1] - 1))){
          points += a[2][j-1];
        }
      }
  cout << points;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: expected ',' or ';' before 'for'
   14 |       for (int j=0; j<n;j++){
      |       ^~~
a.cc:14:21: error: 'j' was not declared in this scope
   14 |       for (int j=0; j<n;j++){
      |                     ^
Language: C

#include<stdio.h>
#include<>
int manzoku(int order, int kind);

void main(){
    int kind = 0;
    int order[20];
    int i = 0;
    int manzokuA = 0;
    
    while(1){
        scanf("%d\n",&kind);
        if(kind < 2){
            printf("please 3 or more!");
            continue;
        }
        break;
    }
    for(kind; kind > 0; kind--){
        scanf("%d "&order[i]); 
        i++;
        manzokuA = manzoku(order, kind);   
    }
    printf("\n");
    printf("%d",manzoku);
    
}

int manzoku(int order[], int kind){
    int manzokuC = 3;
    int manzokuB = 0;
    for(int i = order.length; i > 0; i--){
            manzokuB += i; 
        if((order[i] - 1) == order[i - 1]){
            manzokuB += manzokuC;
        }
    }
    return manzokuB;
}

Compiler output:
main.c:2:9: error: empty filename in #include
    2 | #include<>
      |         ^~
main.c: In function 'main':
main.c:20:20: error: invalid operands to binary & (have 'char *' and 'int')
   20 |         scanf("%d "&order[i]);
      |               ~~~~~^~~~~~~~~
      |               |          |
      |               char *     int
main.c:22:28: error: passing argument 1 of 'manzoku' makes integer from pointer without a cast [-Wint-conversion]
   22 |         manzokuA = manzoku(order, kind);
      |                            ^~~~~
      |                            |
      |                            int *
main.c:3:17: note: expected 'int' but argument is of type 'int *'
    3 | int manzoku(int order, int kind);
      |             ~~~~^~~~~
main.c: At top level:
main.c:29:5: error: conflicting types for 'manzoku'; have 'int(int *, int)'
   29 | int manzoku(int order[], int kind){
      |     ^~~~~~~
main.c:3:5: note: previous declaration of 'manzoku' with type 'int(int,  int)'
    3 | int manzoku(int order, int kind);
      |     ^~~~~~~
main.c: In function 'manzoku':
main.c:32:22: error: request for member 'length' in something not a structure or union
   32 |     for(int i = order.length; i > 0; i--){
      |                      ^
Language: C++

happy = 0
bonus = 0

N = int(input())

list_A = list(map(int, input().split()))
list_B = list(map(int, input().split()))
list_C = list(map(int, input().split()))

for i in range(N-1):
    if list_A[i] + 1 == list_A[i+1]:
        bonus += list_C[i-1]

happy = sum(list_B) + bonus
print(happy)

Compiler output:
a.cc:1:1: error: 'happy' does not name a type
    1 | happy = 0
      | ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std ;
#define rep(i,a,n) for(int i =a;i<n;i++)
#define ios ios_base::sync_with_stdio(0);cin.tie(0);

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: expected ';' before '}' token
   26 |     {s+=c[a[n-1]-1]
      |                    ^
      |                    ;
   27 |         }
      |         ~
Language: C++

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

int main () {
  int N; cin >> N;
  vector<int> A(N+1);
  vector<int> B(N);
  vector<int> C(N);
  int ANS=0;
  int a;
  
  for(int i=0; i<N; i++){
    cin >> A[i];
  }
  A[N] = 0;
  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++){
    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:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^
Language: C++

#include <iostream>
using namespace std;
int main() {
  int a;
  cin >> a;
  int b[a], c[a], e[a-1];
  cin >> b[];
  cin >> c[];
  cin >> e[];
  int d;
  int f;
  for (d=0;d<=a;d++) {
    f += c[b[d]];
    if (d != 0) {
      if (b[d] == (b[d-1] + 1) {
        f += c[d-1];
      }
    }
  }
  cout << f;
}
          

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected primary-expression before ']' token
    7 |   cin >> b[];
      |            ^
a.cc:8:12: error: expected primary-expression before ']' token
    8 |   cin >> c[];
      |            ^
a.cc:9:12: error: expected primary-expression before ']' token
    9 |   cin >> e[];
      |            ^
a.cc:15:31: error: expected ')' before '{' token
   15 |       if (b[d] == (b[d-1] + 1) {
      |          ~                    ^~
      |                               )
a.cc:18:5: error: expected primary-expression before '}' token
   18 |     }
      |     ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int N;
    int S;
    for (int i = 0; i < N; ++i) cin >> A[i] >> B[i] >> C[i];
    cin >> N;
    for (int i = 0; i < N; ++i){
         cin >> A[i] >> B[i] >> C[i];
         S += B[A[i]] + C[A[i]+1];
    }
  cout << S << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:40: error: 'A' was not declared in this scope
    7 |     for (int i = 0; i < N; ++i) cin >> A[i] >> B[i] >> C[i];
      |                                        ^
a.cc:7:48: error: 'B' was not declared in this scope
    7 |     for (int i = 0; i < N; ++i) cin >> A[i] >> B[i] >> C[i];
      |                                                ^
a.cc:7:56: error: 'C' was not declared in this scope
    7 |     for (int i = 0; i < N; ++i) cin >> A[i] >> B[i] >> C[i];
      |                                                        ^
a.cc:10:17: error: 'A' was not declared in this scope
   10 |          cin >> A[i] >> B[i] >> C[i];
      |                 ^
a.cc:10:25: error: 'B' was not declared in this scope
   10 |          cin >> A[i] >> B[i] >> C[i];
      |                         ^
a.cc:10:33: error: 'C' was not declared in this scope
   10 |          cin >> A[i] >> B[i] >> C[i];
      |                                 ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int N, int A[20], B[20], int C[21];
    cin >> N;
    for (int i = 0; i < N; ++i){
         cin >> A[i] >> B[i] >> C[i];
         S += B[A[i]] + C[A[i]+1];
    }
  cout << S << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: expected unqualified-id before 'int'
    5 |         int N, int A[20], B[20], int C[21];
      |                ^~~
a.cc:8:17: error: 'A' was not declared in this scope
    8 |          cin >> A[i] >> B[i] >> C[i];
      |                 ^
a.cc:8:25: error: 'B' was not declared in this scope
    8 |          cin >> A[i] >> B[i] >> C[i];
      |                         ^
a.cc:8:33: error: 'C' was not declared in this scope
    8 |          cin >> A[i] >> B[i] >> C[i];
      |                                 ^
a.cc:9:10: error: 'S' was not declared in this scope
    9 |          S += B[A[i]] + C[A[i]+1];
      |          ^
a.cc:11:11: error: 'S' was not declared in this scope
   11 |   cout << S << endl;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
//template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
signed main (){
  int n,a,b;
  cin>>n>>a>>b;
  int d=0;
  for(i=1; i<=b; i++){
    d+=i;
  int c=0;
  for(n[i]==a[i],n[i+1]==a[i+1]) ++c[i-1];
  cout<<　d+c <<endl;
}
  


Compiler output:
a.cc:117:9: error: extended character 　 is not valid in an identifier
  117 |   cout<<　d+c <<endl;
      |         ^
a.cc: In function 'int main()':
a.cc:113:7: error: 'i' was not declared in this scope
  113 |   for(i=1; i<=b; i++){
      |       ^
a.cc:117:9: error: '\U00003000d' was not declared in this scope
  117 |   cout<<　d+c <<endl;
      |         ^~~
a.cc:118:1: error: expected primary-expression before '}' token
  118 | }
      | ^
a.cc:117:22: error: expected ')' before '}' token
  117 |   cout<<　d+c <<endl;
      |                      ^
      |                      )
  118 | }
      | ~                     
a.cc:116:6: note: to match this '('
  116 |   for(n[i]==a[i],n[i+1]==a[i+1]) ++c[i-1];
      |      ^
a.cc:118:1: error: expected primary-expression before '}' token
  118 | }
      | ^
a.cc:118:2: error: expected '}' at end of input
  118 | }
      |  ^
a.cc:109:15: note: to match this '{'
  109 | signed main (){
      |               ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int N;
  cin >> N;
  
  vector<int> vec(N);
  vector<int> a(N);
  vector<int> b(N);
  vector<int> 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);
  }
  
  int n;
  
  for (int i = 0; i < N; i++) {
    n = n + b.at(i);
  }
  
  int s;
  
  for (int i = 0; i < N-1; i ++) {
    if (a.at(i+1) - a.at(i) == 1) {
      s = a.at(i);
      n = n + c.at(i);
    }
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> vec(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> vec(N);
      |          ^~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> a(N);
      |          ^~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> b(N);
      |          ^~~
a.cc:11:10: error: expected primary-expression before 'int'
   11 |   vector<int> c(N);
      |          ^~~
a.cc:14:12: error: 'a' was not declared in this scope
   14 |     cin >> a.at(i);
      |            ^
a.cc:17:12: error: 'b' was not declared in this scope
   17 |     cin >> b.at(i);
      |            ^
a.cc:20:12: error: 'c' was not declared in this scope
   20 |     cin >> c.at(i);
      |            ^
a.cc:26:13: error: 'b' was not declared in this scope
   26 |     n = n + b.at(i);
      |             ^
a.cc:32:9: error: 'a' was not declared in this scope
   32 |     if (a.at(i+1) - a.at(i) == 1) {
      |         ^
a.cc:34:15: error: 'c' was not declared in this scope
   34 |       n = n + c.at(i);
      |               ^
Language: C++

#include <bits/stdc++.h>
#pragma GCC optimize(2)
#define ll long long
#define ull unsigned long long

using namespace std;

int a[25], b[25], c[25], n;

inline ll in()
{
	ll Req = 0, wX = 0; char ch;
	while (!isdigit(ch)) {wX |= (ch == '-'); ch = getchar();}
	while (isdigit(ch)) {Req = (Req << 3) + (Req << 1) + (ch ^ 48); ch = getchar();}
	return wX ? -Req : Req;
}

inline void out(ll x)
{
	register short Pxn[20], Ry = 0;
	if (x == 0) putchar('0');
	if (x < 0) putchar('-'), x = -x;
	while (x != 0) Pxn[Ry] = x % 10, x /= 10, Ry++;
	for (int i = Ry - 1; i >= 0; i--) putchar(Pxn[i] + '0');
}

int main()
{

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

  return 0;

}
【RE】...(820061221)  20:57:36


Compiler output:
a.cc:45:1: error: extended character 【 is not valid in an identifier
   45 | 【RE】...(820061221)  20:57:36
      | ^
a.cc:45:1: error: extended character 】 is not valid in an identifier
a.cc: In function 'void out(long long int)':
a.cc:20:24: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   20 |         register short Pxn[20], Ry = 0;
      |                        ^~~
a.cc:20:33: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   20 |         register short Pxn[20], Ry = 0;
      |                                 ^~
a.cc: At global scope:
a.cc:45:1: error: '\U00003010RE\U00003011' does not name a type
   45 | 【RE】...(820061221)  20:57:36
      | ^~~~~~
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int number = sc.nextInt();
    int[] junban = new int[number];
    int[] manzoku = new int[number];
    int[] addManzoku = new int[number-1];
    int sumManzoku = 0;
    for(int i = 0; i < number; i++){
    	junban[i] = sc.nextInt();
    }
    for(int j = 0; j < number; j++){
    	manzoku[j] = sc.nextInt();
        sumManzoku += manzoku[j];
    }
    for(int k = 0; k < number-1; k++){
    	addManzoku[k] = sc.nextInt();
    }
    int sumManzoku = 0;
      
    for(int l = 1; l < number; l++){
      if(junban[l]-1 == junban[l-1]){
      	sumManzoku += addManzoku[junban[l-1]];
      }
    }
    System.out.println(sumManzoku);
    
    }
 
 
 
}

Compiler output:
Main.java:21: error: variable sumManzoku is already defined in method main(String[])
    int sumManzoku = 0;
        ^
1 error
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int N;
  cin >> N;
  
  vector<int> a(N);
  vector<int> b(N);
  vector<int> 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);
  }
  
  int n;
  
  for (int i = 0; i < N; i++) {
    n = n + b.at(i);
  }
  
  int s;
  
  for (int i = 0; i < N-1; i ++) {
    if (a.at(i+1) - a.at(i) == 1) {
      s = a.at(i);
      n = n + c.at(i);
    }
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> a(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> a(N);
      |          ^~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> b(N);
      |          ^~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> c(N);
      |          ^~~
a.cc:13:12: error: 'a' was not declared in this scope
   13 |     cin >> a.at(i);
      |            ^
a.cc:16:12: error: 'b' was not declared in this scope
   16 |     cin >> b.at(i);
      |            ^
a.cc:19:12: error: 'c' was not declared in this scope
   19 |     cin >> c.at(i);
      |            ^
a.cc:25:13: error: 'b' was not declared in this scope
   25 |     n = n + b.at(i);
      |             ^
a.cc:31:9: error: 'a' was not declared in this scope
   31 |     if (a.at(i+1) - a.at(i) == 1) {
      |         ^
a.cc:33:15: error: 'c' was not declared in this scope
   33 |       n = n + c.at(i);
      |               ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#include <cmath>
 
using namespace std;
using ll =long long;

bool is_int_lround(double x){
  return std::lround(x)==x;
}
int ketasuu(int x){
  int n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}
ll gcd11(ll x, ll y){
  long long a= max(x,y), b=min(x,y), c=a%b;
  while( c!=0){
    a =b;
    b =c;
    c = a%b;
  }
  return b;
}

int ab(int x, int y){
  if(x>=y){
    return x-y;
  }
  else if(y>x){
    return y-x;
  }
}
int main(){
  int n;
  cin>> n;
  int a[n];
  int b[n];
  int c[n-1];
  int sum =0;
  for(int i=0;i<n;i++){
    cin >>a[i];
  }
  for(int i=0 ; i<n ; i++){
    cin >>b[i];
    sum += b[i];
  } 
  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]-1];
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:58:4: error: expected '}' at end of input
   58 |   }
      |    ^
a.cc:37:11: note: to match this '{'
   37 | int main(){
      |           ^
a.cc: In function 'int ab(int, int)':
a.cc:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^
Language: Java

import java.util.Scanner;

public class atcoder_907 {
	public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	int menuNum = sc.nextInt();
	int[]  menuArray = new int [menuNum];
	int[]  manzokuArray = new int [menuNum];
	int[]  manpukuArray = new int [menuNum-1];
	int lastManzoku = 0;
	boolean lastMem= false;
	int count = 0;

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

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

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

	for(int i = 1; i < menuNum; i++) {
		lastManzoku += manzokuArray[menuArray[i-1]-1];
		lastMem = false;
		if(menuArray[i-1] == (menuArray[i+1-1] - 1)) {
			lastMem = true;
		} else {
			lastMem = false;
		}
		if(lastMem) {
			lastManzoku += manpukuArray[count];
			count++;
		}
	}

	System.out.println(lastManzoku);

    // Scannerクラスのインスタンスをクローズ
	sc.close();
	}
}


Compiler output:
Main.java:3: error: class atcoder_907 is public, should be declared in a file named atcoder_907.java
public class atcoder_907 {
       ^
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: 'I' was not declared in this scope
   10 |   for (int i = 0; i < N; I++) {
      |                          ^
a.cc:22:15: error: lvalue required as left operand of assignment
   22 |     if (i > 0 && A[i] + 1 = A[i + 1]) ans += C[A[i]];
      |         ~~~~~~^~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main(){
	int n;
  	cin >> n;
  	int ans = 0;
  	int m;
  	int a[n];
  	int b[n];
  	int c[n-1];
  	
  	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<n; i++){
      m = a[i];
      ans = ans + b[m];
      if (i != 0 && a[i-1] + 1 == a[i])
        ans = ans + b[m-1];
    }
  
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'i' was not declared in this scope
   15 |         for(i=0; i<n; i++)
      |             ^
a.cc:18:13: error: 'i' was not declared in this scope
   18 |         for(i=0; i<n; i++)
      |             ^
a.cc:21:13: error: 'i' was not declared in this scope
   21 |         for(i=0; i<n-1; i++)
      |             ^
a.cc:24:13: error: 'i' was not declared in this scope
   24 |         for(i=0; i<n; i++){
      |             ^
Language: C++

int main() {
    int n,tmp,ans=0;
    cin >> n;
    map<int,int> mzk;
    vector<int> jbn(n);
    vector<int> ex(n-1);
    for (int i=0; i<n; ++i)
        cin >> jbn.at(i);

    for (int i=1; i<=n; ++i) {
        cin >> tmp;
        mzk[i] = tmp;
    }

    for (int i=0; i<n-1; ++i)
        cin >> ex.at(i);

    tmp = 0;

    for (auto& e : jbn) {
        ans += mzk.at(e);
        if (tmp != 0 && (e - tmp) == 1 )
            ans += ex.at(tmp-1);
        tmp = e;
    }

    cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n;
      |     ^~~
a.cc:4:5: error: 'map' was not declared in this scope
    4 |     map<int,int> mzk;
      |     ^~~
a.cc:4:9: error: expected primary-expression before 'int'
    4 |     map<int,int> mzk;
      |         ^~~
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<int> jbn(n);
      |     ^~~~~~
a.cc:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> jbn(n);
      |            ^~~
a.cc:6:12: error: expected primary-expression before 'int'
    6 |     vector<int> ex(n-1);
      |            ^~~
a.cc:8:16: error: 'jbn' was not declared in this scope
    8 |         cin >> jbn.at(i);
      |                ^~~
a.cc:12:9: error: 'mzk' was not declared in this scope
   12 |         mzk[i] = tmp;
      |         ^~~
a.cc:16:16: error: 'ex' was not declared in this scope
   16 |         cin >> ex.at(i);
      |                ^~
a.cc:20:20: error: 'jbn' was not declared in this scope
   20 |     for (auto& e : jbn) {
      |                    ^~~
a.cc:21:16: error: 'mzk' was not declared in this scope
   21 |         ans += mzk.at(e);
      |                ^~~
a.cc:23:20: error: 'ex' was not declared in this scope
   23 |             ans += ex.at(tmp-1);
      |                    ^~
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << ans;
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{ 
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,a[30],b[100],c[100],z=0,;
  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-1;i++){
    cin>>c[i];
  }
  for(int i=1;i<=n;i++){
    z+=b[a[i]];
    if(a[i+1]-a[i]==1){
      z+=c[a[i]];
    }
  }
  cout<<z<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:33: error: expected unqualified-id before ';' token
    7 |   int n,a[30],b[100],c[100],z=0,;
      |                                 ^
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,a,b,c;
  cin>>n>>a>>b>>c;
  
  vector<int> a(n); 
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
  
  vector<int> b(n); 
for (int i = 0; i < 50; i++) {
cin >> b.at(i);
}

  vector<int> c(n); 
for (int i = 0; i < 50; i++) {
cin >> c.at(i);
}

int ans =0;
  
  for(int i=0; i<n; i++){
    ans = ans + b.at(a.at(i)-1);
    
    if(a.at(i+1)-a.at(i)==1){
    
    ans=ans+c.at(i+1);
  }
  }
  
  
  
  
  cout<<ans<<endl;

  

  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: conflicting declaration 'std::vector<int> a'
   11 |   vector<int> a(n);
      |               ^
a.cc:8:9: note: previous declaration as 'int a'
    8 |   int n,a,b,c;
      |         ^
a.cc:13:10: error: request for member 'at' in 'a', which is of non-class type 'int'
   13 | cin >> a.at(i);
      |          ^~
a.cc:16:15: error: conflicting declaration 'std::vector<int> b'
   16 |   vector<int> b(n);
      |               ^
a.cc:8:11: note: previous declaration as 'int b'
    8 |   int n,a,b,c;
      |           ^
a.cc:18:10: error: request for member 'at' in 'b', which is of non-class type 'int'
   18 | cin >> b.at(i);
      |          ^~
a.cc:21:15: error: conflicting declaration 'std::vector<int> c'
   21 |   vector<int> c(n);
      |               ^
a.cc:8:13: note: previous declaration as 'int c'
    8 |   int n,a,b,c;
      |             ^
a.cc:23:10: error: request for member 'at' in 'c', which is of non-class type 'int'
   23 | cin >> c.at(i);
      |          ^~
a.cc:29:19: error: request for member 'at' in 'b', which is of non-class type 'int'
   29 |     ans = ans + b.at(a.at(i)-1);
      |                   ^~
a.cc:29:24: error: request for member 'at' in 'a', which is of non-class type 'int'
   29 |     ans = ans + b.at(a.at(i)-1);
      |                        ^~
a.cc:31:10: error: request for member 'at' in 'a', which is of non-class type 'int'
   31 |     if(a.at(i+1)-a.at(i)==1){
      |          ^~
a.cc:31:20: error: request for member 'at' in 'a', which is of non-class type 'int'
   31 |     if(a.at(i+1)-a.at(i)==1){
      |                    ^~
a.cc:33:15: error: request for member 'at' in 'c', which is of non-class type 'int'
   33 |     ans=ans+c.at(i+1);
      |               ^~
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int number = sc.nextInt();
    int[] jumban = new int[number];
    int[] manzoku = new int[number];
    int[] addManzoku = new int[number-1];
    for(int i = 0; i < number; i++){
    	jumban[i] = sc.nextInt();
    }
    for(int j = 0; j < number; j++){
    	manzoku[j] = sc.nextInt();
    }
    for(int k = 0; k < number-1; k++){
    	addManzoku[k] = sc.nextInt();
    }
    int sumManzoku = 0;
    for(int l = 0; l < number; l++){
    	int bango = jumban[l];
        sumManzoku += manzoku[bango];
        if(l > 0 && jumban[l]-1 == jumban[l-1]){
        	sumManzoku += addManzoku[l-1];
        }
    }
    system.out.println(sumManzoku);
    
    }
 
 
 
}

Compiler output:
Main.java:27: error: package system does not exist
    system.out.println(sumManzoku);
          ^
1 error
Language: C++

#include <iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'for'
    6 |   for (int i = 0, i < n, ++i){
      |   ^~~
a.cc:9:20: error: expected ';' before '<' token
    9 |   for (int i = 0, i < n, ++i){
      |                    ^~
      |                    ;
a.cc:9:21: error: expected primary-expression before '<' token
    9 |   for (int i = 0, i < n, ++i){
      |                     ^
a.cc:9:29: error: expected ';' before ')' token
    9 |   for (int i = 0, i < n, ++i){
      |                             ^
      |                             ;
a.cc:12:20: error: expected ';' before '<' token
   12 |   for (int i = 0, i < n - 1, ++i){
      |                    ^~
      |                    ;
a.cc:12:21: error: expected primary-expression before '<' token
   12 |   for (int i = 0, i < n - 1, ++i){
      |                     ^
a.cc:12:33: error: expected ';' before ')' token
   12 |   for (int i = 0, i < n - 1, ++i){
      |                                 ^
      |                                 ;
a.cc:13:21: error: 'c' was not declared in this scope
   13 |         std::cin >> c[i];
      |                     ^
a.cc:18:20: error: expected ';' before '<' token
   18 |   for (int i = 0, i < n, ++i){
      |                    ^~
      |                    ;
a.cc:18:21: error: expected primary-expression before '<' token
   18 |   for (int i = 0, i < n, ++i){
      |                     ^
a.cc:18:29: error: expected ';' before ')' token
   18 |   for (int i = 0, i < n, ++i){
      |                             ^
      |                             ;
a.cc:21:16: error: 'c' was not declared in this scope
   21 |         sum += c[last - 1]
      |                ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'k' was not declared in this scope
   18 |     if(a[i+1]-a[k]==1) sum+=c[a[k]];
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pop pop_back
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
//template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
signed main (){
  int n,a,b;
  cin>>n>>a>>b;
  int d;
  cin>>d;
  d+=b[i];
  int c=0;
  if(n[i]==a[i],n[i+1]==a[i+1]) ++c[i-1];
  cout<<　d+c <<endl;
}
  
  


Compiler output:
a.cc:117:9: error: extended character 　 is not valid in an identifier
  117 |   cout<<　d+c <<endl;
      |         ^
a.cc: In function 'int main()':
a.cc:114:8: error: 'i' was not declared in this scope
  114 |   d+=b[i];
      |        ^
a.cc:117:9: error: '\U00003000d' was not declared in this scope
  117 |   cout<<　d+c <<endl;
      |         ^~~
Language: C++

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


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

#include<iostream>
using namespace std;
int main(void){
  int n; cin >> n;
	int res = 0;
	vector<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 tmp = 10000;
	rep(i, n) {
		res += b[a[i]-1];
		if (tmp + 1 == a[i])res += c[a[i]-2];
		//cout << res << " ";
		tmp = a[i];
	}
	cout << res << endl;
  return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'vector' was not declared in this scope
    6 |         vector<int> a(n), b(n), c(n-1);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:16: error: expected primary-expression before 'int'
    6 |         vector<int> a(n), b(n), c(n-1);
      |                ^~~
a.cc:7:13: error: 'i' was not declared in this scope
    7 |         rep(i, n)cin >> a[i];
      |             ^
a.cc:7:9: error: 'rep' was not declared in this scope; did you mean 'res'?
    7 |         rep(i, n)cin >> a[i];
      |         ^~~
      |         res
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:19: error: lvalue required as left operand of assignment
   16 |     if(i>0 && i<N && a[i+1]=a[i]+1){
      |        ~~~~~~~~~~~^~~~~~~~~
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] A = new int[20];
		int[] B = new int[20];
		int[] C = new int[20];
		int i = 0;
		int cs = 0;
		int csSum = 0;
		
		for( i = 0; i<N; i++) {
			A[i] = sc.nextInt();
		}

		for( i = 0; i<N; i++) {
			B[i] = sc.nextInt();
		}

		for( i = 0; i<N-1; i++) {
			C[i] = sc.nextInt();
		}
		for(i = 1; i<=N; i++) {
			if(A[i] == (A[i-1]+1)) {
				cs = B[A[i-1]-1] + C[A[i-1]-1];
			}else {
				cs = B[A[i-1]-1];
			}
			csSum += cs;
		}
		System.out.println(csSum);

		sc.close();
		
	}

Compiler output:
Main.java:37: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: 'A' was not declared in this scope
   15 |     sum+=A[i];
      |          ^
a.cc:17:6: error: 'C' was not declared in this scope
   17 | sum+=C[i];}}
      |      ^
Language: Java

import java.util.*;
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];
for(int i=0;i<n;i++)
a[i]=sc.nextInt();
for(int i=0;i<n;i++)
b[i]=sc.nextInt();
for(int i=0;i<n-1;i++)
c[i]=sc.nextInt();
long ans=0;
for(int i=0;i<n;i++)
{
if(i==0)
ans+=b[a[i]-1];
else
{
if(a[i]==a[i-1]+1)
{
ans+=b[a[i]-1]+c[a[i-1]];
}
else ans+=b[a[i]-1];
}
}
System.out.println(ans);
}
}

Compiler output:
Main.java:4: error: '(' or '[' expected
Scanner sc=new Scanner System.in();
                       ^
1 error
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,a,b,c;
  cin>>n>>a>>b>>c;
  
  vector<int> a(n); 
for (int i = 0; i < n; i++) {
cin >> a.at(i);
}
  
  vector<int> b(n); 
for (int i = 0; i < n; i++) {
cin >> b.at(i);
}

  vector<int> c(n); 
for (int i = 0; i < n; i++) {
cin >> c.at(i);
}

int ans =0;
  
  for(int i=0; i<n; i++){
    ans = ans + b.at(a.at(i)-1);
    
    if(a.at(i+1)-a.at(i)==1){
    
    ans=ans+c.at(i+1);
  }
  }
  
  
  
  
  cout<<ans<<endl;

  

  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: conflicting declaration 'std::vector<int> a'
   11 |   vector<int> a(n);
      |               ^
a.cc:8:9: note: previous declaration as 'int a'
    8 |   int n,a,b,c;
      |         ^
a.cc:13:10: error: request for member 'at' in 'a', which is of non-class type 'int'
   13 | cin >> a.at(i);
      |          ^~
a.cc:16:15: error: conflicting declaration 'std::vector<int> b'
   16 |   vector<int> b(n);
      |               ^
a.cc:8:11: note: previous declaration as 'int b'
    8 |   int n,a,b,c;
      |           ^
a.cc:18:10: error: request for member 'at' in 'b', which is of non-class type 'int'
   18 | cin >> b.at(i);
      |          ^~
a.cc:21:15: error: conflicting declaration 'std::vector<int> c'
   21 |   vector<int> c(n);
      |               ^
a.cc:8:13: note: previous declaration as 'int c'
    8 |   int n,a,b,c;
      |             ^
a.cc:23:10: error: request for member 'at' in 'c', which is of non-class type 'int'
   23 | cin >> c.at(i);
      |          ^~
a.cc:29:19: error: request for member 'at' in 'b', which is of non-class type 'int'
   29 |     ans = ans + b.at(a.at(i)-1);
      |                   ^~
a.cc:29:24: error: request for member 'at' in 'a', which is of non-class type 'int'
   29 |     ans = ans + b.at(a.at(i)-1);
      |                        ^~
a.cc:31:10: error: request for member 'at' in 'a', which is of non-class type 'int'
   31 |     if(a.at(i+1)-a.at(i)==1){
      |          ^~
a.cc:31:20: error: request for member 'at' in 'a', which is of non-class type 'int'
   31 |     if(a.at(i+1)-a.at(i)==1){
      |                    ^~
a.cc:33:15: error: request for member 'at' in 'c', which is of non-class type 'int'
   33 |     ans=ans+c.at(i+1);
      |               ^~
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++){
    cin >> a.at(i);
  }
  vector<int> b(n);
  for(int i = 0; i < n; i++){
    cin >> b.at(i);
  }
  vector<int> c(n - 1);
  for(int i = 0; i < n - 1; i++){
    cin >> c.at(i);
  }
  int ans = 0;
  for(int i = 0; i < n; i++){
    ans += b.at(i);
  }
  for(int i = 0; i < n - 1 ; i++){
    if(a.at(i) + 1 == a.at(i + 1)){
      if(a.at(i + 1) == 2){
        ans += c.at(0);
      }
      else if{
        int j = 0;
        j = a.at(i + 1)/ 2;
        ans += c.at(j);
      }
    }
  }
  cout << ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:14: error: expected '(' before '{' token
   28 |       else if{
      |              ^
      |              (