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

#include <iostream>
using namespace std;
 
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:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> V,C;
      |   ^~~~~~
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:10: error: expected primary-expression before 'int'
    6 |   vector<int> V,C;
      |          ^~~
a.cc:7:18: error: 'n' was not declared in this scope
    7 |   for(int i=0; i<n; i++){
      |                  ^
a.cc:11:7: error: 'V' was not declared in this scope
   11 |       V.push_back(k);
      |       ^
a.cc:12:7: error: 'C' was not declared in this scope
   12 |       C.push_back(l);
      |       ^
a.cc:15:8: error: 'V' was not declared in this scope
   15 |     if(V{i}-C[i]>0){
      |        ^
a.cc:15:9: error: expected ')' before '{' token
   15 |     if(V{i}-C[i]>0){
      |       ~ ^
      |         )
a.cc:16:14: error: 'C' was not declared in this scope
   16 |     ans=V{i}-C[i];
      |              ^
Language: C

##include <stdio.h>
int main(int argc, char const *argv[]) {
  int N,i, w;
  int V[20],C[20];

  scanf("%d\n",&N );
  for ( i = 0; i < N; i++) {
    scanf("%d",&V[i] );
  }
  printf("\n" );
  for ( i = 0; i < N; i++) {
    scanf("%d",&C[i] );
  }

  w = 0;

  for ( i = 0; i < 20; i++) {
    if(V[i] - C[i] > 0){
      w += V[i] - C[i];
    }
  }

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

  return 0;
}


Compiler output:
main.c:1:1: error: stray '##' in program
    1 | ##include <stdio.h>
      | ^~
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | ##include <stdio.h>
      |           ^
Language: C

##include <stdio.h>
int main(int argc, char const *argv[]) {
  int N,i, w;
  int V[20],C[20];

  scanf("%d\n",&N );
  for ( i = 0; i < N; i++) {
    scanf("%d",&V[i] );
  }
  printf("\n" );
  for ( i = 0; i < N; i++) {
    scanf("%d",&C[i] );
  }

  w = 0;

  for ( i = 0; i < 20; i++) {
    if(V[i] - C[i] > 0){
      w += V[i] - C[i];
    }
  }



  return 0;
}

Compiler output:
main.c:1:1: error: stray '##' in program
    1 | ##include <stdio.h>
      | ^~
main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | ##include <stdio.h>
      |           ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <utility>
#include <math.h>
#include <stdexcept>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cassert>
#include <string.h>

using namespace std;
#define  rep(i,n) for(int i=0;i<n;i++)
#define  rrep(i,n) for(int i=n;i>0;i--)
#define  REP(i,a,b) for(int i=a;i<b;i++)
typedef long long int lld;
typedef vector<lld> vl;
typedef vector<int> vi;
typedef vector<string> vs;



//int arr[N]
////sort(arr,arr +N)

//vector <int> hoge
////sort(hoge.begin(),hoge.end());
///min_element(hoge.begin(),hoge.end();　最小値　　　最大値はmax_element();

int main() {

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



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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
    // Write Your Code Below
    
   ll n; cin >> n;
 vector<ll> v(n);
 rep(i, n) {
 cin >> v[i];
 }
 
 vector<ll> c(n);
 rep(i, n) {
 cin >> c[i];
 }
 vector<ll> k(n);
 rep(i, n) { if(v[i]>=c[i]) {k[i] = v[i] - c[i] ;} ;
 else if (v[i] < c[i]) {k[i] = 0 ;} ;}
 ll sum = 0;
 rep(i, n) {
 sum += k[i];
 }
 cout << sum << endl;
 }
   

}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:2: error: 'else' without a previous 'if'
   32 |  else if (v[i] < c[i]) {k[i] = 0 ;} ;}
      |  ^~~~
a.cc: At global scope:
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:15: error: 'ibt' was not declared in this scope; did you mean 'int'?
    4 |   std::vector<ibt>V(N),C(N);
      |               ^~~
      |               int
a.cc:4:18: error: template argument 1 is invalid
    4 |   std::vector<ibt>V(N),C(N);
      |                  ^
a.cc:4:18: error: template argument 2 is invalid
a.cc:5:35: error: invalid types 'int[int]' for array subscript
    5 |   for(int i=0;i<N;i++){std::cin>>V[i];}
      |                                   ^
a.cc:6:35: error: invalid types 'int[int]' for array subscript
    6 |   for(int i=0;i<N;i++){std::cin>>C[i];}
      |                                   ^
a.cc:9:22: error: invalid types 'int[int]' for array subscript
    9 |     ans+=std::max(0,V[i]-C[i]);
      |                      ^
a.cc:9:27: error: invalid types 'int[int]' for array subscript
    9 |     ans+=std::max(0,V[i]-C[i]);
      |                           ^
Language: C++

#include<iostream>
using namespace std;

main(){
  int N;
  cin >> N;
  int V[N];
  int C[N];
  for(int ii=0;ii<N;ii++){
    cin >> V[ii];
  }
  for(int ii=0;ii<N;ii++){
    cin >> C[ii];
  }
  itn ans=0;
  for(int ii=0;ii<N;ii++){
    if(V[ii]>C[ii])ans+=V[ii]-C[ii];
  }
  cout << ans << endl;
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:15:3: error: 'itn' was not declared in this scope; did you mean 'int'?
   15 |   itn ans=0;
      |   ^~~
      |   int
a.cc:17:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     if(V[ii]>C[ii])ans+=V[ii]-C[ii];
      |                    ^~~
      |                    abs
a.cc:19:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:15: error: 'ibt' was not declared in this scope; did you mean 'int'?
    4 |   std::vector<ibt>V(N),C(N);
      |               ^~~
      |               int
a.cc:4:18: error: template argument 1 is invalid
    4 |   std::vector<ibt>V(N),C(N);
      |                  ^
a.cc:4:18: error: template argument 2 is invalid
a.cc:7:22: error: invalid types 'int[int]' for array subscript
    7 |     ans+=std::max(0,V[i]-C[i]);
      |                      ^
a.cc:7:27: error: invalid types 'int[int]' for array subscript
    7 |     ans+=std::max(0,V[i]-C[i]);
      |                           ^
Language: C

#include <stdio.h>
int main(){
int a,d,e,ans = 0;
  int b[51];
  int c[51];
  scanf("%d",&a);
  scanf("%d",b);
  scanf("%d",c);
  
  for(int i=0; i<a; i++){
    if(b[i]/c[i] >= 1.0){
      d += b[i];
      e += c[i];
    }
  }
  ans = d-e;
  print("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |   print("%d",ans);
      |   ^~~~~
      |   printf
Language: C

#import<stdio.h>
int a[21],k,i,n,m;
main()
  {
  for(scanf("%d",&n);i++<n);)scanf("%d",a+i);
  for(i=0;i++<n;)scanf("%d",&k),a[i]>k?m+=a[i]-k:0;
  printf("%d",m);
  }

Compiler output:
main.c:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    1 | #import<stdio.h>
      |  ^~~~~~
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main()
      | ^~~~
main.c: In function 'main':
main.c:5:27: error: expected ';' before ')' token
    5 |   for(scanf("%d",&n);i++<n);)scanf("%d",a+i);
      |                           ^
      |                           ;
main.c:5:29: error: expected statement before ')' token
    5 |   for(scanf("%d",&n);i++<n);)scanf("%d",a+i);
      |                             ^
Language: C++

#include "pch.h"
#include <iostream>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <math.h>
using namespace std;

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

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, ans = 0;
  cin >> N;
  vector<int> value(N);
  vector<int> cost(N);
  for (int i = 0; i < N; i++) {
    cin >> value.at(i);
    cin >> cost.at(i);
  vector<int> difference(i);
  difference.at(i) = cost.at(i) - value.at(i);
  for (int i = 0; i < N; i++) {
    if (difference.at(i) > 0) {
      ans = ans + difference.at(i);
    }
  }
  cout << ans;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
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 V[N], C[N], S[N], sum = 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++)
    S[i] = V[i] - C[i];
  sort(S.begin(), S.end()); 
  while (S[i] > 0) {
    sum += S[i];
    i++;
  }
  cout << sum << endl;
}

  
    
                    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: request for member 'begin' in 'S', which is of non-class type 'int [N]'
   15 |   sort(S.begin(), S.end());
      |          ^~~~~
a.cc:15:21: error: request for member 'end' in 'S', which is of non-class type 'int [N]'
   15 |   sort(S.begin(), S.end());
      |                     ^~~
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |   sort(S.begin(), S.end());
      |   ^~~~
      |   short
a.cc:16:12: error: 'i' was not declared in this scope
   16 |   while (S[i] > 0) {
      |            ^
Language: C

#include <stdio.h>
int main(){
int a,d,e,ans = 0;
  int b[51];
  int c[51];
  scanf("%d",&a);
  scanf("%d",b);
  scanf("%d",c);
  
  for(i=0; i<a; i++){
    if(b[i]/c[i] >= 1.0){
      d += b[i];
      e += c[i];
    }
  }
  ans = d-e;
  print("%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
main.c:17:3: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   17 |   print("%d",ans);
      |   ^~~~~
      |   printf
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
    // Write Your Code Below
    
   ll n; cin >> n;
 vector<ll> v(n);
 rep(i, n) {
 cin >> v[i];
 }
 
 vector<ll> c(n);
 rep(i, n) {
 cin >> c[i];
 }
 vector<ll> k(n);
 rep(i, n) { if(v[i]>=c[i]) {k[i] = v[i] - c[i]} ;
 else {k[i] = 0} ;}
 ll sum = 0;
 rep(i, n) {
 sum += k[i];
 }
 cout << sum << endl;
 }
   


Compiler output:
a.cc: In function 'int main()':
a.cc:31:48: error: expected ';' before '}' token
   31 |  rep(i, n) { if(v[i]>=c[i]) {k[i] = v[i] - c[i]} ;
      |                                                ^
      |                                                ;
a.cc:32:2: error: 'else' without a previous 'if'
   32 |  else {k[i] = 0} ;}
      |  ^~~~
a.cc:32:16: error: expected ';' before '}' token
   32 |  else {k[i] = 0} ;}
      |                ^
      |                ;
Language: C++

#include<iostream>
using namespace std;

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

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

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

#include <iostream>

using namespace std;

int main()
{
	int res = 0;

	int n = 0;
	cin >> n;

	int* v = new int[n];
	for (int i = 0; i < n; i++)
	{
		cin >> v[i];
	}

	int *c = new int[n];
	for (int i = 0; i < n; i++)
	{
		cin >> c[i];
	}

	check();

	cout << res;

	return 0;
}

int check()
{
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'check' was not declared in this scope
   24 |         check();
      |         ^~~~~
Language: Java

import java.util.*;

pubilc class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
	    int[] a = new int[N];
	    int[] b = new int[N];
	    int ans = 0;
	    
	    for(int i=0;i<N;i++){
	      a[i] = sc.nextInt();
	    }
	    for(int i=0;i<N;i++){
	      b[i] = sc.nextInt();
	    }
	    
	    for(int i=0;i<N;i++){
	      if(a[i]>=b[i]){
	        ans += a[i] - b[i];
	      }
	    }
	    
	    System.out.println(ans);
    
  }
}


Compiler output:
Main.java:3: error: class, interface, enum, or record expected
pubilc class Main{
^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
    // Write Your Code Below
    
   ll n; cin >> n;
 vector<ll> v(n);
 rep(i, n) {
 cin >> v[i];
 }
 
 vector<ll> c(n);
 rep(i, n) {
 cin >> c[i];
 }
 vector<ll> k(n);
 rep(i, n) { if(v[i]>=c[i]) {k[i] = v[i] - c[i]}
 else {k[i] = 0} }
 ll sum = 0;
 rep(i, n) {
 sum += k[i];
 }
 cout << sum << endl;
 }
   

}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:48: error: expected ';' before '}' token
   31 |  rep(i, n) { if(v[i]>=c[i]) {k[i] = v[i] - c[i]}
      |                                                ^
      |                                                ;
a.cc:32:16: error: expected ';' before '}' token
   32 |  else {k[i] = 0} }
      |                ^
      |                ;
a.cc: At global scope:
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>

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];
  }
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  int ans = INT_MIN;
  for (int i = 0; i < (1 << n) - 1; ++i) {
    int tmp = 0;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        tmp += v[j] - c[j];
      }
    }
    ans = max(ans, tmp);
  }
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'INT_MIN' was not declared in this scope
   19 |   int ans = INT_MIN;
      |             ^~~~~~~
a.cc:5:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 |
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];
    }
    for (int i = 0; i < N; i++) {
        cin >> C[i];
    }
    int sum = 0;
    for (int i = O; i < N; i++) {
        if (V[i] - C[i] > 0) {
            sum += V[i] - C[i];
        }
        else {}
    }
    cout << sum << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: 'O' was not declared in this scope
   15 |     for (int i = O; i < N; i++) {
      |                  ^
Language: Java

import java.util.*;

pubilc class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] a = new int[N];
    int[] b = new int[N];
    int ans = 0;
    
    for(int i=0;i<N;i++){
      a[i] = sc.nextInt();
    }
    for(int i=0;i<N;i++){
      b[i] = sc.nextInt();
    }
    
    for(int i=0;i<N;i++){
      if(a[i]>=b[i]){
        ans += a[i] - b[i];
      }
    }
    
    System.out.println(ans);
    
  }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
pubilc class Main{
^
1 error
Language: C++

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

int main(){
    int n,sx=0,sc=0;
    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);
    for(int i=0;i<n;i++){
        if(v.at(i)>c.at(i)){
            sv=sv+v.at(i);
            sc=sc+c.at(i);
        }
    }
    cout << sv-sc << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: 'sv' was not declared in this scope; did you mean 'v'?
   12 |             sv=sv+v.at(i);
      |             ^~
      |             v
a.cc:16:13: error: 'sv' was not declared in this scope; did you mean 'v'?
   16 |     cout << sv-sc << endl;
      |             ^~
      |             v
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

int main() {
    // Write Your Code Below
    
   ll n; cin >> n;
 vector<ll> v(n);
 rep(i, n) {
 cin >> v[i];
 }
 
 vector<ll> c(n);
 rep(i, n) {
 cin >> c[i];
 }
 vector<ll> k(n);
 if(v[i]>=c[i]) {k[i] = v[i] - c[i]}
 else {k[i] = 0}
 ll sum = 0;
 rep(i, n) {
 sum += k[i];
 }
 cout << sum << endl;
 }
   


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

#include <bits/stdc++.h>

using namespace std;

int sumDigits (int n) {
    int s;
    while (n < 0) {
        s += n % 10;
        n /= 10;
    }
    return s;
}

int main() {
   int N; cin >> N;
   int res = 0;
   vector<int> v(N);
   vector<int> C(N);
   vector(int) dif(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++) {
       dif.at(i) = v.at(i) - C.at(i);
   }
   
   for (int d : dif) {
       res += d;
   }
   cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: missing template arguments before '(' token
   19 |    vector(int) dif(N);
      |          ^
a.cc:19:11: error: expected primary-expression before 'int'
   19 |    vector(int) dif(N);
      |           ^~~
a.cc:30:8: error: 'dif' was not declared in this scope; did you mean 'div'?
   30 |        dif.at(i) = v.at(i) - C.at(i);
      |        ^~~
      |        div
a.cc:33:17: error: 'dif' was not declared in this scope; did you mean 'div'?
   33 |    for (int d : dif) {
      |                 ^~~
      |                 div
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];
  for(int i = 0;i<n;i++){
  if(v[n] % c[n] = 0){
  sum += 0;
  }else{
  sum += v[n] % c[n];
  }
  }
  cout << sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: lvalue required as left operand of assignment
   11 |   if(v[n] % c[n] = 0){
      |      ~~~~~^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a;
  cin >> a ;
  vector<int>v(a);
  vector<int>c(a);
  for(int i = 0; i < a ;i++) {
    cin >> v.at(i);
  }
  for(int i = 0; i < a ;i++) {
    cin >> c.at(i);
  }
  vector<int>s(a);
  int cou = 0;
  for(int i = 0; i < a ;i++) {
    s.at(i) = v.at(i) - c.at(i);
    if(s.at(i) > 0){
      cou += s.at(i);
  }
  cout << cou << endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:22:4: error: expected '}' at end of input
   22 |   }
      |    ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
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];
  for(int i = 0;i<n;i++){
  if(v[n] % c[n] = 0){
  sum += 0;
  }else{
  sum += v[n] % c[n];
  }
  }
  cout << sum << endl;
  return 0;
}

Compiler output:
a.cc:2:20: error: expected ';' before ':' token
    2 | using namespace std:
      |                    ^
      |                    ;
a.cc:2:20: error: expected unqualified-id before ':' token
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  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];
  vector<int> sum(N);
  int gokei = 0;
  for(int i=0;<N;i++){
    sum.at(i) = V[i] - C[i];
    if(sum.at(i) > 0) gokei += sum.at(i);
  }
  cout << gokei << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: error: expected primary-expression before '<' token
   11 |   for(int i=0;<N;i++){
      |               ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <utility>
#include <math.h>
#include <stdexcept>
#include <algorithm>
#include <vector>
#include <cstring>
#include <cassert>
#include <string.h>

using namespace std;
#define  rep(i,n) for(int i=0;i<n;i++)
#define  rrep(i,n) for(int i=n;i>0;i--)
#define  REP(i,a,b) for(int i=a;i<b;i++)
typedef long long int lld;
typedef vector<lld> vl;
typedef vector<int> vi;
typedef vector<string> vs;



//int arr[N]
////sort(arr,arr +N)

//vector <int> hoge
////sort(hoge.begin(),hoge.end());
///min_element(hoge.begin(),hoge.end();　最小値　　　最大値はmax_element();

int main() {

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


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

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

using namespace std;

int main(){
	int n,a,b,ans=0;
	vector<int> vec(n,0);
	cin >> n;
	for(int i=0,i<n,i++){
		cin >> a >> b;
		vec[i]=a-b;
		}
	sort(vec.rbegin(),vec.rend());
		
	for(int i=0,vec[i]>0,i++)ans+=vec[i];
	
		cout << ans;
	return 0; 
	
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before '<' token
   11 |         for(int i=0,i<n,i++){
      |                      ^
      |                      ;
a.cc:11:22: error: expected primary-expression before '<' token
a.cc:11:28: error: expected ';' before ')' token
   11 |         for(int i=0,i<n,i++){
      |                            ^
      |                            ;
a.cc:17:27: error: expected ';' before '>' token
   17 |         for(int i=0,vec[i]>0,i++)ans+=vec[i];
      |                           ^
      |                           ;
a.cc:17:27: error: expected primary-expression before '>' token
a.cc:17:33: error: expected ';' before ')' token
   17 |         for(int i=0,vec[i]>0,i++)ans+=vec[i];
      |                                 ^
      |                                 ;
Language: C++

#include<bits;stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  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];
  vector<int> sum(N);
  int gokei = 0;
  for(int i=0;<N;i++){
    sum.at(i) = V[i] - C[i];
    if(sum.at(i) > 0) gokei += sum.at(i);
  }
  cout << gokei << endl;
}

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>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
  int n;
  int i,j,k,ans=0;
  vector <int> v,w;
  
  cin>>n;
  for(i=0;i<n;i++){
    cin>>j;
    v.push_back(j);
  }
  for(i=o;i<n;i++){
    cin>>j;
    w.push_back(j);
  }
  for(i=0;i<n;i++){
    if(v[i]>w[i])
      ans+=v[i]-w[i];
  }
  cout<<ans<<endl;
  return 0;
}

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

import numpy as np

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

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: conflicting declaration 'std::vector<int> c'
    7 |   vector<int> v(a),c(a);
      |                    ^
a.cc:5:11: note: previous declaration as 'int c'
    5 |   int a,b,c;
      |           ^
a.cc:12:13: error: invalid types 'int[int]' for array subscript
   12 |     cin >> c[i];
      |             ^
a.cc:15:20: error: invalid types 'int[int]' for array subscript
   15 |     if (0 < (v[i]-c[i]));
      |                    ^
a.cc:16:18: error: invalid types 'int[int]' for array subscript
   16 |     b += v[i] - c[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)>>c.at(i);
  }
  
  int ans=0;
  for(int i=0;i<N;i++){
  if(v.at(i)>c.ay(i)) ans+=v.at(i)-c.at(i);
  }
  
  
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'class std::vector<int>' has no member named 'ay'; did you mean 'at'?
   14 |   if(v.at(i)>c.ay(i)) ans+=v.at(i)-c.at(i);
      |                ^~
      |                at
Language: C++

#inclide<iostream>
using namespace std;
int main()
{
  int N;
  cin >> N;
  int V[N], C[N], S[N];
  for(int i=0; i<N; i++){
    cin >> V[i] >> C[i];
  }
  for(int i=0; i<N; i++){
    S[i] = V[i] - C[i];
  }
  int m=0;
  for(int i=0; i<N; i++){
    if(S[i] >0)
      m = m + S[i];
  }
  cout << m;
  return 0;
}
   

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclide; did you mean #include?
    1 | #inclide<iostream>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   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 | #inclide<iostream>
a.cc:19:3: error: 'cout' was not declared in this scope
   19 |   cout << m;
      |   ^~~~
a.cc:19:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++


    }
    for(int i = 0; i < n; i++){
        ll a;
        cin>>a;
        A[i] = A[i] - a;
    }
    sort(A,A+n);
    reverse(A,A+n);
    ll ans = 0;
    for(int i = 0; i < n; i++){
        if(A[i] <= 0)
            break;
        ans += A[i];
    }
    cout<<ans;
    return 0;
}


Compiler output:
a.cc:2:5: error: expected declaration before '}' token
    2 |     }
      |     ^
a.cc:3:5: error: expected unqualified-id before 'for'
    3 |     for(int i = 0; i < n; i++){
      |     ^~~
a.cc:3:20: error: 'i' does not name a type
    3 |     for(int i = 0; i < n; i++){
      |                    ^
a.cc:3:27: error: 'i' does not name a type
    3 |     for(int i = 0; i < n; i++){
      |                           ^
a.cc:8:9: error: expected constructor, destructor, or type conversion before '(' token
    8 |     sort(A,A+n);
      |         ^
a.cc:9:12: error: expected constructor, destructor, or type conversion before '(' token
    9 |     reverse(A,A+n);
      |            ^
a.cc:10:5: error: 'll' does not name a type
   10 |     ll ans = 0;
      |     ^~
a.cc:11:5: error: expected unqualified-id before 'for'
   11 |     for(int i = 0; i < n; i++){
      |     ^~~
a.cc:11:20: error: 'i' does not name a type
   11 |     for(int i = 0; i < n; i++){
      |                    ^
a.cc:11:27: error: 'i' does not name a type
   11 |     for(int i = 0; i < n; i++){
      |                           ^
a.cc:16:5: error: 'cout' does not name a type
   16 |     cout<<ans;
      |     ^~~~
a.cc:17:5: error: expected unqualified-id before 'return'
   17 |     return 0;
      |     ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include <iostream>
#include <iomanip>
// std::cout << std::setprecision(2) << 3.141; // "3.1"
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;

static const int giga = pow(10,9);
// double pi = 3.141592653589793238463;

int main(void){
  int n;
  cin >> n;

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

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

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

  sort(value.begin(), value.end(), greater<int>);

  int ans = 0;
  for(int i = 0; i < n; i++){
    if(value[i] > 0){
      ans += value[i];
    } else {
      cout << ans << endl;
      return 0;
    }
  }
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:48: error: expected primary-expression before ')' token
   46 |   sort(value.begin(), value.end(), greater<int>);
      |                                                ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
    int n;
    int v[20];
    int c[20]
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&v[i]);
    }
    for(int i=0;i<n;i++){
        scanf("%d",&c[i]);
    }
    int sum=0;
    for(int i=0;i<n;i++){
        if(v[i]-c[i]>0)sum+=(v[i]-c[i]);
    }
    printf("%d\n",sum);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'scanf'
    7 |     scanf("%d",&n);
      |     ^~~~~
a.cc:12:21: error: 'c' was not declared in this scope
   12 |         scanf("%d",&c[i]);
      |                     ^
a.cc:16:17: error: 'c' was not declared in this scope
   16 |         if(v[i]-c[i]>0)sum+=(v[i]-c[i]);
      |                 ^
Language: C++

#include <iostream>

using namespace std;

int main(){
  int N,V[20],C[20],ans = 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])
      ans+= V[i] - C[i]
  }
  cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected ';' before '}' token
    9 |     cin >> V[i]
      |                ^
      |                ;
   10 |   }
      |   ~             
a.cc:12:16: error: expected ';' before '}' token
   12 |     cin >> C[i]
      |                ^
      |                ;
   13 |   }
      |   ~             
a.cc:17:24: error: expected ';' before '}' token
   17 |       ans+= V[i] - C[i]
      |                        ^
      |                        ;
   18 |   }
      |   ~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: expected ';' before '}' token
   16 | if (v[i]-c[i]>0) ans += v[i]-c[i]
      |                                  ^
      |                                  ;
   17 | }
      | ~
Language: C++

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

int v[21],c[21];

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: expected ';' before 'return'
   20 |     cout<<out<<endl
      |                    ^
      |                    ;
   21 | 
   22 |     return 0;
      |     ~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cstdio>
#include <string>
#include <stack>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <numeric>
using namespace std;

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

    for(int i = 0;i<N;i++){
        cin >> V[i];
    }
    for(int i = 0;i<N;i++){
        cin >> C[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:30:24: error: expected ';' before '}' token
   30 |     cout << ans << endl
      |                        ^
      |                        ;
......
   33 | }
      | ~
Language: Java

import java.util.*;

public class Main{

    public static void main(String args[]){

        // スキャナーの宣言
        Scanner sc = new Scanner(System.in);
        // 整数の入力
		int n = sc.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        for(int i = 0; i < n; i++){
            v[i] = sc.nextInt();
        }
        for(int i = 0; i < n; i++){
            c[i] = sc.nextInt();
        }
        int ans = 0;
        for(int i = 0; i < n; i++){
            if(v[i] - c[i] > 0){
                ans += v[i] - c;[i]
            }
        }
        // 出力
        System.out.println(ans);

    }

}

Compiler output:
Main.java:22: error: illegal start of expression
                ans += v[i] - c;[i]
                                ^
Main.java:22: error: not a statement
                ans += v[i] - c;[i]
                                 ^
Main.java:22: error: ';' expected
                ans += v[i] - c;[i]
                                  ^
3 errors
Language: C++

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

int main(){
  int n;
  cin >> n;
  int v[n];
  int c[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+=v[i]>c[i]?v[i]>c[i]:0;
  }
  cout << ans << endl;
}


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

#include <bits/stdc++.h>

using namespace std;
typedef long long LL;


int main(void) {
  int n;
  cin >> n;
  vector<int> v(n),c(n);
  for(auto &x: v) cin >> x;
  for(auto &x: c) cin >> x;
  int answer = 0;
  REP(i,n) answer += max(0, v-c);
  cout << answer << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   REP(i,n) answer += max(0, v-c);
      |       ^
a.cc:14:3: error: 'REP' was not declared in this scope
   14 |   REP(i,n) answer += max(0, v-c);
      |   ^~~
Language: Java

fimport java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int c[]=new int[n];
        int v[]=new int[n];
        
        for(int i=0;i<n;i++){
            c[i]=sc.nextInt();
        }
        
        for(int i=0;i<n;i++){
            v[i]=sc.nextInt();
        }
        int ans=0;
        for(int i=0;i<n;i++){
            ans+=(c[i]>v[i])?c[i]-v[i]:0;
        }
        System.out.println(ans);
        
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
fimport java.util.*;
^
1 error
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
using namespace std;

int main(){
  int N;
  cin>>N;
  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];
  int ans=0:
  for(int i=0; i<N; ++i){
    int a=V[i]-C[i];
    if(a>0) ans+=a;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected ',' or ';' before ':' token
   15 |   int ans=0:
      |            ^
a.cc:16:16: error: 'i' was not declared in this scope
   16 |   for(int i=0; i<N; ++i){
      |                ^
Language: C

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    vector<int> A(N),B(N);
    int sum = 0;
    rep(i,0,N)cin >> A[i];
    rep(i,0,N)cin >> B[i];
    rep(i,0,N){
        sum += max(0, A[i] - B[i]);
    }
    cout << sum << endl;
}

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define int long long
using namespace std;
signed main() {
	int n = 0; cin>> n;
	int ans = 0;
	int v[123], c[123];
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> c[i];
		ans += max(0, v[i] - c[i]);
	}cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: no matching function for call to 'max(int, long long int)'
   16 |                 ans += max(0, v[i] - c[i]);
      |                        ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   16 |                 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,
                 from a.cc:2:
/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:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   16 |                 ans += max(0, v[i] - c[i]);
      |                        ~~~^~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>

using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007



template<typename T>
class Segtree{
  public:
  using F = function<T(T,T)>;
  int n;
  F f;
  T ti;
  vector<T> dat;
  Segtree(){};
  Segtree(F f,T ti): f(f),ti(ti){}
  void init(int N){
    n = 1;
    while(n < N)n <<= 1;
    dat.assign(n << 1,ti);
  }
  void build(const vector<T> &v){
    int N = v.size();
    init(N);
    rep(i,N)dat[n+i] = v[i];
    for(int i = n-1;i >= 0;i--)dat[i] = f(dat[(i << 1)|0],dat[(i << 1)|1]);
  }
  void set(int k,T x){
    dat[k+=n] = x;
    while(k >>= 1){
      dat[k] = f(dat[(k << 1)|0],dat[(k << 1)|1]);
    }
  }
  T get(int l,int r){
    T vl = ti,vr = ti;
    for(l += n,r += n;l < r;l >>= 1,r >>= 1){
      if(l & 1)vl = f(vl,dat[l++]);
      if(r & 1)vr = f(dat[--r],vr);
    }
    return f(vl,vr);
  }
};

int main(){
  
  int n;
  cin >> n;
  vector<ll> v(n);
  rep(i,n)cin >> v[i];
  Segtree<ll> seg([](ll a,ll b){return __gcd(a,b);},0ll);
  seg.build(v);
  ll res = 0;
  rep(i,n){
    ll l = v[i];
    seg.set(i,0);
    ll k = __gcd(seg.get(0,i),seg.get(i,n));
    seg.set(i,l);
    res = max(res,k);
  }
  cout << res << "\n";
  


  return 0;
}

Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

// ----------------------
#include <atcoder/all>
// ----------------------
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
typedef long long ll;
const double pi=3.141592653589793;
typedef unsigned long long ull;
typedef long double ldouble;
const ll INF=1e18;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

// 最大公約数(ユークリッドの互除法)
// O(log max(a, b))
int gcd(int a, int_fast16_t b){
    if(b == 0) return a;
    return gcd(b, a%b);
}

int op(int a, int b) { return gcd(a, b);};

int e() {return 0;}

int target;
bool f(int v) {return v < target; };

// ----------------------
//#include <atcoder/all>　を入れたか?
// ----------------------

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n){
        cin >> a[i];
    }
    if(n == 2) {
        cout << max(a[0], a[1]) << endl;
        return 0;
    }
    segtree<int, op, e> seg(a);
    int ans = 0;
    rep(i, n) {
        int left = seg.prod(0, i);
        int right = seg.prod(i+1, n);
        chmax(ans, gcd(left, right));
    }
    cout << ans << endl;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    ll N;
    cin >> N;
    map<ll,ll> mp;
    for (ll i = 0 i < N; i++) {
        ll A;
        cin >> A;
        for (ll j = 1; j <= sqrt(A); j++) {
            if (A % j == 0) {
                mp[j]++;
                mp[A / j]++;
            }
        }
    }
    ll ans = 1;
    for (auto p : mp) {
        auto key = p.first;
        auto value = p.second;
        if (value >= N - 1) ans = key;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected ';' before 'i'
    8 |     for (ll i = 0 i < N; i++) {
      |                  ^~
      |                  ;