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

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

int main(){
    int n;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: expected ')' before '{' token
   17 |         if(v.at(i)>=c.at(i){
      |           ~                ^
      |                            )
a.cc:20:5: error: expected primary-expression before '}' token
   20 |     }
      |     ^
Language: C++

using namespace std;

int main(){
  int n, v[20], c[20], sum = 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[i])
      sum += v[i] - c[i];
  }
  cout << sum;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   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:16:3: error: 'cout' was not declared in this scope
   16 |   cout << sum;
      |   ^~~~
a.cc:16:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
using namespace std;

int mainU(){
  int n, v[20], c[20], sum = 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[i])
      sum += v[i] - c[i];
  }
  cout << sum;
  return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <stdio.h>

main()
{
	int n,r=0,i;
	int* v;
	int* c;
	scanf("%d\n",&n);
	v=(int*)malloc(sizeof(int)*n);
	c=(int*)malloc(sizeof(int)*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)r+=v[i]-c[i];
	printf("%d\n",r);
	free(v);
	free(c);
}


Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:17: error: 'malloc' was not declared in this scope
    9 |         v=(int*)malloc(sizeof(int)*n);
      |                 ^~~~~~
a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include <stdio.h>
  +++ |+#include <cstdlib>
    2 | 
a.cc:15:9: error: 'free' was not declared in this scope
   15 |         free(v);
      |         ^~~~
a.cc:15:9: note: 'free' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
Language: C++

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

int main(){
  int N;
  vector<int> V; //価値
  vector<int> C; //支払い

  for(int i = 0; i < N; i++){ //入力
    cin >> V.at(i);
    cin >> C.at(i);
  }
  int a = 0;
  
  for(int j = 0; j < N; j++){
    int b = V.at(j) - C.at(j)
    
    if(b > 0){ //宝石jが得
      int a += b; //aに差分を加算
    }
  }
  cout << a << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: expected ',' or ';' before 'if'
   18 |     if(b > 0){ //宝石jが得
      |     ^~
Language: Java

import java.util.*;

public class Main {
  
  private int[] value;
  private int[] cost;
  
  public Main() {
  }
  
  private void getValue () {
    int total = 0;
    
    for (int i = 0; i < value.length; i++) {
      if (value[i] - cost[i] > 0 )
        total += value[i] - cost[i];
    }
    
    System.out.println(total);
  }
    
  public static void main(String[] args) {
    
    Scanner scan = new Scanner(System.in);
    
    Main obj = new Main();
    int size = scan.nextInt();
    this.value = new int[size];
    this.cost = new int[size];
    
    obj.getValue();
    
  }
}


Compiler output:
Main.java:28: error: non-static variable this cannot be referenced from a static context
    this.value = new int[size];
    ^
Main.java:29: error: non-static variable this cannot be referenced from a static context
    this.cost = new int[size];
    ^
2 errors
Language: C

#include <stdio.h>
int main() {
	int a = 0;
	int d = 0;
	int e = 0;
	int b[21];
	int c[21];
    int count = 0;
	scanf("%d", &a);
  for(i=0;i<a;i++){
    scanf("%d",&b[i]);
	scanf("%d",&c[i]);
  }
  

	for (int i = 0; i<a; i++) {
       count = b[i]/c[i];
		if (count >= 1) {
			d += b[i];
			e += c[i];
		}
	}
	int ans = 0;
    ans = d - e;
	printf("%d", ans);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:7: error: 'i' undeclared (first use in this function)
   10 |   for(i=0;i<a;i++){
      |       ^
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main() {
	ll n, total = 0;
  	cin >> n;
  	vector<ll> 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 = 1; i < n + 1; i++) total += max(0, v[i] - c[i]);
  	cout << total << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:52: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   11 |         for(int i = 1; i < n + 1; i++) total += max(0, v[i] - c[i]);
      |                                                 ~~~^~~~~~~~~~~~~~~~
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:11:52: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   11 |         for(int i = 1; i < n + 1; i++) total += max(0, v[i] - c[i]);
      |                                                 ~~~^~~~~~~~~~~~~~~~
/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:11:52: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |         for(int i = 1; i < n + 1; i++) total += max(0, v[i] - c[i]);
      |                                                 ~~~^~~~~~~~~~~~~~~~
Language: Java

import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int num = Integer.parseInt(scanner.nextLine());
    String[] value = scanner.nextLine().split(" ");
    String[] cost = scanner.nextLine().split(" ");
    
    ArrayList list = new ArrayList<Integer>();
    int tmp = 0;
    for (int i = 0; i < num; i++) {
      if ((tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0) {
        list.add(tmp);
      }
    }
    if (list.size() == 0) {
      System.out.println("0");
    }
    else {
      Collections.sort(list, Comparator.reverseOrder());
      int sum = 0;
      for (int i = 0; i < list.size(); i++) {
        sum += (Integer)list.get(i)
      }
      System.out.println(sum);
    }
  }
}

Compiler output:
Main.java:24: error: ';' expected
        sum += (Integer)list.get(i)
                                   ^
1 error
Language: C++

#include <iostream>
using namespace std;

int main(){
    int N,V[N],C[N],X=0,Y=0,ans=0;
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>V[i]>>C[i];
    }
    for(int j=0;j>N;j++){
        X=V[j]-C[j];
        if(X>0){
            ans=ans+X;
        }
        if(X<0){
            ans=ans
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: expected ';' before '}' token
   16 |             ans=ans
      |                    ^
      |                    ;
   17 |         }
      |         ~
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  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];
  }
  int ans=0;
  for(int i=0;i<;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:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int>v(n,0);
      |   ^~~~~~
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:7:10: error: expected primary-expression before 'int'
    7 |   vector<int>v(n,0);
      |          ^~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int>c(n,0);
      |          ^~~
a.cc:11:10: error: 'v' was not declared in this scope
   11 |     cin>>v[i];
      |          ^
a.cc:15:10: error: 'c' was not declared in this scope
   15 |     cin>>c[i];
      |          ^
a.cc:18:17: error: expected primary-expression before ';' token
   18 |   for(int i=0;i<;i++)
      |                 ^
a.cc:20:8: error: 'v' was not declared in this scope
   20 |     if(v[i]-c[i])
      |        ^
a.cc:20:13: error: 'c' was not declared in this scope
   20 |     if(v[i]-c[i])
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int A,B_i,C_i;
	cin >> A;
    for(int i=0;i<A;i++){
      cin >>B_i;
      cin >>C_i;
    }
    int D=0;
    int D_i=0;
      for(int i=0;i<A;i++){
        if(B_i>=C_i){
          D_i=B_i-C_i;
        }else {D=0;}
      }
  for(int i=O;i<A;i++){
    D=D+D_i;
  }
		cout <<D<< endl;
}


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

#include<bits/stdc++.h>
using namespace std;
int main() {
	int A,B_i,C_i;
	cin >> A;
    for(int i=0;i<A;i++){
      cin >>B_i;
      cin >>C_i;
    }
    int D=0;
    int D_i=0;
      for(int i=0;i<A;i++){
        if(B_i>=C_i){
          D_i=B_i-C_i;
        }else {D=0;}
      }
  for(i=O;i<A;i++){
    D=D+D_i;
  }
		cout <<D<< endl;
}


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

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

int main(){
  int N,ans=0,n=1;
  int V[50],C[50],S[50];
  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++){
    S[i]=V[i]-C[i];
  }
  std::sort(S,S+N);
  if(S[N-1]<0){
    cout<<"0"<<endl;
  }
  else{
    while(S[N-n]>0)
      ans=ans+S[N-n];
      n++;
    }
    cout<<ans<<endl;
  }
  
  return 0;
}

Compiler output:
a.cc:31:3: error: expected unqualified-id before 'return'
   31 |   return 0;
      |   ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

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

int main() {
  int N;
  int ans;
  ans = 0;
  cin >> N;
  std::vector<int> V(N);
  std::vector<int> C(N);

   for(int i = 0;i<N;++i){
    cin >> V.at(i);
   }
   for(int j = 0;j<N;++j){
     cin >> C.at(j);
   for(int k = 0;k<N;++k){
     if(V.at(k) > C.at(k)){
       ++ans;
}
   }
     cout << ans << endl;
   }     

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

#include<stdio.h>

int main(void){
  int N;
  int ans=0;
  scanf("%d",N);
  int V[N],C[N];
  for(int i=0;i<N;i++){
    scanf("%d",V[i]);
  }
  for(int i=0;i<N;i++){
    scanf("%d",C[i]);
  }
  qsort(V,N,sizeof(int),compare_int);
  qsort(V,N,sizeof(int),compare_int);
  
  int comp[N];
  for(int i=0;i<N;i++){
    comp[i]=V[i]-C[i];
  }
  
  for(int i=0;comp[i]>0;i++){
    ans+=comp[i];
  }
  printf("%d",ans);
}

Compiler output:
main.c: In function 'main':
main.c:14:3: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   14 |   qsort(V,N,sizeof(int),compare_int);
      |   ^~~~~
main.c:14:25: error: 'compare_int' undeclared (first use in this function)
   14 |   qsort(V,N,sizeof(int),compare_int);
      |                         ^~~~~~~~~~~
main.c:14:25: 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,V[N],C[N],X=0,Y=0,ans=0;
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>V[i]>>C[i];
    }
    for(int j=0;j>N;j++){
        if(V[i]-C[i]>0){
            ans=ans+V[i]-c[i];
        }else{
            ans=ans;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: 'i' was not declared in this scope
   11 |         if(V[i]-C[i]>0){
      |              ^
a.cc:12:26: error: 'c' was not declared in this scope
   12 |             ans=ans+V[i]-c[i];
      |                          ^
Language: C++

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

int main(){
  int N,ans=0,n=0;
  int V[50],C[50],S[50];
  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++){
    S[i]=V[i]-C[i];
  }
  std::sort(S,S+N);
  if(S[N-1]<0){
    cout<<"0"<<endl;
  }
  else{
    while(S[N-n]<0){
      ans=ans+S[N-n];
      n++;
    }
    cout<<total<<endl;
  }
  
  return 0;
}

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

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

int main() {
  int n = 0;
  cin >> n;
  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];
  }
  int sum = 0;
  for(int i = 0; i < n; ++i) {
    int earn = v[i] - c[i];
    if(earn <= 0) {
      continue;
    }
    sum += earn;
  }
  cout << earn << endl;
  return 0;
}

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

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

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

#include <stdio.h>
int main() {
	int a = 0;
	int d = 0;
	int e = 0;
	float b[21];
	float c[21];
    float count = 0;
	scanf("%d", &a);
	scanf("%d", b);
	scanf("%d", c);
  

	for (int i = 0; i<a; i++) {
        count = b[i]/c[i];
        float one = 1.0;
		if (count >= one) {
			d += int(b[i]);
			e += int(c[i]);
		}
	}
	int ans = 0;
    ans = d - e;
	printf("%d", ans);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:18:30: error: expected expression before 'int'
   18 |                         d += int(b[i]);
      |                              ^~~
main.c:19:30: error: expected expression before 'int'
   19 |                         e += int(c[i]);
      |                              ^~~
Language: C++

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

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

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

int main(){
  int N;
  vector<int> V; //価値
  vector<int> C; //支払い

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: expected ';' before '<' token
    9 |   for(int i = 0, i < N, i++){
      |                   ^~
      |                   ;
a.cc:9:20: error: expected primary-expression before '<' token
    9 |   for(int i = 0, i < N, i++){
      |                    ^
a.cc:9:28: error: expected ';' before ')' token
    9 |   for(int i = 0, i < N, i++){
      |                            ^
      |                            ;
a.cc:14:19: error: expected ';' before '<' token
   14 |   for(int j = 0, j < N, j++){
      |                   ^~
      |                   ;
a.cc:14:20: error: expected primary-expression before '<' token
   14 |   for(int j = 0, j < N, j++){
      |                    ^
a.cc:14:28: error: expected ';' before ')' token
   14 |   for(int j = 0, j < N, j++){
      |                            ^
      |                            ;
a.cc:16:13: error: expected initializer before '+=' token
   16 |       int a += V.at(j) - C.at(j);
      |             ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
	int A,B_i,C_i;
	cin >> A;
    for(i=0;i<A;i++){
      cin >>B_i;
      cin >>C_i;
    }
    int D=0
      for(i=0;i<A;i++){
        if(B_i>=C_i){
          D=D+B_i-C_i;
        }
      }
		cout << D << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'i' was not declared in this scope
    6 |     for(i=0;i<A;i++){
      |         ^
a.cc:11:7: error: expected ',' or ';' before 'for'
   11 |       for(i=0;i<A;i++){
      |       ^~~
a.cc:11:15: error: 'i' was not declared in this scope
   11 |       for(i=0;i<A;i++){
      |               ^
Language: C

#include  <stdio.h>

int main(void)
{
	int V[20], C[20];
	int N;
	int i;
	int d = 0;

	scanf_s("%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]) {
			d += (V[i] - C[i]);
		}
	}

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

	return 0;
}

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

#include<stdio.h>
main()
{
  int a;
  int b[a],c[a];
  printf("aの値を入れてください");
  scanf("%d",&a);
  int i=0;
  if(i<a)
  {printf("i番目のbを入力してください");
   scanf("%d",b[i]);
   i ++;
  }
  int l=0;
  int max=0;
  if(l<c)
  {printf("i番目のcを入力してください");
   scanf("%d",c[l]);
   l ++;
  }
  int m=0;
  if(m<a)
  {if(b[m]>c[m])
  {max=max+b[m]-c[m];}
   m ++;
  }
  printf("%d",max);
  return 0;
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:16:7: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |   if(l<c)
      |      ~^~
Language: C

#include <stdio.h>
int main() {
	int a = 0;
	int d = 0;
	int e = 0;
	int b[21];
	int c[21];
    float count = 0;
	scanf("%d", &a);
	scanf("%d", b);
	scanf("%d", c);
  

	for (int i = 0; i<a; i++) {
        count = b[i]/c[i];
		if (count >= 1.0) {
			d += b[i];
			e += c[i];
		}
	}
	int ans = 0
    ans = d - e;
	printf("%d", ans);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:22:5: error: expected ',' or ';' before 'ans'
   22 |     ans = d - e;
      |     ^~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'o' was not declared in this scope
   15 |   for(int i=o; i<N; i++){
      |             ^
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);
  }
  int sum=0;
  for(i=0;i<N;i++){
    if(V.at(i)>C.at(i)){
      sum+=V.at(i)-C.at(i);
    }
  }
   cout<<sum<<endl;
    return 0;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'i' was not declared in this scope
   18 |   for(i=0;i<N;i++){
      |       ^
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);
  }
  int sum=0;
  for(i=0;i<N;i++){
    if(V.at(i)>C.at(i)){
      sum+=V.at(i)-C.at(i);
    }
   cout<<sum<<endl;
    return 0;
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'i' was not declared in this scope
   18 |   for(i=0;i<N;i++){
      |       ^
a.cc:24:4: error: expected '}' at end of input
   24 |   }
      |    ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
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);
  }
  int sum=0;
  for(i=0;i<N;i++){
    if(V.at(i)>C.at(i)){
      sum+=V.at(i)-C.at(i);
    }
   cout<<sum<<endl;
    return 0;
  }
  

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

#include <iostream>
using namespace std;
 #include <vector>
int main(){
  int N
  int ans=0;
  cin>>N;
  vector<int> V,C;
  for(int i=0; i<N; i++){
    int k,l;
    cin >> k;
    cin >> l;
      V.push_back(k);
      C.push_back(l);
  }
  
  for(int i=0; i<N; i++){
    if(V[i]-C[i]>0){
    ans=ans+V[i]-C[i];
    }   
  }
  
   cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'int'
    6 |   int ans=0;
      |   ^~~
a.cc:7:8: error: 'N' was not declared in this scope
    7 |   cin>>N;
      |        ^
a.cc:19:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |     ans=ans+V[i]-C[i];
      |     ^~~
      |     abs
a.cc:23:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |    cout << ans << endl;
      |            ^~~
      |            abs
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int c[n];
  int v[n];
  int s=0;
  for (int i=0;i<n;i++){cin>>c[i];}
  for (int j=0;j<n;j++){cin>>c[j];}
  for (int k=0;k<n;k++){
    if (v[k]>c[k]){
      s+=v[k]-c[k];
    }
    cout<<s;
  }
      
  

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

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

Compiler output:
main.c: In function 'main':
main.c:5:7: error: array size missing in 'v'
    5 |   int v[];
      |       ^
main.c:6:7: error: array size missing in 'c'
    6 |   int c[];
      |       ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: 'i' was not declared in this scope
   15 |   if(V.at(i) > C.at(i)){
      |           ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: 'i' was not declared in this scope
   15 |   if(V,at(i) > C.at(i)){
      |           ^
a.cc:15:8: error: 'at' was not declared in this scope; did you mean 'an'?
   15 |   if(V,at(i) > C.at(i)){
      |        ^~
      |        an
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected initializer before '.' token
    7 |   vector<int> V.at(N);
      |                ^
a.cc:8:16: error: expected initializer before '.' token
    8 |   vector<int> C.at(N);
      |                ^
a.cc:9:29: error: expected ')' before ';' token
    9 |   for( int i = 0; i < N; i++; )
      |      ~                      ^
      |                             )
a.cc:9:31: error: expected primary-expression before ')' token
    9 |   for( int i = 0; i < N; i++; )
      |                               ^
a.cc:11:29: error: expected ')' before ';' token
   11 |   for( int i = 0; i < N; i++; )
      |      ~                      ^
      |                             )
a.cc:11:31: error: expected primary-expression before ')' token
   11 |   for( int i = 0; i < N; i++; )
      |                               ^
a.cc:13:29: error: expected ')' before ';' token
   13 |   for( int i = 0; i < N; i++; ) {
      |      ~                      ^
      |                             )
a.cc:13:31: error: expected primary-expression before ')' token
   13 |   for( int i = 0; i < N; i++; ) {
      |                               ^
Language: C

#include <stdio.h>
int main() {
	int a = 0;
	int d = 0;
	int e = 0;
	int b[21];
	int c[21];
	scanf_s("%d", &a);
	scanf_s("%d", b);
	scanf_s("%d", c);

	for (int i = 0; i<a; i++) {
		if (b[i] / c[i] >= 1.0) {
			d += b[i];
			e += c[i];
		}
	}
	int ans = d - e;
	printf("%d", ans);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    8 |         scanf_s("%d", &a);
      |         ^~~~~~~
      |         scanf
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[i]>>c[i];
  }
  if(v[i]>c[i]){
    cout<<v[i]-c[i]<<endl;
  }
  else{
    cout<<"0"<<endl;
  }
  
}




Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'i' was not declared in this scope
   12 |   if(v[i]>c[i]){
      |        ^
Language: C++

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

int main() {
  int N; cin >> N;
  int sum = 0;
  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);
  for( int i = 0; i < N; i++; ) {
    if( V.at(i) > C.at(i) )
      sum = sum + V.at(i) - C.at(i);
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: expected initializer before '.' token
    7 |   vector<int> V.(N);
      |                ^
a.cc:8:16: error: expected initializer before '.' token
    8 |   vector<int> C.(N);
      |                ^
a.cc:9:29: error: expected ')' before ';' token
    9 |   for( int i = 0; i < N; i++; )
      |      ~                      ^
      |                             )
a.cc:9:31: error: expected primary-expression before ')' token
    9 |   for( int i = 0; i < N; i++; )
      |                               ^
a.cc:11:29: error: expected ')' before ';' token
   11 |   for( int i = 0; i < N; i++; )
      |      ~                      ^
      |                             )
a.cc:11:31: error: expected primary-expression before ')' token
   11 |   for( int i = 0; i < N; i++; )
      |                               ^
a.cc:13:29: error: expected ')' before ';' token
   13 |   for( int i = 0; i < N; i++; ) {
      |      ~                      ^
      |                             )
a.cc:13:31: error: expected primary-expression before ')' token
   13 |   for( int i = 0; i < N; i++; ) {
      |                               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int x[1000],y[1000];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n*2;i++)
	{
		if(i==n)
			scanf("%d",&y[n-i]);
		else
			scanf("%d",&x[i]);
	}
	int max_=0;
	for(int i=0;i<n;i++)
	{
		for(int j=0;i<n;j++)
		{
			if(i!=j)
			{
				if((x[i]+x[j]-(y[i]+y[j])>max_)
					max_=(x[i]+x[j]-(y[i]+y[j]);
			}
		}
	}
	printf("%d",max_);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:64: error: expected ')' before 'max_'
   22 |                                 if((x[i]+x[j]-(y[i]+y[j])>max_)
      |                                   ~                            ^
      |                                                                )
   23 |                                         max_=(x[i]+x[j]-(y[i]+y[j]);
      |                                         ~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int x[1000],y[1000];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<n*2;i++)
	{
		if(i==n)
			scanf("%d",&y[n-i]);
		else
			scanf("%d",&x[i]);
	}
	int max_=0;
	for(int i=0;i<n;i++)
	{
		for(int j=0;i<n;j++)
		{
			if(i!=j)
			{
				if((x[i]+x[j]]-(y[i]+y[j])>max_)
					max_=(x[i]+x[j]]-(y[i]+y[j]);
			}
		}
	}
	printf("%d",max_);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:46: error: expected ')' before ']' token
   22 |                                 if((x[i]+x[j]]-(y[i]+y[j])>max_)
      |                                    ~         ^
      |                                              )
a.cc:23:69: error: expected ')' before ';' token
   23 |                                         max_=(x[i]+x[j]]-(y[i]+y[j]);
      |                                                                     ^
      |                                                                     )
a.cc:22:35: note: to match this '('
   22 |                                 if((x[i]+x[j]]-(y[i]+y[j])>max_)
      |                                   ^
Language: C++

#include <algorithm>
#include <vector>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <fstream>
#include <math.h>

using namespace std;

int main(void)
{
	int n;
	cin >> n;
	int c[n], v[n];
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> c[i];
	}

	int ans = INT_MIN;
	for (uint32_t i = 0; i < pow(2, n); i++) {
		int x = 0, y = 0;
		for (int j = 0; j < n; j++) {
			if (((i >> j) & 1) == 1) {
				x += v[j];
				y += c[j];
			}
		}
		ans = max(ans, x-y);
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:19: error: 'INT_MIN' was not declared in this scope
   27 |         int ans = INT_MIN;
      |                   ^~~~~~~
a.cc:12:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   11 | #include <math.h>
  +++ |+#include <climits>
   12 | 
a.cc:28:14: error: 'uint32_t' was not declared in this scope
   28 |         for (uint32_t i = 0; i < pow(2, n); i++) {
      |              ^~~~~~~~
a.cc:12:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   11 | #include <math.h>
  +++ |+#include <cstdint>
   12 | 
a.cc:28:30: error: 'i' was not declared in this scope
   28 |         for (uint32_t i = 0; i < pow(2, n); i++) {
      |                              ^
Language: C++

#include <iostream>
using namespace std;

int main(){
int n;
int v[n];
int c[n];
int sum = 0;
  cin >> n >> v[n] >> c[n] >> sum;
  for(int i = 0;i<n;i++){
    cin >> n[i] >> cin[i];
  if(v[i] / c[i] != 0){
  sum += 0;
  }else {
  sum += v[i] - c[i];
  }
  }
  cout << sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: invalid types 'int[int]' for array subscript
   11 |     cin >> n[i] >> cin[i];
      |             ^
a.cc:11:23: error: no match for 'operator[]' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
   11 |     cin >> n[i] >> cin[i];
      |                       ^
Language: C++


n=int(input())
v=list(map(int, input().split()))
c=list(map(int, input().split()))

x=0
y=0

for v,c in zip(v,c):
    if v>c:
        x=x+v
        y=y+c

print(x-y)

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

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

int main() {
  int N; 
  vector<int>V(N);
  for(int i=0; i<N; i++){
    cin >> V.at(i);
  }
  vevtor<int>C(N);
  for(int i=0; i<N; i++){
    cin >> C.at(i);
  }
  int an = 0;
  if(V,at(i) > C.at(i)){
    an += V.at(i) - C.at(i);
  }
  cout << an <<endl;
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vevtor' was not declared in this scope
   10 |   vevtor<int>C(N);
      |   ^~~~~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vevtor<int>C(N);
      |          ^~~
a.cc:12:12: error: 'C' was not declared in this scope
   12 |     cin >> C.at(i);
      |            ^
a.cc:15:11: error: 'i' was not declared in this scope
   15 |   if(V,at(i) > C.at(i)){
      |           ^
a.cc:15:8: error: 'at' was not declared in this scope; did you mean 'an'?
   15 |   if(V,at(i) > C.at(i)){
      |        ^~
      |        an
a.cc:15:16: error: 'C' was not declared in this scope
   15 |   if(V,at(i) > C.at(i)){
      |                ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
using namespace std;
int C[50],V[50];
signed main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) cin >> V[i];
  for (int i = 0; i < N; i++) cin >> C[i];
  int ans = 0;
  for (int i = 0; i < N; i++) {
    ans += max(0, V[i]-C[i]);
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:15: error: no matching function for call to 'max(int, long long int)'
   14 |     ans += max(0, V[i]-C[i]);
      |            ~~~^~~~~~~~~~~~~~
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:14:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   14 |     ans += max(0, V[i]-C[i]);
      |            ~~~^~~~~~~~~~~~~~
/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:14:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   14 |     ans += max(0, V[i]-C[i]);
      |            ~~~^~~~~~~~~~~~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: expected ';' before ')' token
   10 |     cin>>VALUE.at(i))>>COST.at(i);
      |                     ^
      |                     ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   14 |         cout<ans<<endl;
      |              ~~~^~~~~~
Language: C++

#include <iostream>
using namespace std;
 #include <vector>
int main(){
  int N
  int ans=0;
  vector<int> V,C;
  for(int i=0; i<N; i++){
    int k,l;
    cin >> k;
    cin >> l;
      V.push_back(k);
      C.push_back(l);
  }
  for(int i=0; i<N; i++){
    if(V[i]-C[i]>0){
    ans=ans+V[i]-C[i];
    }
    
  }
  
   cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'int'
    6 |   int ans=0;
      |   ^~~
a.cc:8:18: error: 'N' was not declared in this scope
    8 |   for(int i=0; i<N; i++){
      |                  ^
a.cc:15:18: error: 'N' was not declared in this scope
   15 |   for(int i=0; i<N; i++){
      |                  ^
a.cc:17:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     ans=ans+V[i]-C[i];
      |     ^~~
      |     abs
a.cc:22:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |    cout << ans << endl;
      |            ^~~
      |            abs
Language: C++

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

int main() {
  int N; 
  vector<int>V(N);
  for(int i=0;, i<N;, i++){
    cin >> V.at(i);
  }
  vevtor<int>C(N);
  for(int i=0;, i<N;, i++){
    cin >> C.at(i);
  }
  int an = 0;
  if(V,at(i) > C.at(i)){
    an += V.at(i) - C.at(i);
  }
  cout << an <<endl;
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected primary-expression before ',' token
    7 |   for(int i=0;, i<N;, i++){
      |               ^
a.cc:7:21: error: expected primary-expression before ',' token
    7 |   for(int i=0;, i<N;, i++){
      |                     ^
a.cc:10:3: error: 'vevtor' was not declared in this scope
   10 |   vevtor<int>C(N);
      |   ^~~~~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vevtor<int>C(N);
      |          ^~~
a.cc:11:15: error: expected primary-expression before ',' token
   11 |   for(int i=0;, i<N;, i++){
      |               ^
a.cc:11:21: error: expected primary-expression before ',' token
   11 |   for(int i=0;, i<N;, i++){
      |                     ^
a.cc:12:12: error: 'C' was not declared in this scope
   12 |     cin >> C.at(i);
      |            ^
a.cc:15:11: error: 'i' was not declared in this scope
   15 |   if(V,at(i) > C.at(i)){
      |           ^
a.cc:15:8: error: 'at' was not declared in this scope; did you mean 'an'?
   15 |   if(V,at(i) > C.at(i)){
      |        ^~
      |        an
a.cc:15:16: error: 'C' was not declared in this scope
   15 |   if(V,at(i) > C.at(i)){
      |                ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin>>VALUE(i)>>COST(i);
      |          ~~~~~^~~
a.cc:10:24: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin>>VALUE(i)>>COST(i);
      |                    ~~~~^~~
a.cc:17:2: error: expected '}' at end of input
   17 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

template <typename T>
inline std::string to_bin_str(T n, std::size_t digit_num) {
	std::string str;
	while (n > 0) {
		str.push_back('0' + (n & 1));
		n >>= 1;
	}
	str.resize(digit_num, '0');
	std::reverse(str.begin(), str.end());
	return str;
}

int main() {
	int n;
	std::cin >> n;
	int l;
	std::vector<int> c, v;
	std::vector<std::string> pattern;
	for (int i = 0; i < n; i++)
	{
		std::cin >> l;
		v.push_back(l);
	}
	for (int i = 0; i < n; i++)
	{
		std::cin >> l;
		c.push_back(l);
	}
	for (int i = 0; i < pow(n, 2.0); i++)
	{
		pattern.push_back(to_bin_str(i, n));
	}

	int max = 0;
	int buf = 0;
	for (unsigned int i = 0; i < pattern.size(); i++) {
		buf = 0;
		for (unsigned int j = 0; j < pattern[i].size(); j++)
		{
			if (pattern[i][j] == '1')
			{
				buf += v[j] - c[j];
			}
		}
		if (buf > max)
		{
			max = buf;
		}
	}
	std::cout << max << "\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:29: error: 'pow' was not declared in this scope
   34 |         for (int i = 0; i < pow(n, 2.0); i++)
      |                             ^~~
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>S(N);
  for(int i=0;i<N;i++){
    S.at(i)=V.at(i)-C.at(i);
  }
  int sum=0;
  for(int i=0;i<N;i++){
    if(S.at(i)>0){
      sum=sum+S.at(i)}
    else{
    }
  }
  cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: expected ';' before '}' token
   21 |       sum=sum+S.at(i)}
      |                      ^
      |                      ;
Language: C++

#include <iostream>
using namespace std;
 #include <vector>
int main(){
  int N,ans;
  vector<int> V,C;
  for(int i=0; i<n; i++){
    int k,l;
    cin >> k;
    cin >> l;
      V.push_back(k);
      C.push_back(l);
  }
  for(int i=0; i<N; i++){
    if(V[i]-C[i]>0){
    ans=V[i]-C[i];
    }
    
  }
  
   cout << ans << endl;
}


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

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

int main() {
  int N; 
  vector<int>V(N);
  for(int i=0, i<N, i++){
    cin >> V.at(i);
  }
  vevtor<int>C(N);
  for(int i=0, i<N, i++){
    cin >> C.at(i);
  }
  int an = 0;
  if(V,at(i) > C.at(i)){
    an += V.at(i) - C.at(i);
  }
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected ';' before '<' token
    7 |   for(int i=0, i<N, i++){
      |                 ^
      |                 ;
a.cc:7:17: error: expected primary-expression before '<' token
a.cc:7:24: error: expected ';' before ')' token
    7 |   for(int i=0, i<N, i++){
      |                        ^
      |                        ;
a.cc:10:3: error: 'vevtor' was not declared in this scope
   10 |   vevtor<int>C(N);
      |   ^~~~~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vevtor<int>C(N);
      |          ^~~
a.cc:11:17: error: expected ';' before '<' token
   11 |   for(int i=0, i<N, i++){
      |                 ^
      |                 ;
a.cc:11:17: error: expected primary-expression before '<' token
a.cc:11:24: error: expected ';' before ')' token
   11 |   for(int i=0, i<N, i++){
      |                        ^
      |                        ;
a.cc:12:12: error: 'C' was not declared in this scope
   12 |     cin >> C.at(i);
      |            ^
a.cc:15:11: error: 'i' was not declared in this scope
   15 |   if(V,at(i) > C.at(i)){
      |           ^
a.cc:15:8: error: 'at' was not declared in this scope; did you mean 'an'?
   15 |   if(V,at(i) > C.at(i)){
      |        ^~
      |        an
a.cc:15:16: error: 'C' was not declared in this scope
   15 |   if(V,at(i) > C.at(i)){
      |                ^
Language: C++

#include <string>
#include <vector>
#include <map>
#include <iostream>
#define ll long long
using namespace std;

int V[22];

int main() {
    int N;
    cin>>N;
    for(int i=1;i<=N;i++) {
        cin>>V[i];
    }
    vector<int> diffs;
    for(int i=1;i<=N;i++) {
        int C;
        cin>>C;
        diffs.push_back(V[i]-C);
    }
    sort(diffs.begin(),diffs.end());
    int ans=0;
    for(int i=N-1;i>=0;i--) {
        if (diffs[i]<=0)
            break;
        ans += diffs[i];
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |     sort(diffs.begin(),diffs.end());
      |     ^~~~
      |     short
Language: C++

#include <iostream>
using namespace std;
 #include <vector>
int main(){
  int N,ans;
  vector<int> V,C;
  for(int i=0; i<n; i++){
    int k,l;
    cin >> k;
    cin >> l;
      V.push_back(k);
      C.push_back(l);
  }
  for(int i=0; i<N; i++){
    if(V{i}-C[i]>0){
    ans=V{i}-C[i];
    }
    
  }
  
   cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: 'n' was not declared in this scope
    7 |   for(int i=0; i<n; i++){
      |                  ^
a.cc:15:9: error: expected ')' before '{' token
   15 |     if(V{i}-C[i]>0){
      |       ~ ^
      |         )
a.cc:15:8: error: could not convert 'V' from 'std::vector<int>' to 'bool'
   15 |     if(V{i}-C[i]>0){
      |        ^
      |        |
      |        std::vector<int>
a.cc:16:9: error: cannot convert 'std::vector<int>' to 'int' in assignment
   16 |     ans=V{i}-C[i];
      |         ^
      |         |
      |         std::vector<int>