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

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

int main() {
  int N;
  cin >> N;
  vector<int> F(N);
  int I;
  I = 0;
  int V;
  for (int i = 0; i < N; i++){
    cin >> F.at(I);
    I = I + 1;
  }
  I = 0;
  int C;
  for (int i = 0; i < N; i++){
    cin >> V;
    C = F.at(I);
    F.at(I) = C - V;
    I = I + 1;
  }
  I = 0;
  V = -100;
  for (int i = 0; i < N; i++){
    C = F.at(I);
    if (C > V) {
    V = C;
    I = I + 1;
  }
  cout << V << endl;
}

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

import java.util.Scanner;

public class atcoder {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] L = new int[N];
		for(int i = 0; i < N; i++) L[i] = sc.nextInt();
		int ans = 1;
		int sum = 0;

		for(int i = 0; i < N; i++) {
			sum += L[i];
			if(sum <= X){
				++ans;
			}

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

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

package atcoder;

import java.util.Scanner;

public class atcoder {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int X = sc.nextInt();
		int[] L = new int[N];
		for(int i = 0; i < N; i++) L[i] = sc.nextInt();
		int ans = 1;
		int sum = 0;

		for(int i = 0; i < N; i++) {
			sum += L[i];
			if(sum <= X){
				++ans;
			}

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

Compiler output:
Main.java:5: error: class atcoder is public, should be declared in a file named atcoder.java
public class atcoder {
       ^
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String args[]){
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        List<Integer> Vlist = new ArrayList<>();
        List<Integer> Clist = new ArrayList<>();

        for(int i; i<N; i++){
            Vlist.add(scanner.nextInt());
        }
        for(int i; i<N; i++){
            Clist.add(scanner.nextInt());
        }

        int maxVal = 0;
        for(int i; i<N; i++){
            if (Vlist.get(i) - Clist.get(i) >0){
                maxVal = maxVal + Vlist.get(i) - Clist.get(i);
            }
        }

        System.out.println(maxVal);
    }
}

Compiler output:
Main.java:10: error: variable i might not have been initialized
        for(int i; i<N; i++){
                   ^
Main.java:13: error: variable i might not have been initialized
        for(int i; i<N; i++){
                   ^
Main.java:18: error: variable i might not have been initialized
        for(int i; i<N; i++){
                   ^
3 errors
Language: C++

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

int abs(int x, int y) {
  if (x < y) {
    return y-x;
  }
  else{
    return x-y;
  }
}
int main(){
  int N;
  cin >>N;
  vector<int> V(N),C(N);
  for(int i =0;i<N; i++){
    cin >> V.at(i);
  }
  for(int i =0;i<N; i++){
    cin >> C.at(i);
  }
  vector<int> sa(N);
  int max =0;
  for(int i =0;i<N;i++){
    A.at(i) =V.at(i)-C.at(i);
  }
  for(int i =0;i<N;i++){
    if(A.at(i) >= 0){
      max += A.at(i);
    }
  }
  cout << max <<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'A' was not declared in this scope
   25 |     A.at(i) =V.at(i)-C.at(i);
      |     ^
a.cc:28:8: error: 'A' was not declared in this scope
   28 |     if(A.at(i) >= 0){
      |        ^
Language: C++

#include"stdafx.h"
#include<iostream>
using namespace std;

int main()
{
	int N = 0, ans = 0, tmp;
	cin >> N;
	int V[20];

	for (int i = 0; i < N; i++) {
		cin >> V[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> tmp;
		ans += V[i] - tmp > 0 ? V[i] - tmp : 0;
	}
	cout << ans << endl;
	return 0;
}

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

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

int main() {
    int N;
    int v[60], c[60], ans=0;
    for(int i=0;i<N;i++) cin >> v[i];
    for(int i=0;i<N;i++) cin >> c[i];
    for(int i=0;i<N;i++) ans += min(0,v[i]-c[i]);
    cout << and << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: expected identifier before '<<' token
   11 |     cout << and << endl;
      |                 ^~
Language: C++

# include<bits/stdc ++.h>
using namespace std ;
int main () {
// input
int N; cin >> N ;
vector <int > V ( N );
for ( int i = 0; i < N ; ++ i ) {
cin >> V [ i ];
}
vector <int > C ( N );
for ( int i = 0; i < N ; ++ i ) {
cin >> C [ i ];
}
// compute
int ans = 0;
for ( int i = 0; i < N ; ++ i ) {
if ( V [ i ] > C [ i ]) {
ans += V [ i ] - C [ i ];
}
}
// output
cout << ans << endl ;
}


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

# include < bits / stdc ++. h >
using namespace std ;
int main () {
// input
int N; cin >> N ;
vector <int > V ( N );
for ( int i = 0; i < N ; ++ i ) {
cin >> V [ i ];
}
vector <int > C ( N );
for ( int i = 0; i < N ; ++ i ) {
cin >> C [ i ];
}
// compute
int ans = 0;
for ( int i = 0; i < N ; ++ i ) {
if ( V [ i ] > C [ i ]) {
ans += V [ i ] - C [ i ];
}
}
// output
cout << ans << endl ;
}


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

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

int main(){
  int n,v[n],c[n],val=0,cos=0;
  cin >> n;
  for(int i=0;i<n; i++){
    cin >> v[i];
  }
  for(int i=0;i<n; i++){
    cin >> c[i];
  }
  for(int i=0;i<n; i++){
    if(v[i] >= c[ni]){
      val+=v[i];
      cos+=c[i];
    }
  }
  cout << val-cos << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: 'ni' was not declared in this scope; did you mean 'i'?
   14 |     if(v[i] >= c[ni]){
      |                  ^~
      |                  i
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  vector<int>b(n);
  for(int i=0;i<n;i++)
    cin>>a[i];
  for(int i=0;i<n;i++)
    cin>>b[i];
  vector<int>c(n);
  int sum =0;
  for(int i=0;i<n;i++)
    c[i]=a[i]-b[i];
  sort(c.begin(),c.end());
  for(int i=0;i<n;i++){
    if(c[i]>0)
      sum+=c[i]
    else
      break;
  }
  cout<<sum<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: expected ';' before 'else'
   20 |       sum+=c[i]
      |                ^
      |                ;
   21 |     else
      |     ~~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  vector<int>b(n);
  for(int i=0;i<n;i++)
    cin>>a[i];
  for(int i=0;i<n;i++)
    cin>>b[i];
  vector<int>c(n);
  int sum =0;
  for(int i=0;i<n;i++)
    c[i]=a[i]-b[i];
  sort(c.begin(),c.end());
  for(int i=0;i<n;i++){
    if(c[i]>0)
      sum+=c[i]
    else
      break;
  }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: expected ';' before 'else'
   20 |       sum+=c[i]
      |                ^
      |                ;
   21 |     else
      |     ~~~~
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:20:3: error: 'retrun' undeclared (first use in this function)
   20 |   retrun 0;
      |   ^~~~~~
main.c:20:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:20:9: error: expected ';' before numeric constant
   20 |   retrun 0;
      |         ^~
      |         ;
Language: C

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

int main(void){
    int N;

    scanf("%d", &N);

    int *C, *V;
    C = (int*)malloc(N * sizeof(int));
    V = (int*)malloc(N * sizeof(int));

    int i;
    int sum = 0;
    for(i=0; i<N; i++) {
        scanf("%d", &V[i]);
    }
    for(i=0; i<N; i++) {
        int temp;
        scanf("%d", &C[i]);
        if((temp = V[i] - C[i] > 0) > 0) {
            sum += temp;
    }

    printf("%d\n", temp);
    free(C);
    free(V);
}


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

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

int main(void){
    int N;

    scanf("%d", &C);

    int *C, *V;
    C = (int*)malloc(N * sizeof(int));
    V = (int*)malloc(N * sizeof(int));

    int i;
    int sum = 0;
    for(i=0; i<N; i++) {
        scanf("%d", &V[i]);
    }
    for(i=0; i<N; i++) {
        int temp;
        scanf("%d", &C[i]);
        if((temp = V[i] - C[i] > 0) > 0) {
            sum += temp;
    }

    printf("%d\n", temp);
    free(C);
    free(V);
}

Compiler output:
main.c: In function 'main':
main.c:7:18: error: 'C' undeclared (first use in this function)
    7 |     scanf("%d", &C);
      |                  ^
main.c:7:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:1: error: expected declaration or statement at end of input
   28 | }
      | ^
Language: C++

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);

    // Input
    int n = s.nextInt();
    int[] v = new int[n];
    for (int i = 0; i < n; i++) {
      v[i] = s.nextInt();
    }
    int[] c = new int[n];
    for (int i = 0; i < n; i++) {
      c[i] = s.nextInt();
    }

    // Solve
    int maxValue = 0;
    for (int i = 0; i < n; i++) {
      maxValue += Math.max(0, v[i] - c[i]);
    }

    // Output
    System.out.println(maxValue);
  }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
 
s = 0
for i in range(N):
	if V[i] > C[i]:
		s += V[i] - C[i]
	
print(s)

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

N = int (input())
V =list(map(int, input().split())
C =list(map(int, input().split())

s = 0
for i in range(N):
	if V[i]　> c[i]:
		s += V[i] - C[i]

print(s)

Compiler output:
a.cc:7:16: error: extended character 　 is not valid in an identifier
    7 |         if V[i]　> c[i]:
      |                ^
a.cc:1:1: error: 'N' does not name a type
    1 | N = int (input())
      | ^
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#define loop(i,n) for(int i = 1;i <= n; i++)
using namespace std;
int main(){
	int n;
  	cin>>n;
    int v[n], c[n];
    loop(i,n)
      cin>>v[i];
  	loop(i,n)
      cin>>c[i];
     int dp[n] = {0};
  	 dp[0] = max(0, v[i] - c[i]);
     for(int i=1;i<n;i++){
     	dp[i] = max(dp[i-1] + c[i] - v[i], dp[i-1]);
     }
  cout<<dp[n-1]<<endl;
    return 0;
}   

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: 'i' was not declared in this scope
   14 |          dp[0] = max(0, v[i] - c[i]);
      |                           ^
Language: C++

#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define int long long
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
using namespace std;
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

signed main() {
  int n;cin>>n;
  int ans = 0;
  rep(i,n){
    int v,c;cin>>v>>c;ans += max(0,v-c);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:33: error: no matching function for call to 'max(int, long long int)'
   16 |     int v,c;cin>>v>>c;ans += max(0,v-c);
      |                              ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:16:33: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   16 |     int v,c;cin>>v>>c;ans += max(0,v-c);
      |                              ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:16:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   16 |     int v,c;cin>>v>>c;ans += max(0,v-c);
      |                              ~~~^~~~~~~
Language: C

#include<stcio.h>
int main(void){
  int N,V[50],C[50],i,s[50],sum;
  scanf("%d",&N);
  for(i=0;i<=N-1;i++){
scanf("%d",&V[i]);
  }
  for(i=0;i<=N-1;i++){
    scanf("%d",&C[i]);
  }
  sum=0;
  for(i=0;i<=N-1;i++){
    s[i]=V[i]-C[i];
    if(s[i]>=0)
      sum+=s[i];
  }
  printf("%d",sum);
  return 0;
}


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

#include<stdio.h>
int main(void){
  int N,V[50],C[50],i,s[50],sum;
  scanf("%d",&N);
  for(i=0;i<=N-1,i++){
scanf("%d",&V[i]);
  }
  for(i=0;i<=N-1;i++){
    scanf("%d",&C[i]);
  }
  sum=0;
  for(i=0;i<=N-1;i++){
    s[i]=V[i]-C[i];
    if(s[i]>=0)
      sum+=s[i];
  }
  printf("%d",sum);
  return 0;
}

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

#include<stcio.h>
int main(void){
  int N,V[50],C[50],i,s[50],sum;
  scanf("%d",&N);
  for(i=0;i<=N-1,i++){
scanf("%d",&V[i]);
  }
  for(i=0;i<=N-1;i++){
    scanf("%d",&C[i]);
  }
  sum=0;
  for(i=0;i<=N-1;i++){
    s[i]=V[i]-C[i];
    if(s[i]>=0)
      sum+=s[i];
  }
  printf("%d",sum);
  return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<double> V(N);
  vector<double> C(N);
  vector<double> W(N);
  for(int i = 0; i < N; i++)
    cin >> V(i) >> C(i);
  for(int i = 0; i < N; i++)
    W.at(i) = V.at(i)/C.at(i);
  int value = 0;
  int p_value = 0;
  int cost = 0;
  int p_cost = 0;
  for(int i = 0; i < N; i++){
    value += V.at(i);
    cost += C.at(i);
    if((value - cost) - (p_value - p_cost) > 0){
      p_value = value;
      p_cost = cost;
    }
    else
      break;
  }
  cout << p_value - p_cost << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: no match for call to '(std::vector<double>) (int&)'
   10 |     cin >> V(i) >> C(i);
      |            ~^~~
a.cc:10:21: error: no match for call to '(std::vector<double>) (int&)'
   10 |     cin >> V(i) >> C(i);
      |                    ~^~~
Language: C++

#include<iostream>

using namespace std;

int main (){
  int n,i;
  
  cout<< "宝石の個数を入力（１以上２０以下の整数）" <<endl;
  cin>> n;
  cout<< "宝石の価値を入力（１以上５０以下の整数）" <<endl;
  int v[n];
  for(i=0;i<n;i++){
    cin>> v[i];
  }
  cout<< "宝石のコストを入力（１以上５０以下の整数）" <<endl;
  int c[n];
  for(i=0;i<N;i++){
    cin>> c[i];
  }
  
 int a=0;
  for(i=0;i<N;i++){
    if(V[i]>C[i]){
    	a+=V[i]-C[i];
    }
  }
  cout<< a <<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'N' was not declared in this scope
   17 |   for(i=0;i<N;i++){
      |             ^
a.cc:22:13: error: 'N' was not declared in this scope
   22 |   for(i=0;i<N;i++){
      |             ^
a.cc:23:8: error: 'V' was not declared in this scope
   23 |     if(V[i]>C[i]){
      |        ^
a.cc:23:13: error: 'C' was not declared in this scope
   23 |     if(V[i]>C[i]){
      |             ^
Language: C++

#include<iostream>

using namespace std;

int main (){
  int N,i;
  
  cout<< "宝石の個数を入力（１以上２０以下の整数）" <<endl;
  cin>> N;
  cout<< "宝石の価値を入力（１以上５０以下の整数）" <<endl;
  vector<int>V(N);
  for(i=0;i<N;i++)
    cin>> V[i];
  cout<< "宝石のコストを入力（１以上５０以下の整数）" <<endl;
  vector<int>C(N);
  for(i=0;i<N;i++)
    cin>> C[i];
  
 int X=0,Y=0;
  for(i=0;i<N;i++){
    if(V[i]>C[i]){
    	X=+V[i];
  		Y=+C[i];
    }
  }
  cout<< X-Y <<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'vector' was not declared in this scope
   11 |   vector<int>V(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | 
a.cc:11:10: error: expected primary-expression before 'int'
   11 |   vector<int>V(N);
      |          ^~~
a.cc:13:11: error: 'V' was not declared in this scope
   13 |     cin>> V[i];
      |           ^
a.cc:15:10: error: expected primary-expression before 'int'
   15 |   vector<int>C(N);
      |          ^~~
a.cc:17:11: error: 'C' was not declared in this scope
   17 |     cin>> C[i];
      |           ^
a.cc:21:8: error: 'V' was not declared in this scope
   21 |     if(V[i]>C[i]){
      |        ^
a.cc:21:13: error: 'C' was not declared in this scope
   21 |     if(V[i]>C[i]){
      |             ^
Language: C++

		cin >> v.at(i);
	}
	for (int i = 0; i < n; i++) {
		cin >> c.at(i);
	}
	int sum = 0;
	for (int i = 0; i < n; i++) {
		if(v.at(i)-c.at(i)>0)sum += v.at(i) - c.at(i);
	}
	cout << sum << endl;
}

Compiler output:
a.cc:1:17: error: 'cin' does not name a type
    1 |                 cin >> v.at(i);
      |                 ^~~
a.cc:2:9: error: expected declaration before '}' token
    2 |         }
      |         ^
a.cc:3:9: error: expected unqualified-id before 'for'
    3 |         for (int i = 0; i < n; i++) {
      |         ^~~
a.cc:3:25: error: 'i' does not name a type
    3 |         for (int i = 0; i < n; i++) {
      |                         ^
a.cc:3:32: error: 'i' does not name a type
    3 |         for (int i = 0; i < n; i++) {
      |                                ^
a.cc:7:9: error: expected unqualified-id before 'for'
    7 |         for (int i = 0; i < n; i++) {
      |         ^~~
a.cc:7:25: error: 'i' does not name a type
    7 |         for (int i = 0; i < n; i++) {
      |                         ^
a.cc:7:32: error: 'i' does not name a type
    7 |         for (int i = 0; i < n; i++) {
      |                                ^
a.cc:10:9: error: 'cout' does not name a type
   10 |         cout << sum << endl;
      |         ^~~~
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

#include<iostream>

using namespace std;

int main (){
  int N,i,X,Y,V[],C[];
  
  cout<< "宝石の個数を入力（１以上２０以下の整数）" <<endl;
  cin>> N;
  cout<< "宝石の価値を入力（１以上５０以下の整数）" <<endl;
  for(i=0;i<N;i++)
    cin>> V[i];
  cout<< "宝石のコストを入力（１以上５０以下の整数）" <<endl;
  for(i=0;i<N;i++)
    cin>> C[i];
  
 int X=0,Y=0;
  for(i=0;i<N;i++){
    if(V[i]>C[i]){
    	X=+V[i];
  		Y=+C[i];
    }
  }
  cout<< X-Y <<endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:15: error: storage size of 'V' isn't known
    6 |   int N,i,X,Y,V[],C[];
      |               ^
a.cc:6:19: error: storage size of 'C' isn't known
    6 |   int N,i,X,Y,V[],C[];
      |                   ^
a.cc:17:6: error: redeclaration of 'int X'
   17 |  int X=0,Y=0;
      |      ^
a.cc:6:11: note: 'int X' previously declared here
    6 |   int N,i,X,Y,V[],C[];
      |           ^
a.cc:17:10: error: redeclaration of 'int Y'
   17 |  int X=0,Y=0;
      |          ^
a.cc:6:13: note: 'int Y' previously declared here
    6 |   int N,i,X,Y,V[],C[];
      |             ^
Language: C++

#include<stdio.h>
int main()
{
  int ar[200].br[200];
  int n,ans=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&ar[i]);
  }
  for(i=0;i<n;i++){
    scanf("%d",&br[i]);
  }
   for(i=0;i<n;i++){
    if(ar[i]>br[i]){
      ans=ans+(a[i]-br[i]);
    }
  }
  printf("%d\n",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: expected initializer before '.' token
    4 |   int ar[200].br[200];
      |              ^
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i=0;i<n;i++){
      |       ^
a.cc:8:17: error: 'ar' was not declared in this scope
    8 |     scanf("%d",&ar[i]);
      |                 ^~
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i=0;i<n;i++){
      |       ^
a.cc:11:17: error: 'br' was not declared in this scope
   11 |     scanf("%d",&br[i]);
      |                 ^~
a.cc:13:8: error: 'i' was not declared in this scope
   13 |    for(i=0;i<n;i++){
      |        ^
a.cc:14:8: error: 'ar' was not declared in this scope
   14 |     if(ar[i]>br[i]){
      |        ^~
a.cc:14:14: error: 'br' was not declared in this scope
   14 |     if(ar[i]>br[i]){
      |              ^~
a.cc:15:16: error: 'a' was not declared in this scope
   15 |       ans=ans+(a[i]-br[i]);
      |                ^
Language: Java

import java.util.*;
public class main{
    public static void main(String[] args){
        Scanner stdle = new Scanner(System.in);
        
        int N = stdle.nextint();
        int[] V = new int[N];
        int[] C = new int[N];
        int sum = 0;
        for(int i = 0; i < N; i++){
            V[i] = stdle.nextInt();
            C[i] = stdle.nextInt();
            if(V[i] > C[i]){
                sum = sum + (V[i]-C[i]);
            }
        } 

        System.out.println(sum);


    }

} 

Compiler output:
Main.java:2: error: class main is public, should be declared in a file named main.java
public class main{
       ^
Main.java:6: error: cannot find symbol
        int N = stdle.nextint();
                     ^
  symbol:   method nextint()
  location: variable stdle of type Scanner
2 errors
Language: Java

import java.util.Scanner;
public class ACB_125_B {
	 public static void main(String args[]){
		 Scanner std = new Scanner(System.in);
		 int n = std.nextInt();
		 int[] v = new int[n];
		 int[] c = new int[n];
 		 for (int i=0;i<n;i++) {
			 v[i] = std.nextInt();
		 }
		 for( int i=0;i<n;i++) {
			 c[i] = std.nextInt();
		 }
		 int count =0;
		 for( int i=0;i<n;i++) {
			 if(v[i]>c[i]) {
				 count += v[i]-c[i];
			 }
		 }
		 System.out.println(count);
	 }
}


Compiler output:
Main.java:2: error: class ACB_125_B is public, should be declared in a file named ACB_125_B.java
public class ACB_125_B {
       ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class ReSale {

    public static void main(String arg[]){

        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();

        int[] ara1 = new int[n];
        int[] ara2 = new int[n];

        ArrayList<Integer> diff = new ArrayList<>();

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

        for(int i=0;i<n;i++){
            ara2[i] = scanner.nextInt();
            //diff.add(ara2[i] - ara1[i]);
        }


        int sum=0;

        for(int i=0;i<n;i++){
            if(ara1[i]>ara2[i]){
                sum+=ara1[i]-ara2[i];
            }
        }

        prln(sum);


    }

    public static void prln(Object line){
        System.out.println(line);
    }

    public static void pr(Object line){
        System.out.print(line);
    }

}


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

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

int main() {
  int N;
  int c[55], v[55];

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

  int plus = 0;
  for (int i = 0; i < N; i++) {
    if (v[i] - c[i] > 0) {
      plus += v[i] - c[o];
    }
  }

  cout << plus << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: 'o' was not declared in this scope
   20 |       plus += v[i] - c[o];
      |                        ^
Language: Java

package abc125;

import java.util.ArrayList;
import java.util.Scanner;

public class B_resale {

	/*
	 * ���蕶 N�̕��΂������Ai�Ԗڂ̕��΂̉��l�� Vi�ł��B ���Ȃ��͂������̕��΂̒����炢�������I���Ŏ��ɓ����܂��B
	 * ���̂Ƃ��A1���I�΂Ȃ��Ƃ��A�S�đI���ł��\���܂����B �������Ai�Ԗڂ̕��΂����ɓ������ꍇ�R�X�g Ci���x�����Ȃ����΂����܂����B
	 * ���ɓ��ꂽ���΂̉��l�̍��v�� X�A�x�������R�X�g�̍��v�� Y�Ƃ��܂��B X-Y�̍ő��l�����߂Ă��������B ���� ���͂͑S�Đ����ł����B 1��N��20
	 * 1��Ci,Vi��50
	 */

	public static void main(String[] args) {

		final Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		ArrayList<Integer> value = new ArrayList<Integer>();
		ArrayList<Integer> cost = new ArrayList<Integer>();

		for (int i = 0; i < n; i++) {
			final int v = sc.nextInt();
			value.add(v);
		}
		for (int i = 0; i < n; i++) {
			final int c = sc.nextInt();
			cost.add(c);
		}

		int result = 0;
		for (int j = 0; j < n; j++) {
			final int result1 = value.get(j) - cost.get(j);
			if (result1 < 0) {
				continue;
			}
			result = result + result1;
		}

		System.out.println(result);

	}

}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
vector<int>V(N);
  vector<int>C(N);
  
  vector<int> vec(N);
for (int i = 0; i < N; i++) {
  cin >> V.at(i);
  cin>>C.at(i)
}

 
  
  int sum=0;
  
  
  for(int i=0;i<N;i++){
    
    if(V.at(i)-C.at(i)>0){
      sum+=(V.at(i)-C.at(i));
    }
  }
  cout<<sum<<endl;
}

    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: expected ';' before '}' token
   12 |   cin>>C.at(i)
      |               ^
      |               ;
   13 | }
      | ~
Language: C++

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

    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: no match for call to '(std::vector<int>) (int&)'
    7 |   cin>>V(N);
      |        ~^~~
a.cc:9:9: error: no match for call to '(std::vector<int>) (int&)'
    9 |   cin>>C(N);
      |        ~^~~
Language: C++

#include<iostream>
using namespace std ;

int main(void){
int n;
int v[20];
int c[20];
int i;
int m = 0;
cin >> n;
for(i=1;i<=n;i++){
	cin >> v[i];
}
for(i=1;i<=n;i++){
	cin >> c[i];
}
for(i=1;i<=n;i++){
	if(v[i] > c[i]){
    	m += v[i] - m[i];
    }
}
printf("%d",m);
return 0;
  

}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:22: error: invalid types 'int[int]' for array subscript
   19 |         m += v[i] - m[i];
      |                      ^
Language: C++

#include<iostream>
using namespace std ;

int main(void){
int n;
int v[20];
int c[20];
int i;
int m = 0;
for(i=1;i<=n;i++){
	cin >> v[i];
}
for(i=1;i<=n;i++){
	cin >> c[i];
}
for(i=1;i<=n;i++){
	if(v[i] > c[i]){
    	m += c[i] - v[i];
    }
}
retrn m;
  

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:1: error: 'retrn' was not declared in this scope
   21 | retrn m;
      | ^~~~~
Language: Java

import java.util.*;
public class Resale {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int vi[]=new int[n];
        int ci[]=new int[n];
        for(int i=0;i<n;i++)
        {
            vi[i]=sc.nextInt();
        }
        for(int i=0;i<n;i++)
        {
            ci[i]=sc.nextInt();
        }
        int x=0;
        int y=0;
        for(int i=0;i<n;i++)
        {
            if(vi[i]>ci[i])
            {
                x=x+vi[i];
                y+=ci[i];
            }
        }
        System.out.println(x-y);
    }
}


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

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

int main() {
  int N;
  cin >> N;
  vector<int>V(N);
  vector<int>C(N);
  for(int i=0;i<N;i++){
    cin >> V.at(i);
  }
  for(int i =0;i<N;i++){
    cin >> C.at(i);
  }
  vector<int>A(N);
  for(int i=0;i<N;i++){
    A.at(i) = V.at(i) - C.at(i);
  }
  sort(A.begin(),A.end());
  int max=0;
  for(int i =0;i<N;i++){
   if(A.at(i)>0){
     max += A.at(i);
   }
  }
  cout << max << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:26:23: error: expected '}' at end of input
   26 |   cout << max << endl;
      |                       ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include<iostream>
using namespace std;
int main(){
	int n;
	cin >> n;
	int i,v[n],c,sum;
	for(i=0;i<n;i++)	cin >> v[i];
	for(i=0;i<n;i++){
		cin >> c;
		int d = v[i]-c;
		if(d > 0)	sum+=d;
	}
	cout << d << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'd' was not declared in this scope
   13 |         cout << d << endl;
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
         
int main(){
	int N, i;
	cin >> N;
	int V[N], C[N];
  
  for (i=0; i<N; i++){
    cin >> V[i];
  }
  
  for (i=0; i<N; i++){
  	cin >> C[i]
  }
  
  int ans = 0;
  for (i=0; i<N; i++){
  	if(V[i] > C[i]){
      	ans += (V[i]-C[i]);
    }
  
  cout << ans << endl;
  return 0;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before '}' token
   14 |         cin >> C[i]
      |                    ^
      |                    ;
   15 |   }
      |   ~                 
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> n;
      |   ^~~
      |   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:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout << x-y << 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:13:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   cout << x-y << 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<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int v[n],c[n];
  for(int i=0;i<n;i++)
  {
    cin>>v[i];
    cin>>c[i];
  }
  int x=0;y=0;
  for(int i=0;i<n;i++)
  {
    if(v[i]>c[i])
    {
      x+=v[i];
      y+=c[i];
    }
  }
  cout<<(x-y);
  return 0;
}

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

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


Compiler output:
main.c: In function 'main':
main.c:4:13: error: redeclaration of 'aw' with no linkage
    4 |         int aw=0;
      |             ^~
main.c:3:15: note: previous declaration of 'aw' with type 'int'
    3 |         int n,aw,i,v[i],c[i];
      |               ^~
Language: C

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


Compiler output:
main.c: In function 'main':
main.c:4:13: error: redeclaration of 'an' with no linkage
    4 |         int an=0;
      |             ^~
main.c:3:15: note: previous declaration of 'an' with type 'int'
    3 |         int n,an,i,v[i],c[i];
      |               ^~
Language: C++

#include <bits/stdc++.h>
#define REP(i,a,b) for(long long i=a; i<b;i++)
#define N 1000000007
#define MAX 100007
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define PI 3.14159265358979323
#define all(x) x.begin(),x.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vi;
typedef vector< pair<ll,ll> > vpi;
const long double pi=4*atan(1.0);
vpi vii;
//ll tab[100002],n;

ll Xor(ll x, ll y)
{
   return (x | y) & (~x | ~y);
}

ll dx[8]={0,1,0,-1,1,-1,1,-1};
ll dy[8]={1,0,-1,0,1,-1,-1,1};

ll number_divisors(ll n)
{
   ll d;
    ll i;
    d=0;
    for(i = 1 ; i*i<n  ;++i)
        if(n%i == 0)
            {d+=2;}

    if(i*i == n)
        d++;

}

ll countDivisibles(ll A, ll B, ll M)
{

    if (A % M == 0)
        return (B / M) - (A / M) + 1;
    return (B / M) - (A / M);
}
bool ch (ll i,ll j,ll n, ll m)
{
    return (i>=0 && i<n && j>=0 && j<m);
}
vi cost,aux;
vector<ll> v1[MAX];
ll z[MAX],mini=1000000005,out=0;
void dfs(ll s)
{   if (z[s]) return;
 z[s] = 1;
 aux.PB(s);
 for (ll u=0;u<v1[s].size();u++)
    { dfs(v1[s][u]);}

 }

 // Function to return gcd of a and b
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}

// Function to find gcd of array of
// numbers
ll findGCD(ll arr[], ll n)
{
    ll result = arr[0];
    for (ll i = 1; i < n; i++)
        result = gcd(arr[i], result);

    return result;
}

int main()
{
//freopen("input.txt","r",stdin);
ll n,x,y,sum=0;
cin>>n;
REP(i,0,n){
    cin>>x>>y;
    if (x>y) sum+=x-iy;
}
cout<<sum;

       return 0;
}


Compiler output:
a.cc: In function 'll number_divisors(ll)':
a.cc:40:1: warning: no return statement in function returning non-void [-Wreturn-type]
   40 | }
      | ^
a.cc: In function 'int main()':
a.cc:91:21: error: 'iy' was not declared in this scope; did you mean 'i'?
   91 |     if (x>y) sum+=x-iy;
      |                     ^~
      |                     i
Language: C++

#include<stdio.h>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'n' was not declared in this scope
    6 |     scanf("%d",&n);
      |                 ^
a.cc:12:21: error: 'v' was not declared in this scope
   12 |         scanf("%d",&v[i]);
      |                     ^
a.cc:16:21: error: 'c' was not declared in this scope
   16 |         scanf("%d",&c[i]);
      |                     ^
a.cc:17:17: error: 'v' was not declared in this scope
   17 |         if(c[i]<v[i])
      |                 ^
Language: C++

#include<stdio.h>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'n' was not declared in this scope
    6 |     scanf("%d",&n);
      |                 ^
a.cc:12:21: error: 'v' was not declared in this scope
   12 |         scanf("%d",&v[i]);
      |                     ^
a.cc:16:21: error: 'c' was not declared in this scope
   16 |         scanf("%d",&c[i]);
      |                     ^
a.cc:17:17: error: 'v' was not declared in this scope
   17 |         if(c[i]<v[i])
      |                 ^
Language: C++

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

int main() {
  int N, x;
  cin >> N;
  vector<int> vec(N);
  vector<int> bek(N);
  x = vec(N) - bek(N);
  
  	for (int i = 0; i < N; i++) {
      if (vec.at(i) > bek.at(i)) {
        
        x += vec.at(i) - bek.at(i);
      }
    }
  	cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: no match for call to '(std::vector<int>) (int&)'
    9 |   x = vec(N) - bek(N);
      |       ~~~^~~
a.cc:9:19: error: no match for call to '(std::vector<int>) (int&)'
    9 |   x = vec(N) - bek(N);
      |                ~~~^~~
Language: C++

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

int main() {
  cin >> N;
  vector<int> vec(N);
  vector<int> bek(N);
  int x;
  x = vec(N) - bek(N);
  
  	for (int i = 0; i < N; i++) {
      if (vec.at(i) > bek.at(i)) {
        
        x += vec.at(i) - bek.at(i);
      }
    }
  	cout << x << endl;
}


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

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

int main() {
  vector<int> vec(N);
  vector<int> bek(N);
  int x, x = vec(N) - bek(N);
  
  	for (int i = 0; i < N; i++) {
      if (vec.at(i) > bek.at(i)) {
        
        x += vec.at(i) - bek.at(i);
      }
    }
  	cout << x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: 'N' was not declared in this scope
    5 |   vector<int> vec(N);
      |                   ^
a.cc:7:10: error: redeclaration of 'int x'
    7 |   int x, x = vec(N) - bek(N);
      |          ^
a.cc:7:7: note: 'int x' previously declared here
    7 |   int x, x = vec(N) - bek(N);
      |       ^
Language: C++

#include <pch.h>
#include "bits/stdc++.h"

using namespace std;

int main() {
	int N;
	cin >> N;
	int count = 0;
	vector<int> v(N), c(N);
	for (int i = 0; i < N; i++)
	{
		cin >> v[i];
	}
	for (int i = 0; i < N; i++)
	{
		cin >> c[i];
	}
	for (int i = 0; i < N; i++)
	{
		if (v[i] > c[i])
		{
			count += v[i] - c[i];
		}
	}
	printf("%d", count);
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'for'
    9 |   for(int i=0;i<n;i++) cin >> v[i];
      |   ^~~
a.cc:9:15: error: 'i' was not declared in this scope
    9 |   for(int i=0;i<n;i++) cin >> v[i];
      |               ^
a.cc:10:31: error: 'c' was not declared in this scope
   10 |   for(int i=0;i<n;i++) cin >> c[i];
      |                               ^
a.cc:13:13: error: 'c' was not declared in this scope
   13 |     if(v[i]>c[i]) ans+=v[i]-c[i];
      |             ^
Language: C++

/*
    AUTHOR:shivam51
    IIESTS
*/
  #include<bits/stdc++.h>
  using namespace std;
  //
  #define MAX 100001
  #define md 1000000007
  #define add accumulate
  #define ll long long int
  #define ff first
  #define ss second
  #define pb push_back
  #define mp make_pair
  #define vll vector<ll>
  #define lb lower_bound
  #define ub upper_bound
  #define pll pair<ll,ll>
  #define vpll vector<pll>
  #define all(v) v.begin(), v.end()
  #define rep(i,k,n) for(int i=k;i<n;i++)
  #define hs ios_base::sync_with_stdio(false);cin.tie(NULL);
  #define repa(a,n) for(int i=a;i<n;i++)
  //
  //
  int main(){
    ll n,fst,snd;
    cin>>n;
    int fst[n],snd[n];
    rep(i,0,n)
      cin>>fst[i];
    rep(i,0,n)
      cin>>snd[i];
      ll ans=0;
    rep(i,0,n){
      // cin>>fst[i]>>snd;
      ans=max(ans,ans+fst[i]-snd[i]);
    }
    cout<<ans;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: conflicting declaration 'int fst [n]'
   30 |     int fst[n],snd[n];
      |         ^~~
a.cc:28:10: note: previous declaration as 'long long int fst'
   28 |     ll n,fst,snd;
      |          ^~~
a.cc:30:16: error: conflicting declaration 'int snd [n]'
   30 |     int fst[n],snd[n];
      |                ^~~
a.cc:28:14: note: previous declaration as 'long long int snd'
   28 |     ll n,fst,snd;
      |              ^~~
a.cc:32:15: error: invalid types 'long long int[int]' for array subscript
   32 |       cin>>fst[i];
      |               ^
a.cc:34:15: error: invalid types 'long long int[int]' for array subscript
   34 |       cin>>snd[i];
      |               ^
a.cc:38:26: error: invalid types 'long long int[int]' for array subscript
   38 |       ans=max(ans,ans+fst[i]-snd[i]);
      |                          ^
a.cc:38:33: error: invalid types 'long long int[int]' for array subscript
   38 |       ans=max(ans,ans+fst[i]-snd[i]);
      |                                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
  int n;
  cin >> n;
  vector<int> v,c;
  v.resize(n);
  c.resize(n);
  for(int i=0;i<n;i++){
    cin >> v[i];
  }
  for(int i=0;i<n;i++){
    cin >> c[i];
  }
  int sum=0;
  for(int i=0;i<n;i++){
    if(v[i]>c[i]){
      sum+=v[i]-c[i]
    }
  }
  cout<<sum;
  return 0;
}

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

#include<stdio.h>

int main(void)
{
  int N;
  scanf("%d",&N);
  int V[N],C[N];
  for(i = 0; i < N; i++) scanf("%d",V[i]);
  for(i = 0; i < N; i++) scanf("%d",C[i]);
  int a;
  for(i = 0; i < N; i++)
  {
    if((V[i]-C[i])>0) a += (V[i]-C[i])
  }
  printf("%d",a);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:7: error: 'i' undeclared (first use in this function)
    8 |   for(i = 0; i < N; i++) scanf("%d",V[i]);
      |       ^
main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:39: error: expected ';' before '}' token
   13 |     if((V[i]-C[i])>0) a += (V[i]-C[i])
      |                                       ^
      |                                       ;
   14 |   }
      |   ~
Language: C

#include<stdio.h>
#define

int main(void)
{
  int n,v[DIM],c[DIM],gap[DIM],i,max=0;
  scanf("%d",&n);
  for(i=0;i<n;i++)
  {
  scanf("%d",&v[i]);
  }
  for(i=0;i<n;i++)
  {
  scanf("%d",&c[i]);
  }
  for(i=0;i<n;i++)
  {
  gap[i]=v[i]-c[i];
    if(gap<0)
    {
    gap[i]=0;
    }
    max+=gap[i];
  }
  printf("%d",max);
return 0;
}

Compiler output:
main.c:2:8: error: no macro name given in #define directive
    2 | #define
      |        ^
main.c: In function 'main':
main.c:6:11: error: 'DIM' undeclared (first use in this function)
    6 |   int n,v[DIM],c[DIM],gap[DIM],i,max=0;
      |           ^~~
main.c:6:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
using namespace std;
int main () {
	int N;
  	cin >> N;
  	vector<int> C[N];
    vector<int> V[N];
  	for (int i = 0; i < N; i++) {
      cin >> C[i];
    }
    for (int i = 0; i < N; i++) {
      cin >> V[i];
    }
  
  	int res = 0;
  	for (int i = 0; i < N; i++) {
      int diff = V[i] - C[i];
      if (diff > 0) {
        res += diff;
      }
    }
  	cout << res <<endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'vector' was not declared in this scope
    6 |         vector<int> C[N];
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:16: error: expected primary-expression before 'int'
    6 |         vector<int> C[N];
      |                ^~~
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> V[N];
      |            ^~~
a.cc:9:14: error: 'C' was not declared in this scope
    9 |       cin >> C[i];
      |              ^
a.cc:12:14: error: 'V' was not declared in this scope
   12 |       cin >> V[i];
      |              ^
a.cc:17:18: error: 'V' was not declared in this scope
   17 |       int diff = V[i] - C[i];
      |                  ^
a.cc:17:25: error: 'C' was not declared in this scope
   17 |       int diff = V[i] - C[i];
      |                         ^
Language: C

#include<stdio.h>
int main(void){
  int N,i,ans;
  ans=0;
  scanf("%d",&N);
  int C[N],V[N];
  for(i=0;i<N;i++){
    scanf("%d",&V[i]);
  }
  for(i=0;i<N;i++){
    scanf("%d",&C[i]);
  }
  for(i=0;i<N;i++){
    if(V[i]>C[i]){ans=ans+(V[i]-C[i]);}
  }
  printf("%d",ans);

Compiler output:
main.c: In function 'main':
main.c:16:3: error: expected declaration or statement at end of input
   16 |   printf("%d",ans);
      |   ^~~~~~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<string>
#include<vector>
using namespace std;
int main(){
    int N;
    cin>>N;
    int ans=0;
    vector<int>v(N,0);
    vector<int>c(N,0);
    for(int i=0;i<N;i++){
        cin>>v[i];
    }
    for(int i=0;i<N;i++){
        cin>>c[i];
    }
    for(int i=0;i<N;i++){
        diff=v[i]-c[i];
        if(0<diff){
            ans+=diff;
        }
    }
    cout<<ans<<endl;
    return 0;

}

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

#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<string>
#include<vector>
using namespace std;
int main(){
    int N;
    cin>>N;
    int ans=0;
    vector<int>v(N,0);
    vector<int>c(N,0);
    for(int i=0;i<N;i++){
        cin>>v[i];
    }
    for(int i=0;i<N;i++){
        cin>>c[i];
    }
    for(int i=0;i<N;i++){
        diff=v[i]-c[i]
        if(0<diff)ans+=diff;
    }
    cout<<ans<<endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'diff' was not declared in this scope
   21 |         diff=v[i]-c[i]
      |         ^~~~