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

#include<stdio.h>
#include<stdlib.h>
int main()
{
	int ANS = 0;
	int N ;//
	int BSUM=0, CSUM=0;tmp//
	int A[21];//各桁の数を格納
  	int B[21];//各桁の数を格納
  	int C[21];//各桁の数を格納
 
	//Nをスキャン
	scanf("%d", &N);
	//N個の数字をスキャン 0からN-1まで
 	for (int i = 0; i < N; i++) { 
		scanf("%d", &A[i]);
	}
	for (int i = 0; i < N; i++) { 
		scanf("%d", &B[i]);
      BSUM=BSUM+B[i];
	}
   	for (int i = 0; i < N-1; i++) { 
		scanf("%d", &C[i]);
	}
   	for (int i = 0; i < N-1; i++) { 
		if(A[i]==A[i+1]-1){
          tmp=A[i];
          CSUM=CSUM+C[tmp];
        }
	}
  
 
	ANS = BSUM + CSUM;
 
	printf("%d", ANS);
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: 'tmp' was not declared in this scope
    7 |         int BSUM=0, CSUM=0;tmp//
      |                            ^~~
a.cc:16:30: error: 'A' was not declared in this scope
   16 |                 scanf("%d", &A[i]);
      |                              ^
a.cc:26:20: error: 'A' was not declared in this scope
   26 |                 if(A[i]==A[i+1]-1){
      |                    ^
Language: C++

#include <stdio.h>

int main(){
  int a[20],b[20],c[20];
  int n,s=0;

  scanf("%d",&n);
  
  for (int i = 1;i >= n;i++){
    scanf("%d",&a[i]);
  }
  for (int i = 1;i >= n;i++){
    scanf("%d",&b[i]);
  }
  for (int i = 1;i >= n - 1;i++){
    scanf("%d",&c[i]);
  }
  for(int i = 1;i >= n;i++){
    if (a[i+1]-a[i] == 1){
      s+=b[a[i]] + c[a[i]];
    }else{
      s+=b[a[i]];
    }
  }
  printf(%d,s);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:10: error: expected primary-expression before '%' token
   25 |   printf(%d,s);
      |          ^
a.cc:25:11: error: 'd' was not declared in this scope
   25 |   printf(%d,s);
      |           ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
int main()
{
	int ANS = 0;
	int N ;//
	int BSUM=0, CSUM=0;tmp//
	int A[21];//各桁の数を格納
  	int B[21];//各桁の数を格納
  	int C[21];//各桁の数を格納
 
	//Nをスキャン
	scanf("%d", &N);
	//N個の数字をスキャン 0からN-1まで
 	for (int i = 0; i < N; i++) { 
		scanf("%d", &A[i]);
	}
	for (int i = 0; i < N; i++) { 
		scanf("%d", &B[i]);
      BSUM=BSUM+B[i];
	}
   	for (int i = 0; i < N-1; i++) { 
		scanf("%d", &C[i]);
	}
   	for (int i = 0; i < N-1; i++) { 
		if(A[i]==A[i+1]-1){
          tmp=A[i];
          CSUM=CSUM+C[tmp];
        }
	}
  
 
	ANS = BSUM - CSUM;
 
	printf("%d", ANS);
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: 'tmp' was not declared in this scope
    7 |         int BSUM=0, CSUM=0;tmp//
      |                            ^~~
a.cc:16:30: error: 'A' was not declared in this scope
   16 |                 scanf("%d", &A[i]);
      |                              ^
a.cc:26:20: error: 'A' was not declared in this scope
   26 |                 if(A[i]==A[i+1]-1){
      |                    ^
Language: C++

#include <iostream>

using namespace std;

int main(){
  	int sum = 0;
  	int N;
  	cin >> N;
  
  	vector<int> A;
 	A.resize(N);
	for(int i = 0; i < N;i++){
    	cin >> A[i];
    }
  
  	vector <int> B;
  	B.resize(N);
  	for(int i = 0; i < N;i++){
    	cin >> B[i];
    }
  
  	vector <int> C;
  	C.resize(N - 1);
  	for(int i = 0; i < N;i++){
    	cin >> B[i];
    }	
  
  	for (int i = 0; i < N; i++){
    	int A_index = A[i];
      	int B_point = B[A_index];
		sum += B_point;
      	
      	if(i != 0){
          if(A_index == (A[i-1] +  1)){
            sum += C[A[i-1]];
          }
        }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'vector' was not declared in this scope
   10 |         vector<int> A;
      |         ^~~~~~
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 | 
a.cc:10:16: error: expected primary-expression before 'int'
   10 |         vector<int> A;
      |                ^~~
a.cc:11:9: error: 'A' was not declared in this scope
   11 |         A.resize(N);
      |         ^
a.cc:16:17: error: expected primary-expression before 'int'
   16 |         vector <int> B;
      |                 ^~~
a.cc:17:9: error: 'B' was not declared in this scope
   17 |         B.resize(N);
      |         ^
a.cc:22:17: error: expected primary-expression before 'int'
   22 |         vector <int> C;
      |                 ^~~
a.cc:23:9: error: 'C' was not declared in this scope
   23 |         C.resize(N - 1);
      |         ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:53: error: 'j' was not declared in this scope
    8 |   int c[n-1]; for(int k = 0; k < n-1; k++) cin >> c[j];
      |                                                     ^
Language: C++

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

int main () {
  int n, sum; cin >> n;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(n-1);

  for (int i=0;i<n;i++) {
    cin >> a.at(i) >> b.at(i);
  }
  for (int i=0;i<n-1;i++) cini >> c.at(i);
  for (int i=0;i<n;i++) {
    sum += b.at(i);
    if (a.at(i+1) == a.at(i) + 1) {
      sum += b.at(i) + c.at(i);
    }
  }
  cout << sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: 'cini' was not declared in this scope
   13 |   for (int i=0;i<n-1;i++) cini >> c.at(i);
      |                           ^~~~
Language: C++

#include <stdio.h>

int main()
{
    int n;

    scanf("%d", &n);

    int A[n];
    int B[n];
    int C[n];
    int count = 0;
    for(int i = 0; i < 3*n; i++){
        if(i < n) {
            scanf("%d", &A[i]);
        } else {
            if(i< 2*n) scanf("%d", &B[i]);
        } else {
            scanf("%d", &C[i]);
        }
    }
    for(int j=0 ; j < n ; j++){
        count += B[i];
        if(A[i] == A[i+1] -1){
            count += C[i];
        }
    }
    printf("%d", count);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'else' without a previous 'if'
   18 |         } else {
      |           ^~~~
a.cc:23:20: error: 'i' was not declared in this scope
   23 |         count += B[i];
      |                    ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: no match for call to '(std::vector<int>) (int&)'
   13 |       sum=sum+c(i);
      |               ~^~~
a.cc:15:4: error: expected '}' at end of input
   15 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

#include <stdio.h>

int main(void) {

	int number;
	int array[20], barray[20], carray[19];
	int sum = 0;
	scanf_s("%d", &number);

	for (int i = 0; i<number; i++) {
		scanf("%d", &array[i]);
	}
	for (int i = 0; i<number; i++) {
		scanf("%d", &barray[i]);
	}
	for (int i = 0; i<number - 1; i++) {
		scanf("%d", &carray[i]);
	}

	for (int i = 0; i<number; i++) {
		sum += barray[array[i]-1];
			if ((array[i] == array[i - 1] + 1) && (i != 0)) {
				sum += carray[i - 2];
			}
	}
	printf("%d", sum);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |         scanf_s("%d", &number);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)
#define ll long long
#define pp pair<int,int> 
const int INF = 1001001001;
//int 2×10の9乗

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: conflicting declaration 'int a [0]'
   22 |   int a[0]=INF;
      |       ^
a.cc:17:15: note: previous declaration as 'std::vector<int> a'
   17 |   vector<int> a(n), b(n), c(n-1);
      |               ^
Language: C++

#include <iostream>
#include <vector>

static int x = [](){
    std::ios::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::cout.tie(NULL);
    return NULL;
}();

int main() {
  	int n;
  	std::cin >> n;
  	std::vector<int> a(n), b(n), c(n-1);
  
  	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 prev_dish = -1;
    int points = 0; 
    for(int i = 0; i < n; ++i) {
    	points += b[a[i] - 1];
      	if(prev_dish != -1 && a[i] == prev_dish + 1)
          points += c[prev_dish-1];
      	prev_dish = a[i];
    }
    
    std::cout << points << "\n";
}

Compiler output:
a.cc: In lambda function:
a.cc:8:12: warning: converting to non-pointer type 'long int' from NULL [-Wconversion-null]
    8 |     return NULL;
      |            ^~~~
a.cc: In function 'int main()':
a.cc:33:2: error: expected '}' at end of input
   33 | }
      |  ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
Language: Java

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];
		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();
		}
		
		int satisfact = 0;
		int preNum = 0;
		
		for(int i=0;i<N;i++) {
			int num = A[i];
			satisfact += B[num - 1];
			if(preNum + 1 == num && preNum != 0) {
				satisfact += C[preNum - 1];
			}
			preNum = num;
		}
		
		System.out.println(satisfact);
		
		sc.close();	
	}
}

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

#include <iostream>

int main() {
  	int n;
  	std::cin >> n;
  	std::vector<int> a(n), b(n), c(n-1);
  
  	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 prev_dish = -1;
    int points = 0; 
    for(int i = 0; i < n; ++i) {
    	points += b[a[i] - 1];
      	if(prev_dish != -1 && a[i] == prev_dish + 1)
          points += c[prev_dish-1];
      	prev_dish = a[i];
    }
    
    std::cout << points << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'vector' is not a member of 'std'
    6 |         std::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 | 
a.cc:6:21: error: expected primary-expression before 'int'
    6 |         std::vector<int> a(n), b(n), c(n-1);
      |                     ^~~
a.cc:9:21: error: 'a' was not declared in this scope
    9 |         std::cin >> a[i];
      |                     ^
a.cc:11:21: error: 'b' was not declared in this scope
   11 |         std::cin >> b[i];
      |                     ^
a.cc:13:21: error: 'c' was not declared in this scope
   13 |         std::cin >> c[i];
      |                     ^
a.cc:18:19: error: 'b' was not declared in this scope
   18 |         points += b[a[i] - 1];
      |                   ^
a.cc:18:21: error: 'a' was not declared in this scope
   18 |         points += b[a[i] - 1];
      |                     ^
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

#include<iostream>
int main(){
  int n;
  cin >> n;
   
  int a[20], b[50], c[50];
  for (int i=0; i<n; i++){
    cin >>a[i]>>b[i]>>c[i];
  }
  int ans = 0;
  int tmp = a[0];

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

    ans += b[a[i]-1];
    
    if(tmp+1 == a[i]){
      ans += c[tmp-1];
    }
       
    tmp = a[i];

  }

  cout << ans;


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   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:25:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |   cout << ans;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.Scanner;

public class Main{

    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.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] = scanner.nextInt();

        for (int i = 0; i < n; i++)
            b[i] = scanner.nextInt();

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

        int satisfaction=0;
        for (int i = 0; i < n; i++) {
            satisfaction += b[a[i]-1];

            if(i>0 && a[i]-a[i-1]==1)
                satisfaction += c[a[i-1]-1];
        }

        System.out.println(satisfaction);
    }

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

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

Compiler output:
main.c: In function 'main':
main.c:6:14: error: subscripted value is neither array nor pointer nor vector
    6 | scanf("%d",&a[i]);
      |              ^
main.c:7:14: error: subscripted value is neither array nor pointer nor vector
    7 | scanf("%d",&b[i]);
      |              ^
main.c:8:7: error: subscripted value is neither array nor pointer nor vector
    8 | sum+=b[i];
      |       ^
main.c:11:14: error: subscripted value is neither array nor pointer nor vector
   11 | scanf("%d",&c[i]);
      |              ^
main.c:14:5: error: subscripted value is neither array nor pointer nor vector
   14 | if(a[i]+1==a[i+1]){
      |     ^
main.c:14:13: error: subscripted value is neither array nor pointer nor vector
   14 | if(a[i]+1==a[i+1]){
      |             ^
main.c:15:7: error: subscripted value is neither array nor pointer nor vector
   15 | sum+=c[i];
      |       ^
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:6:14: error: subscripted value is neither array nor pointer nor vector
    6 | scanf("%d",&a[i]);
      |              ^
main.c:7:14: error: subscripted value is neither array nor pointer nor vector
    7 | scanf("%d",&b[i]);
      |              ^
main.c:8:7: error: subscripted value is neither array nor pointer nor vector
    8 | sum+=b[i];
      |       ^
main.c:11:14: error: subscripted value is neither array nor pointer nor vector
   11 | scanf("%d",&c[i]);
      |              ^
main.c:14:5: error: subscripted value is neither array nor pointer nor vector
   14 | if(a[i]+1=a[i+1]){
      |     ^
main.c:14:12: error: subscripted value is neither array nor pointer nor vector
   14 | if(a[i]+1=a[i+1]){
      |            ^
main.c:15:7: error: subscripted value is neither array nor pointer nor vector
   15 | sum+=c[i]}
      |       ^
main.c:15:10: error: expected ';' before '}' token
   15 | sum+=c[i]}
      |          ^
      |          ;
Language: C++

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

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

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

Compiler output:
main.c: In function 'main':
main.c:6:14: error: subscripted value is neither array nor pointer nor vector
    6 | scanf("%d",&a[i]);
      |              ^
main.c:7:14: error: subscripted value is neither array nor pointer nor vector
    7 | scanf("%d",&b[i]);
      |              ^
main.c:8:7: error: subscripted value is neither array nor pointer nor vector
    8 | sum+=b[i];
      |       ^
main.c:11:14: error: subscripted value is neither array nor pointer nor vector
   11 | scanf("%d",&c[i]);
      |              ^
main.c:14:5: error: subscripted value is neither array nor pointer nor vector
   14 | if(a[i]+1=a[i+1]){
      |     ^
main.c:14:12: error: subscripted value is neither array nor pointer nor vector
   14 | if(a[i]+1=a[i+1]){
      |            ^
main.c:15:7: error: subscripted value is neither array nor pointer nor vector
   15 | sum+=c[i]}
      |       ^
main.c:15:10: error: expected ';' before '}' token
   15 | sum+=c[i]}
      |          ^
      |          ;
main.c:17:1: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 | print("%d",sum);
      | ^~~~~
      | printf
Language: C++

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
g = 0
pre = -100
for i in range(n):
    if pre+1 == a[i]-1:
        g += c[pre]
    g += b[a[i]-1]
    pre = a[i]-1
print(g)

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>v1,v2,v3;
  int i,j,k,l=0,m,,a,b,c;
  for(i=0;i<n;i++)
  {
    cin>>a;
    v1.push_back(a);
  }
  for(i=0;i<n;i++)
  {
    cin>>b;
    v2.push_back(b);
  }
  for(i=0;i<n-1;i++)
  {
    cin>>c;
    v3.push_back(c);
  }
  for(i=0;i<n;i++)
  {
      l=l+v2[(v1[i]-1)];
  }
  for(i=0;i<n-1;i++)
  {
     if((v1[i+1]-v1[i])==1)
       l=l+v3[(v1[i]-1)];
  }
  cout<<l;
}
      
   

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected unqualified-id before ',' token
    8 |   int i,j,k,l=0,m,,a,b,c;
      |                   ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'a' was not declared in this scope
    5 |         a[50],b[50],c[50];
      |         ^
a.cc:5:15: error: 'b' was not declared in this scope
    5 |         a[50],b[50],c[50];
      |               ^
a.cc:5:21: error: 'c' was not declared in this scope
    5 |         a[50],b[50],c[50];
      |                     ^
a.cc:10:11: error: 'i' was not declared in this scope
   10 |         c[i]=0;
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
  cin>>n;
  vector<int>v1,v2,v3;
  int i,j,k,l=0,m,,a,b,c;
  for(i=0;i<n;i++)
  {
    cin>>a;
    v1.push_back(a);
  }
  for(i=0;i<n;i++)
  {
    cin>>b;
    v2.push_back(b);
  }
  for(i=0;i<n-1;i++)
  {
    cin>>c;
    v3.push_back(c);
  }
  for(i=0;i<n;i++)
  {
      l=l+v2[(v1[i]-1)];
  }
  for(i=0;i<n-1;i++)
  {
     if((v1[i+1]-v1[i])==1)
       l=l+v3[(v1[i]-1)];
  }
  cout<<l;
      
   

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected unqualified-id before ',' token
    8 |   int i,j,k,l=0,m,,a,b,c;
      |                   ^
a.cc:33:11: error: expected '}' at end of input
   33 |   cout<<l;
      |           ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:3:9: error: array size missing in 'a'
    3 | int n,i,a[],b[],c[],sum=0;
      |         ^
main.c:3:13: error: array size missing in 'b'
    3 | int n,i,a[],b[],c[],sum=0;
      |             ^
main.c:3:17: error: array size missing in 'c'
    3 | int n,i,a[],b[],c[],sum=0;
      |                 ^
main.c:8:10: error: expected ';' before '}' token
    8 | sum+=b[i]
      |          ^
      |          ;
    9 | }
      | ~         
main.c:14:10: error: lvalue required as left operand of assignment
   14 | if(a[i]+1=a[i+1]){
      |          ^
main.c:15:10: error: expected ';' before '}' token
   15 | sum+=c[i]}
      |          ^
      |          ;
main.c:17:1: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 | print("%d",sum);
      | ^~~~~
      | printf
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:26:31: error: expected ';' before '}' token
   26 |       score += c.at(a.at(i)-2)
      |                               ^
      |                               ;
   27 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e6+10;
int main()
{
	int n,a[100]={0},b[100]={0},c[100]={0};
	ll sum=0
	scanf("%d",&n);
	for(int i=0;i<n;i++)scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)scanf("%d",&b[i]);
	for(int i=1;i<=n-1;i++)scanf("%d",&c[i]);
	sum+=b[a[0]];
	for(int i=1;i<n;i++)
	{
		sum+=b[a[i]];
		if(a[i-1]<n)sum+=c[a[i-1]];
	}
	printf("%lld\n",sum);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: expected ',' or ';' before 'scanf'
    9 |         scanf("%d",&n);
      |         ^~~~~
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:6:7: error: 'inti' undeclared (first use in this function); did you mean 'int'?
    6 |   for(inti=0;i<n;i++){
      |       ^~~~
      |       int
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:14: error: 'i' undeclared (first use in this function)
    6 |   for(inti=0;i<n;i++){
      |              ^
Language: C

N = gets.to_i
A, B, C = $<.map{|s| s.split.map &:to_i }

ans = 0
(1..N).each{|i|
  ans += B[A[i-1]-1]
  if i != N && A[i-1] + 1 == A[i]
    # p 1
    ans += C[A[i-1]-1]
  end
}
p ans

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N = gets.to_i
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:5: error: 'gets' undeclared here (not in a function)
    1 | N = gets.to_i
      |     ^~~~
main.c:2:1: error: expected ',' or ';' before 'A'
    2 | A, B, C = $<.map{|s| s.split.map &:to_i }
      | ^
main.c:4:1: warning: data definition has no type or storage class
    4 | ans = 0
      | ^~~
main.c:4:1: error: type defaults to 'int' in declaration of 'ans' [-Wimplicit-int]
main.c:5:2: error: too many decimal points in number
    5 | (1..N).each{|i|
      |  ^~~~
main.c:4:7: error: called object is not a function or function pointer
    4 | ans = 0
      |       ^
main.c:5:12: error: expected ',' or ';' before '{' token
    5 | (1..N).each{|i|
      |            ^
main.c:8:7: error: invalid preprocessing directive #p
    8 |     # p 1
      |       ^
main.c:12:1: error: unknown type name 'p'
   12 | p ans
      | ^
main.c:12:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
Language: C++

#include<stdio.h>
int main()
{
    int n,a[20],b[20],c[20],i,s;
    // 整数の入力
    scanf("%d", &n);
  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--;
  for(i=0;i<=n;i++){
  	if((a[i]+1)=a[i+1])s+=c[i];
  }
  for(i=0;i<=n;i++){
  s+=b[i];
  }
    printf("%d",b);
    return 0;
}

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

#include <bits/stdc++.h>
#define int int64_t
#define rep(i, N) for(int i=0; i<N; i++)
using namespace std;
using pair = pair<int, int>;
using tup  = tuple<int, int, int>;
using vec  = vector<int>;
using vvec = vector<vec>;
// " ", ' '
// std::string str;
// str = std::to_string(int i);

// プロトタイプ宣言
// int myfunc(int, vvec);

// グローバル変数
// int N, M;
// vvec data(N, vec(M));

// 関数：

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int N; cin >> N;
	vec A(N), B(N), C(N);
	rep(i, N-1) cin >> A.at(i) >> B.at(i) >> C.at(i);
	cin >> A.at(N) >> B.at(N);

	int ans = 0;
	rep(i, N) {
		if(i == 0) ans += B.at(i);
		else if(i >= 1) {
			if(A.at(i+1) == A.at(i)+1) ans += C.at(A.at(i));
			else ans += B.at(i);
		}
	}

	cout << ans << endl:

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:28: error: expected ';' before ':' token
   40 |         cout << ans << endl:
      |                            ^
      |                            ;
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n,a[20],b[50],c[50];
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]];
}
for(int i=1;i<n-1;i++){
  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:21:10: error: lvalue required as left operand of assignment
   21 |   if(a[i]+1=a[i+1]){
      |      ~~~~^~
Language: C++

#include<stdio.h>
int main()
{
    int n,a[20],b[20],c[20],i,s;
    // 整数の入力
    scanf("%d", &n);
  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--;
  for(i=0;i<=n;i++){
  	if((a[i]+1)=a[i+1])s+=c[i];
  }
  for(i=0;i<=n;i++){
  s+=b[];
  }
    printf("%d",b);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: lvalue required as left operand of assignment
   17 |         if((a[i]+1)=a[i+1])s+=c[i];
      |            ~~~~~^~~
a.cc:20:8: error: expected primary-expression before ']' token
   20 |   s+=b[];
      |        ^
Language: C++

#include <iostream>
using namespace std;

int main(){
 int N;
  cin >> N;
  int A[2][51];
  int C[51];
  for(int i = 0; i < 2; i++){
   	for(int j = 0; j < N; j++){
     	cin >> A[i][j]; 
    }
  }
  for(int i = 0; i < N-1; i+++)cin >> C[i];
  C[N-1] = 0;
  int before = 0;
  int ans = 0;
  for(int i = 0; i < N; i++){
   	 ans +=A[1][A[0][i]];
    ans += before;
    before = C[A[0][i]];
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: expected primary-expression before ')' token
   14 |   for(int i = 0; i < N-1; i+++)cin >> C[i];
      |                               ^
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 j = 0;
  int sum = 0;
  while (j < N) {
    k = A.at(j);
    sum += B.at(k - 1);
    if (k == A.at(j - 1) && j > 0) {
      sum += C.at(k - 1);
    }
    j++;
  }
  cout << sum << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'k' was not declared in this scope
   23 |     k = A.at(j);
      |     ^
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];
  
  for(int i=0;i<n;i++)
    cin>>b[i];
  
  for(int i=0;i<n-1;i++)cin>>c[i];
  
  int s=b[a[0]];
  
  for(int i=1;i<n;i++)
  {
   	if(a[i-1]+1==a[i])
      s+=c[i-1];
    s+=b[a[i]];
  }
  
  cout<<s;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected initializer before 'c'
   10 |   int a[n],b[n]c[n-1];
      |                ^
a.cc:16:10: error: 'b' was not declared in this scope
   16 |     cin>>b[i];
      |          ^
a.cc:18:30: error: 'c' was not declared in this scope
   18 |   for(int i=0;i<n-1;i++)cin>>c[i];
      |                              ^
a.cc:20:9: error: 'b' was not declared in this scope
   20 |   int s=b[a[0]];
      |         ^
a.cc:25:10: error: 'c' was not declared in this scope
   25 |       s+=c[i-1];
      |          ^
Language: C++

// #include <stdio.h>
// #include <string.h>
//#include <iostream>
#include <math.h>
#include <iostream>
#include <utility>
#include <cstdio>
#include <stack>
#include <queue>
#include <algorithm>
#include <map>
#include <string>
#include <set>


using namespace std;
typedef pair<int, int> XY;// Pair型変数の宣言
typedef long long ll;
const ll MOD = (ll)1e9 + 7;
    

int main()
{
  	int Nmax = 20;
    char String[Nmax];
    int N;
    int i,j,k;
    int len;   // 文字列の長さ
    int flag=0;
    int t
    int A[Nmax];
    int B[Nmax];
    int C[Nmax];
    int M,D;
    int count = 0;
    int d1,d10;
    int d,m;
    ll K;
 /*  
    // int型スタック
    stack<int> stack;   
    stack.push(777);
    stack.push(778);
    stack.push(779);
  
	int tmpsl = stack.top();  // LAST要素の参照
 // 	int tpmsf = stack.back(); // FIRST要素の参照
 //	printf("%d %d \n",tmpsl,tmpsf);
    stack.pop();// LAST要素の削除（取出しではない）
 // 	if( stack.empty() == true) printf("empty stack\n");
     
    // int型キュー
    queue<int> que;
  	que.push(999);
  	que.push(998);   
  	que.push(997);    
  	int tmpqs = que.front(); // FIRST要素の参照
  	int tmpqe = que.back();  // LAST要素の参照
 //	printf("%d %d \n",tmpqs,tmpqe);
  	que.pop();  // FIRST要素の削除（取出しではない）
  //	if( que.empty() == true) printf("empty que\n");
    
    // ２次元座標を扱うキュー
    queue<XY> xyque; // ２次元座標型変数のキュー
  	XY p; 
  	xyque.pop();	// FIRST要素の削除。キューが空のときは削除が予約されて次のPOPが即削除される
  	xyque.push( XY(5,5) );
    xyque.push( XY(5,5) );
   	p = xyque.front();  // FIRST要素からのコピー
 // 	printf("%d %d\n", p.first, p.second);
  	
    
  que.back();
  //  sort(&(que.front()), &(que.back()));
        
   
*/
    
    // 入力読込
    // 文字列
 //   scanf("%s", String);   
    
    // 数列

    scanf("%d ", &N);
 //   scanf("%lld", &K);
   for(i=1;i<=N;i++){
        scanf("%d %d %d",&A[i],&B[i],&C[i]);
    }
    
    int man=0;
    for(i=1;i<=N;i++){
        man = man + B[A[i]];
        if( (i<= (N-1))  && (A[i+1] == A[i] +1)){
            man = man + C[i];
        }
            
    }
    
    // 文字列の長さをチェック
    // 文字列は配列の0からlen-1に格納されてる
//    len = strlen( String );
//  	printf("%d\n",len);
    
/*
    
    for(m=1;m<=M;m++){
        for(d=1;d<=D;d++){
            d1 = d%10;
            d10 = d/10;
            if((m == d1*d10) && (d1>=2) && (d10 >=2))  count++;
        }
    }
 */   
    
    // 結果出力

//  	cout << count  << endl;
/*    
    if(flag == -1)
        printf("NO \n");
    else
        printf("YES \n");
  */      
  
  return 0;
   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: expected initializer before 'int'
   31 |     int A[Nmax];
      |     ^~~
a.cc:88:27: error: 'A' was not declared in this scope
   88 |         scanf("%d %d %d",&A[i],&B[i],&C[i]);
      |                           ^
a.cc:93:23: error: 'A' was not declared in this scope
   93 |         man = man + B[A[i]];
      |                       ^
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];
  
  for(int i=0;i<n;i++)
    cin>>b[i];
  
  for(int i=0;i<n-1;i++)cin>>c[i];
  
  int s+=b[a[0]];
  
  for(int i=1;i<n;i++)
  {
   	if(a[i-1]+1==a[i])
      s+=c[i-1];
    s+=b[a[i]];
  }
  
  cout<<s;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: expected initializer before '+=' token
   20 |   int s+=b[a[0]];
      |        ^~
a.cc:25:7: error: 's' was not declared in this scope
   25 |       s+=c[i-1];
      |       ^
a.cc:26:5: error: 's' was not declared in this scope
   26 |     s+=b[a[i]];
      |     ^
a.cc:29:9: error: 's' was not declared in this scope
   29 |   cout<<s;
      |         ^
Language: C++

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

using ll=long long;
using int64=int64_t;
const int inf=100000000;

int in(){
  int a;
  cin >> a;
  return a;
}//int型関数の受け取り

void forin(int* x,int y){
  for (int i=0;i<y;i++){
    cin >> x[i];
  }
}//(x,y) int型配列x[y]の受け取り

int intpow(int x,int y){
  double a=x,b=y;
  return pow(a,b);
}//(x,y) xをy乗

int intfabs(int x){
  double a=x;
  return fabs(a);
}//(x) xの絶対値

int fact(int x){
  if (x == 1) return 1;
  return x*fact(x-1);
}//(x) x!

int fib(int x){
  if (x <= 2) return x;
  int a[x];
  a[0]=1;
  a[1]=2;
  for (int i=2;i<x;i++){
    a[i]=a[i-1]+a[i-2];
  }
  return a[x-1];
}//(x) フィボナッチ数列のx番目

int div1(ll x){
  return x%1000000007;
}

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

Compiler output:
a.cc:50:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   50 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:59:19: error: lvalue required as left operand of assignment
   59 |         if (a[i-1]+1=a[i]) ans+=c[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];
  
  for(int i=0;i<n;i++)
    cin>>b[i];
  
  for(int i=0;i<n-1;i++)cin>>c[i];
  
  int s+=b[a[0]];
  
  for(int i=1;i<n;i++)
  {
   	if(a[i-1]+1==a[i])
      s+=c[i-1];
    s+=b[a[i]];
  }
  
  cout<<s;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected initializer before 'c'
   10 |   int a[n],b[n]c[n-1];
      |                ^
a.cc:16:10: error: 'b' was not declared in this scope
   16 |     cin>>b[i];
      |          ^
a.cc:18:30: error: 'c' was not declared in this scope
   18 |   for(int i=0;i<n-1;i++)cin>>c[i];
      |                              ^
a.cc:20:8: error: expected initializer before '+=' token
   20 |   int s+=b[a[0]];
      |        ^~
a.cc:25:7: error: 's' was not declared in this scope
   25 |       s+=c[i-1];
      |       ^
a.cc:25:10: error: 'c' was not declared in this scope
   25 |       s+=c[i-1];
      |          ^
a.cc:26:5: error: 's' was not declared in this scope
   26 |     s+=b[a[i]];
      |     ^
a.cc:26:8: error: 'b' was not declared in this scope
   26 |     s+=b[a[i]];
      |        ^
a.cc:29:9: error: 's' was not declared in this scope
   29 |   cout<<s;
      |         ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
    // 整数の入力
    int N;
    cin >> N;
    // スペース区切りの整数の入力
    int a[N];
    for(int i=0;i<N;++i){
        cin >> a[i];
    }
    int b[N];
    for(int i=0;i<N;++i){
        cin >> b[i];
    }
    int c[N];
    for(int i=0;i<N-1;++i){
        cin >> c[i];
    }
    
    int point=0;
    for(int i=0;i<N;++i){
        if(i>1 && a[i]-1==a[i-1]){
            point += c[i];
        }
        point += b[i]
    }
    cout << point <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: expected ';' before '}' token
   27 |         point += b[i]
      |                      ^
      |                      ;
   28 |     }
      |     ~
Language: C++

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

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

  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected initializer before 'for'
   10 |   for(int i=0; i<N; i++){
      |   ^~~
a.cc:10:16: error: 'i' was not declared in this scope
   10 |   for(int i=0; i<N; i++){
      |                ^
a.cc:13:3: error: 'an' was not declared in this scope; did you mean 'yn'?
   13 |   an = A[N];
      |   ^~
      |   yn
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;
  vector<int> A, B, C;
  int ANS;
  int an
  
  rep(i,N){
    cin >> A[i];
  }
  an = A[N];
  
  rep(i,N){
    cin >> B[i];
    ANS += B[i];
  }
  
  rep(i,N-1){
    cin >> C[i];
    ANS += C[i];
  }
  ANS -= C[an];
  
  cout << ANS << endl;
}

  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:3:18: error: expected initializer before 'for'
    3 | #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:11:7: error: 'i' was not declared in this scope
   11 |   rep(i,N){
      |       ^
a.cc:3:32: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i = 0;i<n;i++)
      |                                ^
a.cc:14:3: error: 'an' was not declared in this scope; did you mean 'yn'?
   14 |   an = A[N];
      |   ^~
      |   yn
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:32: error: expected ';' before '}' token
   12 | if(a[i]-1==a[i-1]){s+=c[a[i+1]]}
      |                                ^
      |                                ;
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#define N 100010 
using namespace std;
int a[N], b[N], c[N];
int main()
{
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= n; i ++ )
		scanf("%d", &a[i]);
	for (int i = 1; i <= n; i ++ ) 
		scanf("%d", &b[i]);
	for (int i = 1; i < n; i ++ ) 
		scanf("%d", &c[i]);
	int ans = 0;
	for (int i = 1; i <= n; i ++ ) 
		ans += b[a[i]];
	for (int i = 2; i <= n; i ++ ) {
		if (a[i] == a[i - 1] + 1) {
			ans += c[a[i] - 1];
		}
	}
	cout << ans << endl ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'cout' was not declared in this scope
   25 |         cout << ans << endl ;
      |         ^~~~
a.cc:4:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <algorithm>
  +++ |+#include <iostream>
    4 | #define N 100010
a.cc:25:24: error: 'endl' was not declared in this scope
   25 |         cout << ans << endl ;
      |                        ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <algorithm>
  +++ |+#include <ostream>
    4 | #define N 100010
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
  cin>>n;
  int arr[n];
  int brr[n];
  int crr[n-1];
  for ( int i=0;i<n;i++)
    cin>>arr[i];
  int total=0;
  
  for ( int i=0;i<n;i++)
  {
    int aa;
    cin>>aa;
    total+=aa;
  }
  for ( int i=0;i<n;i++)
  {
    cin>>crr[i];
  }
  for ( int i=1;i<n;i++)
  {
    if ( arr[i]==arr[i-1]+1)
      total+=crr[arr[i-1]];
}
  cout<<total<<'\n';

Compiler output:
a.cc: In function 'int main()':
a.cc:29:21: error: expected '}' at end of input
   29 |   cout<<total<<'\n';
      |                     ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include<stdio.h>

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

    printf("%d",d);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     for(i=0;i<n;i++){
      |         ^
a.cc:10:9: error: 'i' was not declared in this scope
   10 |     for(i=0;i<n;i++){
      |         ^
a.cc:14:9: error: 'i' was not declared in this scope
   14 |     for(i=0;i<n-1;i++){
      |         ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: expected ')' before ']' token
   13 |         if(i>=2&&a[i-1]]+1==a[i]) ans+=c[a[i]];
      |           ~            ^
      |                        )
a.cc:13:24: error: expected primary-expression before ']' token
Language: Java

import java.util.*;
import java.io.*;
public class B {

	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()-1;
		}
		for(int i = 0; i < n; i++) {
			B[i] = sc.nextInt();
		}
		for(int i = 0; i < n-1; i++) {
			C[i] = sc.nextInt();
		}
		int res = 0;
		for(int i = 0; i < n; i++) {
			res += B[A[i]];
			if(i > 0 && A[i] == A[i-1]+1) {
				res += C[A[i-1]];
			}
		}
		System.out.println(res);
	}

}


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

#include <iostream>
 
using namespace std;
long long n,s,i,x,b[1000000];
int main()
{
    cin >> n;
    for (i=1; i<n; i++)
    {
        cin >> bi];
        s+=b[i];
    }   
        if (b[1]>=b[2])
        cout<<s+b[n-1];
        else
        cout<<s+b[1];
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 'bi' was not declared in this scope; did you mean 'i'?
   10 |         cin >> bi];
      |                ^~
      |                i
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   14 |       ans+=a;
      |       ~~~^~~
      |          |
      |          int*
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   14 |       ans+=a;
      |       ~~~^~~
      |          |
      |          int*
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
  ll a;
  cin>>a;
  vector<ll>vec(a);
  vector<ll>veco(a);
  vector<ll>vec2(a);
  for(ll i=0;i<a;i++){
    cin>>vec.at(i);
  }
  vec2=vec;
  sort(vec.begin(),vec,end());
  for(ll i=0;i<a;i++){
    veco.at(i)=min(vec.at(i),vec2.at(i));
  }
  ll c=veco.at(0);
  for(ll i=0;i<a;i++){
    c+=vec.at(i);
  }
  cout<<c<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: no matching function for call to 'end()'
   14 |   sort(vec.begin(),vec,end());
      |                        ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided