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

#include<stdio.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: expected ';' before ')' token
   22 |   for(i=0,i<n;i++)
      |                  ^
      |                  ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: no match for call to '(std::vector<int>) (int&)'
   23 |       k=k+B.at(A(i));
      |                ~^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: no match for call to '(std::vector<int>) (int&)'
   11 |       cin >> A(i) >> B(i) >> C(i);
      |              ~^~~
a.cc:11:23: error: no match for call to '(std::vector<int>) (int&)'
   11 |       cin >> A(i) >> B(i) >> C(i);
      |                      ~^~~
a.cc:11:31: error: no match for call to '(std::vector<int>) (int&)'
   11 |       cin >> A(i) >> B(i) >> C(i);
      |                              ~^~~
a.cc:14:15: error: no match for call to '(std::vector<int>) (int&)'
   14 |       cin >> A(i) >> B(i);
      |              ~^~~
a.cc:14:23: error: no match for call to '(std::vector<int>) (int&)'
   14 |       cin >> A(i) >> B(i);
      |                      ~^~~
a.cc:20:12: error: no match for call to '(std::vector<int>) (int)'
   20 |       k=k+B(0);
      |           ~^~~
a.cc:22:14: error: no match for call to '(std::vector<int>) (int)'
   22 |     else if(A(i-1)!=A(i)){
      |             ~^~~~~
a.cc:22:22: error: no match for call to '(std::vector<int>) (int&)'
   22 |     else if(A(i-1)!=A(i)){
      |                     ~^~~
a.cc:23:14: error: no match for call to '(std::vector<int>) (int&)'
   23 |       k=k+B(A(i));
      |             ~^~~
a.cc:26:12: error: no match for call to '(std::vector<int>) (int)'
   26 |       k=k+C(i-1);
      |           ~^~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define MAXN 21

int main()
{
 int n, prev_dish, score = 0;
 scanf("%d", &n);
 int a[MAXN], b[MAXN], c[MAXN];
  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]);
  score+=b[a[1]];
  prev_dish = a[1];
  for(int i = 2; i<=n; i++)
  {
    score+=b[a[i]];
    if(prev_dish == i - 1)
      score+=c[i - 1];
  }
  printf("%d", score);
}

Compiler output:
main.c: In function 'main':
main.c:13:24: error: 'i' undeclared (first use in this function)
   13 |         scanf("%d", &b[i]);
      |                        ^
main.c:13:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:20: error: expected expression before '<' token
   14 |   for(int i = 1; i=<n-1;i++);
      |                    ^
Language: C++

#include<iostream>

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


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

#include<iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: 'i' was not declared in this scope
   17 |   for(i=0;i<n;i++){
      |       ^
a.cc:25:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |   cout<<ans;
      |   ^~~~
      |   std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include<iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: 'i' was not declared in this scope
   17 |   for(i=0;i<n;i++){
      |       ^
a.cc:25:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |   cout<<ans;
      |   ^~~~
      |   std::cout
In file included from a.cc:1:
/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.*;
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];

   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 result = B[0];

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

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



Compiler output:
Main.java:30: error: <identifier> expected
System.out.println(result);
                  ^
Main.java:30: error: <identifier> expected
System.out.println(result);
                         ^
2 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'sum' was not declared in this scope
   18 |       sum+=b[a[i]];
      |       ^~~
a.cc:23:12: error: 'sum' was not declared in this scope
   23 |            sum+=b[a[i]]+c[a[i-1]];
      |            ^~~
a.cc:26:9: error: 'sum' was not declared in this scope
   26 |         sum+=b[a[i]];
      |         ^~~
a.cc:29:9: error: 'sum' was not declared in this scope
   29 |   cout<<sum;
      |         ^~~
Language: C++

N = int(input())
grid = []
A = list(map(int, input().strip().split()))
Ai = [n-1 for n in A]
B = list(map(int, input().strip().split()))
C = list(map(int, input().strip().split()))
ans = 0
for i in range(N):
  ans += B[Ai[i]]
  if((i > 0) and (Ai[i] == Ai[i-1]+1)):
  	ans += C[Ai[i-1]]
print(ans)

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

#include <iostream>

using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> a(n), b(n), c(n - 1);
  for(int i = 0; i < n; i++)
    cin >> a[i];
  for(int i = 0; i < n; i++)
    cin >> b[i];
  for(int i = 0; i < n - 1; i++)
    cin >> c[i];
  
  int satisfact = b[a[0]];
  for(int i = 1; i < a.size(); i++){
  	satisfact += b[a[i]];
    if(a[i - 1] + 1 == a[i])
      satisfact += c[i - 1];
  }
  
  cout << satisfact << '\n';
  return 0;
}

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), 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:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> a(n), b(n), c(n - 1);
      |          ^~~
a.cc:10:12: error: 'a' was not declared in this scope
   10 |     cin >> a[i];
      |            ^
a.cc:12:12: error: 'b' was not declared in this scope
   12 |     cin >> b[i];
      |            ^
a.cc:14:12: error: 'c' was not declared in this scope
   14 |     cin >> c[i];
      |            ^
a.cc:16:19: error: 'b' was not declared in this scope
   16 |   int satisfact = b[a[0]];
      |                   ^
a.cc:16:21: error: 'a' was not declared in this scope
   16 |   int satisfact = b[a[0]];
      |                     ^
a.cc:20:20: error: 'c' was not declared in this scope
   20 |       satisfact += c[i - 1];
      |                    ^
Language: C++

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

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


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

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

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

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

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

int main()
{
  int n;
  cin >> n;
  int a[n+1], b[n+1], 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; i++)
    	cin >> c[i];
  int sum ;
  	sum += b[a[0]];

    for(int i = 2; i<=n; i++)
    {
     	sum += b[a[i]];
	      if(a[i-1]+1 == a[i])
            	sum+=sum[(int)(a[i]-1)];
    }
  cout << sum << endl;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: invalid types 'int[int]' for array subscript
   23 |                 sum+=sum[(int)(a[i]-1)];
      |                         ^
Language: C++

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

int main()
{
  int n;
  cin >> n;
  int a[n+1], b[n+1], 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; i++)
    	cin >> c[i];
  int sum ;
  	sum += b[a[0]];

    for(int i = 2; i<=n; i++)
    {
     	sum += b[a[i]];
	      if(a[i-1]+1 == a[i])
            	sum+=sum[a[i]-1];
    }
  cout << sum << endl;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:25: error: invalid types 'int[int]' for array subscript
   23 |                 sum+=sum[a[i]-1];
      |                         ^
Language: C++

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

int main()
{
  int n;
  cin >> n;
  int a[n+1], b[n+1], 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; i++)
    	cin >> c[i];
  int sum ;
  	sum += b[a[i]];

    for(int i = 2; i<=n; i++)
    {
     	sum += b[a[i]];
	      if(a[i-1]+1 == a[i])
            	sum+=sum[a[i]-1];
    }
  cout << sum << endl;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: 'i' was not declared in this scope
   17 |         sum += b[a[i]];
      |                    ^
a.cc:23:25: error: invalid types 'int[int]' for array subscript
   23 |                 sum+=sum[a[i]-1];
      |                         ^
Language: C++

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

int main()
{
  int n;
  cin >> n;
  int a[n+1], b[n+1], 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; i++)
    	cin >> c[i];
  int sum += b[a[i]];

    for(int i = 2; i<=n; i++)
    {
     	sum += b[a[i]];
	      if(a[i-1]+1 == a[i])
            	sum+=sum[a[i]-1];
    }
  cout << sum << endl;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: expected initializer before '+=' token
   16 |   int sum += b[a[i]];
      |           ^~
a.cc:20:9: error: 'sum' was not declared in this scope
   20 |         sum += b[a[i]];
      |         ^~~
a.cc:24:11: error: 'sum' was not declared in this scope
   24 |   cout << sum << endl;
      |           ^~~
Language: C++

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

int main() {
  int n;
  vector<int> vec1(n);
  vector<int> vec2(n);
  vector<int> vec3(n);
  int total =0;
  for(int i=0; i <n;i++){
    cin >>vec1.at(i);
  }
    for(int i=0; i <n;i++){
    cin >>vec2.at(i);
  }
    for(int i=0; i <n;i++){
    cin >>vec3.at(i);
  }
  for(int i=0; i<n; i++){
    total=total +vec2.at(i);
  }
  for(int i=0; i<n;i++){
   if(vec1.at(i) +1==vec1.(i+1)){
     total= total+vec3.at(vec1.at(i));
   }
  }
  cout << total <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: expected unqualified-id before '(' token
   23 |    if(vec1.at(i) +1==vec1.(i+1)){
      |                           ^
Language: C++

#include <iostream>

int main()
{
    int N; // input
    std::cin >> N;
    int A[N+1]; // food
    int B[N+1]; // satisfaction
    int C[N]; // bonus
    for (int i {1}; i <= N; i++)
        std::cin >> A[i];
    for (int i {1}; i <= N; i++)
        std::cin >> B[i];
    for (int i {1}; i < N; i++)
        std::cin >> C[i];
    int ans {};
    for (int i {1}; i <= N; i++)
    {
        ans += B[A[i]];
        if (i > 1 && A[i] = A[i-1] + 1)
            ans += C[A[i-1]];
    }
    std::cout << ans;
}

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

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int main(void){
  char str1[5],str2[100],str3[100],str4[100];
  int N,a[20],b[20],c[20],i,sum;
  
  fgets(str1,sizeof(str1),stdin);
  fgets(str2,sizeof(str2),stdin);
  fgets(str3,sizeof(str3),stdin);
  fgets(str4,sizeof(str4),stdin);
  
  N=atoi(str1);
  a[0]=atoi(strtok(str2," "));
  for(i=1;i<N;i++){
    a[i]=atoi(strtok(NULL," "));
  }
  b[0]=atoi(strtok(str3," "));
  for(i=1;i<N;i++){
    b[i]=atoi(strtok(NULL," "));
  }
  c[0]=atoi(strtok(str4," "));
  for(i=;i<N-1;i++){
    c[i]=atoi(strtok(NULL," "));
  }
  
  sum=b[a[0]];
  for(i=1;i<N;i++){
    sum+=b[a[i]];
    if(a[i]==a[i-1]+1){
      sum+=c[a[i-1]];
    }
  }
  
  printf("%d\n",sum);
  return 0;
}
  
    

Compiler output:
main.c: In function 'main':
main.c:24:9: error: expected expression before ';' token
   24 |   for(i=;i<N-1;i++){
      |         ^
Language: C++

#include<stdio.h>
#include<stdlib.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

int main(void){
    int N;
    scanf("%d",&N);

    int* A;
    NEW(A,N);
    for(int i=0;i<N;i++){
        scanf("%d", &A[i]);
    }

    int* B;
    NEW(B,N);
    for(int i=0;i<N;i++){
        scanf("%d\n", &B[i]);
    }

    int* C;
    NEW(C,N);
    for(int i=0;i<N-1;i++){
        scanf("%d", &C[i]);
    }

    //料理を食べた時の総満足度
    int sum=0;
    for(int i=0;i<N;i++){
        sum+=B[i];
    }

    //得られるボーナス満足度
    int bonus=0;
    for(int i=0;i<N-1;i++){
        if(A[i+1]==A[i]+1){
            bonus+=C[A[i]-1];
        }
    }

    int ans=sum+bonus;

    printf("%d\n",ans);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:26: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    4 | #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~
      |                          |
      |                          void*
a.cc:12:5: note: in expansion of macro 'NEW'
   12 |     NEW(A,N);
      |     ^~~
a.cc:4:26: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    4 | #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~
      |                          |
      |                          void*
a.cc:18:5: note: in expansion of macro 'NEW'
   18 |     NEW(B,N);
      |     ^~~
a.cc:4:26: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    4 | #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~
      |                          |
      |                          void*
a.cc:24:5: note: in expansion of macro 'NEW'
   24 |     NEW(C,N);
      |     ^~~
Language: C++

#include<stdio.h>
#include<stdlib.h>

#define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
//pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ

int main(void){
    int N;
    scanf("%d",&N);

    int* A;
    NEW(A,N);
    for(int i=0;i<N;i++){
        scanf("%d", &A[i]);
    }

    int* B;
    NEW(B,N);
    for(int i=0;i<N;i++){
        scanf("%d", &B[i]);
    }

    int* C;
    NEW(C,N);
    for(int i=0;i<N-1;i++){
        scanf("%d", &C[i]);
    }

    //料理を食べた時の総満足度
    int sum=0;
    for(int i=0;i<N;i++){
        sum+=B[i];
    }

    //得られるボーナス満足度
    int bonus=0;
    for(int i=0;i<N-1;i++){
        if(A[i+1]==A[i]+1){
            bonus+=C[A[i]];
        }
    }

    int ans=sum+bonus;

    printf("%d",ans);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:26: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    4 | #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~
      |                          |
      |                          void*
a.cc:12:5: note: in expansion of macro 'NEW'
   12 |     NEW(A,N);
      |     ^~~
a.cc:4:26: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    4 | #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~
      |                          |
      |                          void*
a.cc:18:5: note: in expansion of macro 'NEW'
   18 |     NEW(B,N);
      |     ^~~
a.cc:4:26: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    4 | #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};}
      |                    ~~~~~~^~~~~~~~~~~~~~~~~~
      |                          |
      |                          void*
a.cc:24:5: note: in expansion of macro 'NEW'
   24 |     NEW(C,N);
      |     ^~~
Language: C

#include <stdio.h>

#define MAX 100

int main()
{
  int i;
  int N;
  int A[MAX],  B[MAX], C[MAX];
  int man;
  //A[i]:ryouri[i], B[i]:manzokudo, C[i]: add_manzokudo

    scanf("%d", &N);

    scanf("%d", &A[i]);
    if(A[i] < 1 || A[i] > N){
      printf("incorrect\n");
      --i;
    }
    if(A[i] == '\n')
      break;
  }
  for(i = 1; i <= N; i++){
    scanf("%d", &B[i]);
    if(B[i] < 1 || B[i] > 50){
      printf("incorrect\n");
      --i;
    }
    if(B[i] == '\n')
      break;
  } 
  for(i = 1; i <= N-1; i++){
    scanf("%d", &C[i]);
    if(C[i] < 1 || C[i] > 50){
      printf("incorrect\n");
      --i;
    }
    if(C[i] == '\n')
      break;
  }

  for(i = 0; i < N; i++){
    man += B[A[i]];
    if((A[i]) == A[i-1]+1)
      man += C[A[i-1]];
  }
    printf("%d\n", man);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:21:7: error: break statement not within loop or switch
   21 |       break;
      |       ^~~~~
main.c: At top level:
main.c:23:3: error: expected identifier or '(' before 'for'
   23 |   for(i = 1; i <= N; i++){
      |   ^~~
main.c:23:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   23 |   for(i = 1; i <= N; i++){
      |                ^~
main.c:23:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   23 |   for(i = 1; i <= N; i++){
      |                       ^~
main.c:32:3: error: expected identifier or '(' before 'for'
   32 |   for(i = 1; i <= N-1; i++){
      |   ^~~
main.c:32:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   32 |   for(i = 1; i <= N-1; i++){
      |                ^~
main.c:32:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   32 |   for(i = 1; i <= N-1; i++){
      |                         ^~
main.c:42:3: error: expected identifier or '(' before 'for'
   42 |   for(i = 0; i < N; i++){
      |   ^~~
main.c:42:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   42 |   for(i = 0; i < N; i++){
      |                ^
main.c:42:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   42 |   for(i = 0; i < N; i++){
      |                      ^~
main.c:47:12: error: expected declaration specifiers or '...' before string constant
   47 |     printf("%d\n", man);
      |            ^~~~~~
main.c:47:20: error: unknown type name 'man'
   47 |     printf("%d\n", man);
      |                    ^~~
main.c:48:3: error: expected identifier or '(' before 'return'
   48 |   return 0;
      |   ^~~~~~
main.c:49:1: error: expected identifier or '(' before '}' token
   49 | }
      | ^
Language: C++

#include <stdio.h>
int main(){
  int num=0;
  scanf("%d",&num);
  int yoshio[num];
  int kao[num];
  int kaochan[num-1];
  scanf("%d",yoshio);
  scanf("%d",kao);
  scanf("%d",kaochan);
  int i=0,ans=0;
  for(i=0;i<num;i++){
    ans+=kao[yoshio[i]];
    if(yoshio[i]+1==yoshio[i+1]){
      ans+=kaochan[yoshio[i]]
    }
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:30: error: expected ';' before '}' token
   15 |       ans+=kaochan[yoshio[i]]
      |                              ^
      |                              ;
   16 |     }
      |     ~
Language: C++

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

int main(){
 long long N,c,d,p,ans,k;
cin>>N;
  ans=0;
vector<long long>a(N),b(N),c(N);
  for(int i=0;i<N;i++){
    cin>>a[i];
  }
    for(int i=0;i<N;i++){
    cin>>b[i];
      ans+=b[i];
  }
    for(int i=0;i<N;i++){
    cin>>c[i];
  }
  for(int i=0;i<N-1;i++){
if(a[i]+1==a[i+1]){
  ans+=c[a[i]-1];
  }
  }
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:28: error: conflicting declaration 'std::vector<long long int> c'
    8 | vector<long long>a(N),b(N),c(N);
      |                            ^
a.cc:5:14: note: previous declaration as 'long long int c'
    5 |  long long N,c,d,p,ans,k;
      |              ^
a.cc:17:11: error: invalid types 'long long int[int]' for array subscript
   17 |     cin>>c[i];
      |           ^
a.cc:21:9: error: invalid types 'long long int[__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}]' for array subscript
   21 |   ans+=c[a[i]-1];
      |         ^
Language: C++

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
      int N;
      cin>>N;
      vector<int>arrA(N);
      for(int i = 0; i < N; i++){
      	cin>>arr[i];
      }
      int ans = 0;
      for(int i = 0; i < N; i++){
      	int temp;
        cin>>temp;
        ans+=temp;
      }
      vector<int>Barr(N);
      for(int i =0; i < N-1; i++){
      	cin>>Barr[i];
      }
      for(int i = 0; i < N-1; i++){
      	if(arr[i] == arr[i+1]-1){
        	ans+=(Barr[arr[i]]);
        }
        
      }
      cout<<ans<<"\n";
      return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'arr' was not declared in this scope; did you mean 'arrA'?
    8 |         cin>>arr[i];
      |              ^~~
      |              arrA
a.cc:21:12: error: 'arr' was not declared in this scope; did you mean 'Barr'?
   21 |         if(arr[i] == arr[i+1]-1){
      |            ^~~
      |            Barr
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int>arrA(N);
  for(int i = 0; i < N; i++){
  	cin>>arr[i];
  }
  int ans = 0;
  for(int i = 0; i < N; i++){
  	int temp;
    cin>>temp;
    ans+=temp
  }
  vector<int>Barr(N);
  for(int i =0; i < N-1; i++){
  	cin>>Barr[i];
  }
  for(int i = 0; i < N-1; i++){
  	if(arr[i] == arr[i+1]-1){
    	ans+=(Barr[arr[i]]);
    }
    
  }
  cout<<ans<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: 'arr' was not declared in this scope; did you mean 'arrA'?
    8 |         cin>>arr[i];
      |              ^~~
      |              arrA
a.cc:14:14: error: expected ';' before '}' token
   14 |     ans+=temp
      |              ^
      |              ;
   15 |   }
      |   ~           
a.cc:21:12: error: 'arr' was not declared in this scope; did you mean 'Barr'?
   21 |         if(arr[i] == arr[i+1]-1){
      |            ^~~
      |            Barr
Language: C++

#include<bits/stdc++.h>

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   for(int i=0;i<n;++i) cin>>a[i];
      |                        ^~~
      |                        std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:24: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   for(int i=0;i<n;++i) cin>>b[i];
      |                        ^~~
      |                        std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:24: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   for(int i=0;i<n;++i) cin>>c[i];
      |                        ^~~
      |                        std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |   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:14:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |   cout<<ans<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:22:35: error: expected '}' at end of input
   22 |         cout << res + add << endl;
      |                                   ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:55: error: expected ']' before ';' token
   19 |                 if (A[i] + 1 == A[i + 1])add += C[A[i];
      |                                                       ^
      |                                                       ]
a.cc:22:35: error: expected '}' at end of input
   22 |         cout << res + add << endl;
      |                                   ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: C++

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

int main() {
  int n,count;
  cin >> n;
  count=0;
  vector <int> a(n+1);
   vector <int> b(n+1);
   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);
  
  for (int i=0;i<n;){
  count+=b.at(a.at(i));
    if(a.at(i)+1=a.at(i+1)){
    count+=c.at(i);
    }
  }
}

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

using namespace std;

int main(){
  int N;
  int a[100];
  int b[110];
  int c[110];
  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 total = 0;
  for(int i = 0; i < N; ++i){
    total += b[a[i]];
    if(a[i] != N-1 || i != N-1){
      total += c[a[i]];
    }
  }
  cout << total << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout << total << endl;
      |   ^~~~
a.cc:20:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:20: error: 'endl' was not declared in this scope
   20 |   cout << total << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

using namespace std;

int main(){
  int N;
  int a[100];
  int b[110];
  int c[110];
  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 total = 0;
  for(int i = 0; i < N; ++i){
    total += b[a[i]];
    if(a[i] != N || i != N-1){
      total += c[a[i]];
    }
  }
  cout << total << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> N;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout << total << endl;
      |   ^~~~
a.cc:20:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:20: error: 'endl' was not declared in this scope
   20 |   cout << total << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
#define sort(v) sort(v.begin(), v.end())
#define rev(r) reverse(r.begin(), r.end())
#define cout(cc) cout << cc << endl
#define shousu(ss)   cout << fixed << setprecision(ss)

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


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: expected initializer before '==' token
   20 |   int ans==0;
      |          ^~
a.cc:24:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |     ans+=b[a[i]];
      |     ^~~
      |     abs
a.cc:31:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |       ans+=c[a[i]];
      |       ^~~
      |       abs
a.cc:35:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: expected initializer before '==' token
   20 |   int ans==0;
      |          ^~
a.cc:24:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |     ans+=b[a[i]];
      |     ^~~
      |     abs
a.cc:31:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |       ans+=c[a[i]];
      |       ^~~
      |       abs
a.cc:35:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |     cout<<ans<<endl;
      |           ^~~
      |           abs
a.cc:40:10: error: expected initializer before '==' token
   40 |   int ans==0;
      |          ^~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:27:3: error: expected primary-expression before ']' token
   27 |   ]
      |   ^
a.cc:27:4: error: expected '}' at end of input
   27 |   ]
      |    ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: expected ']' before ';' token
   16 |  int sum=b[a[0];
      |                ^
      |                ]
a.cc:27:3: error: expected primary-expression before ']' token
   27 |   ]
      |   ^
a.cc:27:4: error: expected '}' at end of input
   27 |   ]
      |    ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include<iostream>
using namespace std;

int n;
int A[50], C[49];
int sum = 0;
map<int, int> mp;

void solve() {
	for (int i = 0; i < n; ++i) {
		if (i != n-1 && A[i] + 1 == A[i + 1]) {
			sum += C[A[i] - 1];
		}
	}

}
int main() {
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> A[i];
	}

	for (int i = 0, B; i < n; ++i) {
		cin >> B;
		sum += B;
	}

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

	solve();

	cout << sum << '\n';
	return 0;

}

Compiler output:
a.cc:7:1: error: 'map' does not name a type
    7 | map<int, int> mp;
      | ^~~
Language: C++

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

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 total=0,N,order[20],attd_pts[20];
int main(){
  cin >> N;
  for (int i=0;i<N;i++){
    cin >> order[i];
  }
  for (int i=0;i<N;i++){
    int temp;
    cin >> temp;
    total += temp;
  }
  for (int i=0;i<N-1;i++){
    cin >> addt_pts[i];
  }
  
  //add points
  for (int i=0;i<N-1;i++){
    if (order[i+1] - order[i]==1){
      total += addt_pts[order[i]-1]
    }
  }
  cout << total;


  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: 'addt_pts' was not declared in this scope; did you mean 'attd_pts'?
   16 |     cin >> addt_pts[i];
      |            ^~~~~~~~
      |            attd_pts
a.cc:22:16: error: 'addt_pts' was not declared in this scope; did you mean 'attd_pts'?
   22 |       total += addt_pts[order[i]-1]
      |                ^~~~~~~~
      |                attd_pts
Language: C++

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


int main() {
	int n; cin >> n;
	cout << n * n * n << endl;

	return 0;
}

int main() {
	int n; cin >> n;
	int a[20]; for (int i = 0; i < n; i++) { cin >> a[i]; }
	int b = 0; for (int i = 0; i < n; i++) { int bb; cin >> bb; b += bb; }
	int c[20]; for (int i = 0; i < n; i++) { cin >> a[i]; }

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

	cout << ans << endl;

	return 0;
}



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

#include<iostream>
#include<vector>
using namespace std;
int main(){
    int N, satisfaction = 0;
    int tmp = 23;
    cin >> N;

    vector<int> A(n);
    vector<int> B(n);
    vector<int> C(n);

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

    for(int NumOfFood : A){
        satisfaction += B[NumOfFood];
        if(NumOfFood - tmp == 1){
            satisfaction += C[tmp];
        }
        tmp = NumOfFood;
    }

    cout << satisfaction << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: 'n' was not declared in this scope
    9 |     vector<int> A(n);
      |                   ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
    int N, satisfaction = 0;
    int tmp = 23;
    cin >> n;

    vector<int> A(n);
    vector<int> B(n);
    vector<int> C(n);

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

    for(int NumOfFood : A){
        satisfaction += B[NumOfFood];
        if(NumOfFood - tmp == 1){
            satisfaction += C[tmp];
        }
        tmp = NumOfFood;
    }

    cout << satisfaction << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'n' was not declared in this scope
    7 |     cin >> n;
      |            ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int n, satisfaction = 0;
int tmp = 23;
int main(){
    cin >> n;

    vector<int> A(n);
    vector<int> B(n);
    vector<int> C(n);

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

    for(int NumOfFood : A){
        satisfaction += B[NumOfFood];
        if(NumOfFood - tmp == 1){
            satisfaction += C[tmp];
        }
        tmp = NUmOfFood;
    }
 

    cout << satisfaction << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: 'N' was not declared in this scope
   13 |     for(int i = 0; i < N; i++){
      |                        ^
a.cc:16:24: error: 'N' was not declared in this scope
   16 |     for(int i = 0; i < N; i++){
      |                        ^
a.cc:19:24: error: 'N' was not declared in this scope
   19 |     for(int i = 0; i < N - 1; i++){
      |                        ^
a.cc:28:15: error: 'NUmOfFood' was not declared in this scope; did you mean 'NumOfFood'?
   28 |         tmp = NUmOfFood;
      |               ^~~~~~~~~
      |               NumOfFood
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define inf (int)(1e9+7)
#define abs(x) (x >= 0 ? x : -(x))
#define ceil(a, b) a / b + !!(a % b)
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }
ll pow(ll a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:44:5: error: 'cotu' was not declared in this scope
   44 |     cotu << ans << '\n';
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define for_p(i, a, b) for(int i = a; i < b; i++)
#define for_m(i, a, b) for(int i = a - 1; i >= b; i--)

//a = s1.size();
//vector<string> s1;
//string s2 = accumulate( s1.begin(), s1.end(), string() );

using namespace std;

int main()
{
  int a = 0 , b = 0, c = 0, d = 0, e = 0, f = 0;
  int i = 0, j = 0;
  double d1 = 0, d2 = 0, d3 = 0, d4 = 0, d5 = 0, d6 = 0;
  int a1[256], a2[512], a3[1024];
  char s1[200000], s2[200000], s3[200000];
  
  cin >> a;
  
  for(i = 0; i < a; i++){
    cin >> a1[i];
  }
  for(i = 0; i < a; i++){
    cin >> a2[i];
  }
  for(i = 0; i < a; i++){
    if(i == a - 1){
      a3[i] = 0;
    }else{
      cin >> a3[i];
    }
  }
  for(i = 0; I < a; i++){
    if(i == 0 || i == a - 1){
      b += a2[a1[i]];
    }else{
      b += a2[a1[i]] + a3[a1[i]];
    }
  }
  cout << b << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:48:14: error: 'I' was not declared in this scope
   48 |   for(i = 0; I < a; i++){
      |              ^