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

#include <cstdio>

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

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

#include<iostream>
using namespace std;
#define FOR(n) for (int i=0;i<n;i++)
int main()
{int n;
 int a[n];
 int b[n];
  FOR(n) cin>>a[i];
  FOR(n) cin>>b[i];
for (int i=0;i<n;i++)
{
  for (int j=0;j<n-i-1;j++)
  { if (a[j]>a[j+1])
    { a[j] ^=a[j+1];
      a[j+1]^=a[j];
      a[j]^=a[j+1];
      
      b[j] ^=b[j+1];
      b[j+1]^=b[j];
      b[j]^=b[j+1];
     }
   }


}
 for (int i=0;i<n;i++)
 { if (a[i]>b[i])
     {k+=a[i];l+=b[i]; }
    else 
      continue;
  
 
 
 
 }
cout<<k-l;
return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:7: error: 'k' was not declared in this scope
   28 |      {k+=a[i];l+=b[i]; }
      |       ^
a.cc:28:15: error: 'l' was not declared in this scope
   28 |      {k+=a[i];l+=b[i]; }
      |               ^
a.cc:36:7: error: 'k' was not declared in this scope
   36 | cout<<k-l;
      |       ^
a.cc:36:9: error: 'l' was not declared in this scope
   36 | cout<<k-l;
      |         ^
Language: C++

#include<iostream>
using namespace std;
#define FOR(n) for (int i=0;i<n;i++)
int main()
{int n;
 int a[n];
 int b[n];
  FOR(n) cin>>a[i];
  FOR(n) cin>>b[i];
for (int i=0;i<n;i++)
{
  for (int j=0;j<n-i-1;j++)
  { if (a[j]>a[j+1])
    { a[j] ^=a[j+1];
      a[j+1]^=a[j];
      a[j]^=a[j+1];
      
      b[j] ^=b[j+1];
      b[j+1]^=b[j];
      b[j]^=b[j+1];
     }
   }


}
 for (int i=0;i<n;i++)
 { if (a[i]>b[i])
     {k+=a[i];l+=b[i]; }
    else 
      continue;
  
 
 
 
 }

return k-l;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:7: error: 'k' was not declared in this scope
   28 |      {k+=a[i];l+=b[i]; }
      |       ^
a.cc:28:15: error: 'l' was not declared in this scope
   28 |      {k+=a[i];l+=b[i]; }
      |               ^
a.cc:37:8: error: 'k' was not declared in this scope
   37 | return k-l;
      |        ^
a.cc:37:10: error: 'l' was not declared in this scope
   37 | return k-l;
      |          ^
Language: C++

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

int main(){
 int n;
  cin>>n;
 vector<int>a(n),b(n),c(n);
  for(int i=0;i<n;i++)cin>>a[i];
  for(int j=0;j<n;j++)cin>>b[i];
  for(int k=0;k<n;k++)c[i]=a[k]-b[k];
  sort(c.begin(),c.end());
 cout<<c[n-1]+c[n-2]; 
  
}

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

#include<iostream>
using namespace std;
#define ll long long
int main(){
  ll N,i;
  cin >> N;
  ll V[N],C[N];
  for(i=0;i<N;i++){
    cin >> V[i];
  }
  for(i=0;i<N;i++){
    cin >> C[i];
  }
  ll ans=0;
  for(i=0;i<N;i++){
    ans+=max(0,V[i]-C[i]);
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: 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:13: 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
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
#define ll long long
int main(){
  ll N,i;
  cin >> N;
  ll V[N],C[N];
  for(i=0;i<N;i++){
    cin >> V[N];
  }
  for(i=0;i<N;i++){
    cin >> C[N];
  }
  ll ans=0;
  for(i=0;i<N;i++){
    ans+=max(0,V[i]-C[i]);
  }
  cout << ans;
  return 0;
}

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

#include<iostream>
using namespace std;
#define ll long long
int main(){
  ll N,i;
  cin >> N;
  ll V[N],C[N];
  for(i=0;i<N;i++){
    cin >> V[N];
  }
  for(i=0;i<N;i++){
    cin >> C[N];
  }
  ll ans=0;
  for(i=0;i<N;i++){
    ans+=max(0,V[i]-C[i]);
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: 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:13: 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
Language: C++

#include<iostream>
using namespace std;
#define ll long long;
int main(){
  ll N,i;
  cin >> N;
  ll V[N],C[N];
  for(i=0;i<N;i++){
    cin >> V[N];
  }
  for(i=0;i<N;i++){
    cin >> C[N];
  }
  ll ans=0;
  for(i=0;i<N;i++){
    ans+=max(0,V[i]-C[i]);
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:5:3: note: in expansion of macro 'll'
    5 |   ll N,i;
      |   ^~
a.cc:5:6: error: 'N' was not declared in this scope
    5 |   ll N,i;
      |      ^
a.cc:5:8: error: 'i' was not declared in this scope
    5 |   ll N,i;
      |        ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:7:3: note: in expansion of macro 'll'
    7 |   ll V[N],C[N];
      |   ^~
a.cc:7:6: error: 'V' was not declared in this scope
    7 |   ll V[N],C[N];
      |      ^
a.cc:7:11: error: 'C' was not declared in this scope
    7 |   ll V[N],C[N];
      |           ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:14:3: note: in expansion of macro 'll'
   14 |   ll ans=0;
      |   ^~
a.cc:14:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |   ll ans=0;
      |      ^~~
      |      abs
Language: C++

#include<iostream>
using namespace std;
#define ll long long
int main(){
  ll N;
  cin >> N;
  ll V[N],C[N];
  for(i=0;i<N;i++){
    cin >> V[N];
  }
  for(i=0;i<N;i++){
    cin >> C[N];
  }
  ll ans=0;
  for(i=0;i<N;i++){
    ans+=max(0,V[i]-C[i]);
  }
  cout << ans;
  return 0;
}

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

#include<iostream>
using namespace std;
#define ll long long;
int main(){
  ll N;
  cin >> N;
  ll V[N],C[N];
  for(i=0;i<N;i++){
    cin >> V[N];
  }
  for(i=0;i<N;i++){
    cin >> C[N];
  }
  ll ans=0;
  for(i=0;i<N;i++){
    ans+=max(0,V[i]-C[i]);
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:5:3: note: in expansion of macro 'll'
    5 |   ll N;
      |   ^~
a.cc:5:6: error: 'N' was not declared in this scope
    5 |   ll N;
      |      ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:7:3: note: in expansion of macro 'll'
    7 |   ll V[N],C[N];
      |   ^~
a.cc:7:6: error: 'V' was not declared in this scope
    7 |   ll V[N],C[N];
      |      ^
a.cc:7:11: error: 'C' was not declared in this scope
    7 |   ll V[N],C[N];
      |           ^
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i<N;i++){
      |       ^
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N;i++){
      |       ^
a.cc:3:17: error: declaration does not declare anything [-fpermissive]
    3 | #define ll long long;
      |                 ^~~~
a.cc:14:3: note: in expansion of macro 'll'
   14 |   ll ans=0;
      |   ^~
a.cc:14:6: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |   ll ans=0;
      |      ^~~
      |      abs
a.cc:15:7: error: 'i' was not declared in this scope
   15 |   for(i=0;i<N;i++){
      |       ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:23: error: invalid declarator before 'V'
    6 |   int N , vector<int> V(N) , vector<int> C(N) ;
      |                       ^
a.cc:8:19: error: 'V' was not declared in this scope
    8 |   rep(i,N) cin >> V.at(i) ;
      |                   ^
a.cc:9:19: error: 'C' was not declared in this scope
    9 |   rep(i,N) cin >> C.at(i) ;
      |                   ^
a.cc:11:17: error: 'V' was not declared in this scope
   11 |   rep(i,N)  if( V.at(i) - C.at(i) >= 0 ) sum += V.at(i) - C.at(i) ;
      |                 ^
a.cc:11:27: error: 'C' was not declared in this scope
   11 |   rep(i,N)  if( V.at(i) - C.at(i) >= 0 ) sum += V.at(i) - C.at(i) ;
      |                           ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  int ans=0;
  vector<int> v(n);
  vector<int> c(n);
  for(int i=0;i<n;i++){
    int tmp;
    tmp = v.at(i) - c.at(i);
    if (tmp>0) ans+=tmp;
  }
  cout << ans << endl;
}

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);
      |   ^~~~~~
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);
      |          ^~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> c(n);
      |          ^~~
a.cc:11:11: error: 'v' was not declared in this scope
   11 |     tmp = v.at(i) - c.at(i);
      |           ^
a.cc:11:21: error: 'c' was not declared in this scope
   11 |     tmp = v.at(i) - c.at(i);
      |                     ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  int ans=0;
  vector<int> v(n);
  vector<int> c(n);
  for(int i=0;i<n;i++){
    int tmp;
    if (tmp>0) ans+=tmp;
  }
  cout << ans << endl;
}

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);
      |   ^~~~~~
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);
      |          ^~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> c(n);
      |          ^~~
Language: C++

//templates
#include <iostream>
#include <algorithm>
#include <string>
#include <numeric>
#include <vector>
#include <unordered_map>
#include <map>
#include <cmath>
#include <iomanip>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define ALL(x) (x).begin(),(x).end()
#define sort_key(struct_name,key_name) [](const struct_name &x, const struct_name &y){return x.key_name < y.key_name;}
typedef long long ll;
using namespace std;

//main
int main(){
  int N;
  cin >> N;
  vector<int> V(N);
  vector<int> C(N);
  int ans = -1000;
  vector<int> G;
  G.push_back(0);
  rep(i,N) if(V[i]-C[i]>0) G.push_back(V[i]-C[i]);
  cout << accumulate(ALL(G)) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:21: error: no matching function for call to 'accumulate(std::vector<int>::iterator, std::vector<int>::iterator)'
   27 |   cout << accumulate(ALL(G)) << endl;
      |           ~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 2 provided
Language: C++

//templates
#include <iostream>
#include <algorithm>
#include <string>
#include <numeric>
#include <vector>
#include <unordered_map>
#include <map>
#include <cmath>
#include <iomanip>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define ALL(x) (x).begin(),(x).end()
#define sort_key(struct_name,key_name) [](const struct_name &x, const struct_name &y){return x.key_name < y.key_name;}
typedef long long ll;
using namespace std;

//main
int main(){
  int N;
  cin >> N;
  vector<int> V(N);
  vector<int> C(N);
  int ans = -1000;
  vector<int> G;
  G.push_back(0)
  rep(i,N) if(V[i]-C[i]>0) G.push_back(V[i]-C[i]);
  cout << accumulate(ALL(G)) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: expected ';' before 'for'
   25 |   G.push_back(0)
      |                 ^
      |                 ;
a.cc:26:7: error: 'i' was not declared in this scope
   26 |   rep(i,N) if(V[i]-C[i]>0) G.push_back(V[i]-C[i]);
      |       ^
a.cc:11:33: note: in definition of macro 'rep'
   11 | #define rep(i,n) for(int i = 0; i < (n); i++)
      |                                 ^
a.cc:27:21: error: no matching function for call to 'accumulate(std::vector<int>::iterator, std::vector<int>::iterator)'
   27 |   cout << accumulate(ALL(G)) << endl;
      |           ~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 2 provided
Language: C++

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

int main(){
  int n;
  cin >> n;
  int vec[2][n];
  for (int i = 0 ; i < 2; i++){
  for (int j = 0; j < n; j++){
  cin >> vec[i][j];
  }
  }
  int count = 0;
  for(int i = 0; i < n; i++){
  if(vec[i][0]>=vec[i][1]){
  count += vec[i][0]-vec[i][1]
  }
  }
  cout << count;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: expected ';' before '}' token
   16 |   count += vec[i][0]-vec[i][1]
      |                               ^
      |                               ;
   17 |   }
      |   ~
Language: C

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

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

#include <iostream>
using namespace std;
int nain(){
 int N;
  cin >> N;
  int C[N];
  int V[N];
  for(int i=0;i<N;i++){
	cin >> C[i];
  }
  for(int i=0;i<N;i++){
	cin >> V[i];
  }  
  int sum=0;
  for(int i=0;i<N;i++){
	if(C[i]>V[i]){
		sum+=C[i]-V[i];
    }
  }
  cout << sum << endl;
  
  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 <iostream>
using namespace std;
int nain(){
 int N;
  cin >> N;
  int C[N];
  int V[N];
  for(int i=0;i<N;i++){
	cin >> C[i];
  }
  for(int i=0;i<N;i++){
	cin >> V[i];
  }  
  int sum=0;
  for(int i=0;i<N;i++){
	if(C[i]>V[i]){
		sum+=C[i]-V[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<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int>V(n);
	rep(i, n) {
		cin >> V[i];
	}
	vector<int>C(n);
	rep(i, n) {
		cin >> C[i];
	}
	ans = 0;
	rep(i, n) {
		if (V[i] >> C[i]) {
			ans += V[i] - C[i];
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |         ans = 0;
      |         ^~~
      |         abs
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 's' was not declared in this scope
    6 |   cin >> n, s = 0;
      |             ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> v(n), c(n), a(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++){
  	a.at(i) == v.at(i) - c.at(i);
  }
  
  int sum = 0;
  
  for(int i = 0; i < n; i++){
  	if(a.at(i) > 0){
    	sum += a.at(i);
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |   cout << ans << endl;
      |           ^~~
      |           abs
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.nxtInt();
        for(int i = 0; i < N; i++)
            c[i] = sc.nextInt();
        
        int sum = 0;

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

        System.out.println(sum);
        sc.close();
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
            v[i] = sc.nxtInt();
                     ^
  symbol:   method nxtInt()
  location: variable sc of type Scanner
1 error
Language: C++


#include<cmath>
#include<iostream>
#include<algorithm>
#include <string>
#include <stdexcept>
using namespace std; 
int main(){
  char t[4]
 long long int a,b[120],c=0,d[120],e[120]; 
 	cin >>a;
  for(int i=0;i<a;i++){
   	cin >>b[i];
  }
    for(int i=0;i<a;i++){
   	cin >>d[i];
      e[i]=d[i]-b[i];
  }
    for(int i=0;i<a;i++){
  if(e[i]>0)c+=e[i];
  }
  cout <<c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:2: error: expected initializer before 'long'
   10 |  long long int a,b[120],c=0,d[120],e[120];
      |  ^~~~
a.cc:11:15: error: 'a' was not declared in this scope
   11 |         cin >>a;
      |               ^
a.cc:13:15: error: 'b' was not declared in this scope
   13 |         cin >>b[i];
      |               ^
a.cc:16:15: error: 'd' was not declared in this scope
   16 |         cin >>d[i];
      |               ^
a.cc:17:7: error: 'e' was not declared in this scope
   17 |       e[i]=d[i]-b[i];
      |       ^
a.cc:17:17: error: 'b' was not declared in this scope
   17 |       e[i]=d[i]-b[i];
      |                 ^
a.cc:20:6: error: 'e' was not declared in this scope
   20 |   if(e[i]>0)c+=e[i];
      |      ^
a.cc:20:13: error: 'c' was not declared in this scope
   20 |   if(e[i]>0)c+=e[i];
      |             ^
a.cc:22:10: error: 'c' was not declared in this scope
   22 |   cout <<c;
      |          ^
Language: Java

import java.util.*;

class Main{
	
    public static void main(String[] args){

	Scanner sc = new Scanner(System.in);

	int N = sc.nextInt();

	int ans =0;

	int V[] =new int[N];

	int C[] =new int[N];

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

	int V [] = new int[N];

	V[i] = 	sc.nextInt();			

   }

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

	int C [] = new int[N];

	C[i] = sc.nextInt();

   }

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

	if(V[i]<C[i]){

	ans += (V[i]-C[i]);	

    }
   }	

	System.out.println(ans);
  }
 }

Compiler output:
Main.java:19: error: variable V is already defined in method main(String[])
	int V [] = new int[N];
	    ^
Main.java:27: error: variable C is already defined in method main(String[])
	int C [] = new int[N];
	    ^
2 errors
Language: C++

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

#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y
//#define CPP_STR(x) CPP_STR_I(x)
//#define CPP_STR_I(args...) #args
//#define ASSERT(expr...) assert((expr))

using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
//using f80 = __float80;
#pragma endregion

#pragma region const
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#pragma endregion

#pragma region util
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T(&)[N]) { return static_cast<i64>(N); }

template<typename T, typename U, typename Comp = less<>>
bool chmax(T& xmax, const U& x, Comp comp = {}) {
	if (comp(xmax, x)) {
		xmax = x;
		return true;
	}
	return false;
}
template<typename T, typename U, typename Comp = less<>>
bool chmin(T& xmin, const U& x, Comp comp = {}) {
	if (comp(x, xmin)) {
		xmin = x;
		return true;
	}
	return false;
}
#pragma endregion

#pragma region init
struct ProconInit {
	static constexpr int IOS_PREC = 15;
	static constexpr bool AUTOFLUSH = false;

	ProconInit() {
		cin.tie(nullptr);
		ios::sync_with_stdio(false);
		cout << fixed << setprecision(IOS_PREC);
		if (AUTOFLUSH)
			cout << unitbuf;
	}
} PROCON_INIT;
#pragma endregion

int Main()
{
	i64 N;
	cin >> N;
	vector<i64> V(N);
	for (auto& v : V)
	{
		cin >> v;
	}
	vector<i64> C(N);
	for (auto& v : C)
	{
		cin >> v;
	}

	i64 ans = 0;
	REP(i, N)
	{
		if (V[i] > C[i])
			ans += V[i] - C[i];
	}

	cout << ans << endl;
	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 <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin() , v.end()
#define inputv(v,n) rep(i,n){\
    ll x;\
    cin>>x;\
    v.push_back(x);\
    }
const ll INF=99999999999999;
const ll MOD=1000000007;
 
int main() {
  ll n;
  cin >> n;
  vl c,v;
  inputv(v,n);
  inputv(c,n);
  ll sum = 0;
  rep(i,n){
    v[i] = max(0,(v[i]-c[i]));
    sum += v[i];
  }
  cout << sum;
  
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   24 |     v[i] = 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:24:15: 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'})
   24 |     v[i] = 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:24:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |     v[i] = max(0,(v[i]-c[i]));
      |            ~~~^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin() , v.end()
#define inputv(v,n) rep(i,n){\
    ll x;\
    cin>>x;\
    v.push_back(x);\
    }
const ll INF=99999999999999;
const ll MOD=1000000007;
 
int main() {
  ll n;
  cin >> n;
  vl c,v;
  inputv(v,n);
  inputv(c,n);
  ll sum = 0;
  rep(i,n){
    v[i] = max(0,v[i]-c[i]);
    sum += v[i];
  }
  cout << sum;
  
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   24 |     v[i] = 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:24:15: 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'})
   24 |     v[i] = 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:24:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |     v[i] = max(0,v[i]-c[i]);
      |            ~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin() , v.end()
#define inputv(v,n) rep(i,n){\
    ll x;\
    cin>>x;\
    v.push_back(x);\
    }
const ll INF=99999999999999;
const ll MOD=1000000007;
 
int main() {
  ll n;
  cin >> n;
  vl c,v;
  input(v,n);
  input(c,n);
  ll sum = 0;
  rep(i,n){
    v[i] = max(0,v[i]-c[i]);
    sum += v[i];
  }
  cout << sum;
  
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:3: error: 'input' was not declared in this scope; did you mean 'inputv'?
   20 |   input(v,n);
      |   ^~~~~
      |   inputv
a.cc:24:15: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   24 |     v[i] = 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:24:15: 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'})
   24 |     v[i] = 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:24:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   24 |     v[i] = max(0,v[i]-c[i]);
      |            ~~~^~~~~~~~~~~~~
Language: Java

import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	String[] spi = new int[n];
      	int list = 0;
      	for(int i = 0; i < n; i ++){
        	v[i] = sc.nextInt();
          	cost[i] = sc.nextInt();
          	spi[i] = v[i] + "_" + cost[i];
          	list += v[i] - cost[i];
        }
      	Arrays.sort(spi);
      	for(String s : spi){
          	int value = Integer.parseInt(s.split("_")[0]);
          	int cost = Integer.parseInt(s.split("_")[1]);
        	list = Math.max(list, list - value + cost);
        }
      	System.out.print(list);
      	
    }
}

Compiler output:
Main.java:7: error: incompatible types: int[] cannot be converted to String[]
      	String[] spi = new int[n];
      	               ^
Main.java:10: error: cannot find symbol
        	v[i] = sc.nextInt();
        	^
  symbol:   variable v
  location: class Main
Main.java:11: error: cannot find symbol
          	cost[i] = sc.nextInt();
          	^
  symbol:   variable cost
  location: class Main
Main.java:12: error: cannot find symbol
          	spi[i] = v[i] + "_" + cost[i];
          	         ^
  symbol:   variable v
  location: class Main
Main.java:12: error: cannot find symbol
          	spi[i] = v[i] + "_" + cost[i];
          	                      ^
  symbol:   variable cost
  location: class Main
Main.java:13: error: cannot find symbol
          	list += v[i] - cost[i];
          	        ^
  symbol:   variable v
  location: class Main
Main.java:13: error: cannot find symbol
          	list += v[i] - cost[i];
          	               ^
  symbol:   variable cost
  location: class Main
7 errors
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      	int n = sc.nextInt();
      	String[] spi = new int[];
      	int list = 0;
      	for(int i = 0; i < n; i ++){
        	v[i] = sc.nextInt();
          	cost[i] = sc.nextInt();
          	spi[i] = v[i] + "_" + cost[i];
          	list += v[i] - cost[i];
        }
      	Arrays.sort(spi);
      	for(String s : spi){
          	int value = Integer.parseInt(s.split("_")[0]);
          	int cost = Integer.parseInt(s.split("_")[1]);
        	list = Math.max(list, list - value + cost);
        }
      	System.out.print(list);
      	
    }
}

Compiler output:
Main.java:7: error: array dimension missing
      	String[] spi = new int[];
      	                        ^
1 error
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'i' was not declared in this scope
    9 |   rep(i,n)cin>>v[i];
      |                  ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'i' was not declared in this scope
    9 |   rep(i,n)cin>>v[i]
      |                  ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before 'for'
    9 |   rep(i,n)cin>>v[i]
      |                    ^
      |                    ;
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   rep(i,n)cin>>c[i];
      |       ^
a.cc:2:32: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i = 0;i<n;i++)
      |                                ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before 'for'
    9 |   rep(i,n)cin>>v[i]
      |                    ^
      |                    ;
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   rep(i,n)cin>>c[i];
      |       ^
a.cc:2:32: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i = 0;i<n;i++)
      |                                ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected ';' before 'for'
    9 |   rep(i,n)cin>>v[i]
      |                    ^
      |                    ;
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   rep(i,n)cin>>c[i];
      |       ^
a.cc:2:32: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i = 0;i<n;i++)
      |                                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  int a,d=0;
  cin>>a;
  vector<int> b(a),c(a);
  fo(i,a)
    cin>>b[i];
  fo(i,a)
    cin>>c[i];
  for(int i=0;i<a;i++)
    d+=max(0,b[i]-c[i]);
  cout<<d<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:66:11: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   66 |     d+=max(0,b[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:66:11: 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'})
   66 |     d+=max(0,b[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:66:11: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   66 |     d+=max(0,b[i]-c[i]);
      |        ~~~^~~~~~~~~~~~~
Language: C++

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


Compiler output:
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

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


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

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

bool acgt(char ch)
{
  char atgc[]="ACGT";
  for(int j=0 ; j<4 ; ++j)
  {
      if(ch==atgc[j])
      {
        return true;
      }
  }
  return false;
}

int main()
{
	int n;
  	cin>>n;
  	int ans=0;
  	vector<int> values(n);
  	for(int i=0 ; i<n ; ++i)
    cin>>values[i];
  	int cost;
  	for(int j=0 ; j<n ; ++j)
    {
    	cin>>cost;
  		ans+=max(values[i]-cost,0);
    }
  	cout<<ans<<endl;
  	
  	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:33: error: 'i' was not declared in this scope
   29 |                 ans+=max(values[i]-cost,0);
      |                                 ^
Language: C++

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

int main(){
  int N;
  int ans=0,cst=0;
  cin >> N ;
  vector<int> vl(N);
  for(int i = 0;i <N ;i++){
    cin >> vl[i];
  }
  for(int i  0;i<N; i++){
    cin>>cst;
    if ((vl[i] - cst) > 0){
      ans += vl[i] - cst;
    }
  }
  cout << ans << endl; 
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected ';' before numeric constant
   13 |   for(int i  0;i<N; i++){
      |            ^ ~
      |            ;
a.cc:13:19: error: expected ')' before ';' token
   13 |   for(int i  0;i<N; i++){
      |      ~            ^
      |                   )
a.cc:13:21: error: 'i' was not declared in this scope
   13 |   for(int i  0;i<N; i++){
      |                     ^
Language: C++

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: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

//おまじない
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  
  int n;
  cin>>n;
  
  vector<int> 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 sum=0;
  
  for(int i=0;i<n;i++){
    int d = v.at(i)-c.at(i);
    if(d>0){
      s+=d;}}
  
  cout<<sum<<endl;}

  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: 's' was not declared in this scope
   24 |       s+=d;}}
      |       ^