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

#include<bits/stdc++.h>
int main()
{
int n,i,al,bo;
  al=0;
  bo=0;
  cin >> n;
vector<int> a(n);
  for(i=0;i<n;++i)
  {
  cin >> a.at(i);
  }
sort(a.end(),a.begin());
  
  for(i=0;i<n;++i)
  {
  if(i%2==0) al=al+a.at(i);
  else bo=bo+a.at(i);
  }
cout << al-bo;
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> n;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:1: error: 'vector' was not declared in this scope
    8 | vector<int> a(n);
      | ^~~~~~
a.cc:8:1: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:8:8: error: expected primary-expression before 'int'
    8 | vector<int> a(n);
      |        ^~~
a.cc:11:10: error: 'a' was not declared in this scope; did you mean 'al'?
   11 |   cin >> a.at(i);
      |          ^
      |          al
a.cc:13:6: error: 'a' was not declared in this scope; did you mean 'al'?
   13 | sort(a.end(),a.begin());
      |      ^
      |      al
a.cc:13:1: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   13 | sort(a.end(),a.begin());
      | ^~~~
      | std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:20:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 | cout << al-bo;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

int main() {
  vector<int> s(200);
  int a=0,b=0,n;
  cin>>n;
  for(int i=0;i<n;i++) cin>>s[i];
  sort(s.begin(),s.end());
  reverse(s.begin(),s.end());
  for(int i=0;i<n;i++) {
    if(i%2==0) a+=s[i];
    else b+=s[i];
  }
  cout<<a-b<<endl;
}
  


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

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

int main() {
  vector<int> s(200);
  int a=0,b=0,n;
  cin>>n;
  for(int i=0;i<n;i++) cin>>s[i];
  s.sort(); s.reverse();
  for(int i=0;i<n;i++) {
    if(i%2==0) a+=s[i];
    else b+=s[i];
  }
  cout<<a-b<<endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'class std::vector<int>' has no member named 'sort'
    9 |   s.sort(); s.reverse();
      |     ^~~~
a.cc:9:15: error: 'class std::vector<int>' has no member named 'reverse'; did you mean 'reserve'?
    9 |   s.sort(); s.reverse();
      |               ^~~~~~~
      |               reserve
Language: C++

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

int main() {
  vector<int> s(200);
  int a=0,b=0,n;
  cin>>n;
  for(int i=0;i<n;i++) cin>>s[i];
  s.sort(); s.reverse();
  for(int i=0;i<n;i++) {
    if(i%2==0) a+=s[i];
    else b+=s[i];
  }
  cout<<a-b<<endl;
}
  

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

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

int main(){
	int N, A = 0, B = 0;
  	cin >> N;
  	vector <int> a(N);
  	for(int i = 0; i < N; i++){
    	cin >> a.at(i);
    }
  	sort(a.bigin(),a.end());
  	for(int i = 0; i < N; i++){
    	if(i % 2 == 0){
        	A += a.at(i);
        }else{
        	B += a.at(i);
        }
    }
  	cout << A - B << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
   11 |         sort(a.bigin(),a.end());
      |                ^~~~~
      |                begin
Language: C++

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

int main(){
	int N, A = 0, B = 0;
  	cin >> N;
  	vector <int> a(N);
  	for(int i = 0; i < N; i++){
    	cin >> a.at(i);
    }
  	sort(a.bigin(),a.end());
  	for(int i = 0; i < N; i++){
    	if(i % 2 == 0){
        	A += a.at(i);
        }else{
        	B += a.at(i);
        }
    }
  	cout << A - B << endl;
}


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

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

int main(){
	int N, A = 0, B = 0;
  	cin >> N;
  	vector <int> a(N);
  	for(int i = 0; i < N; i++){
    	cin >> a.at(i);
    }
  	sort(a.bigin(),a.end());
  	for(int i = 0; i < N; i++){
    	if(i % 2 == 0){
        	A += a.at(i);
        }else{
        	B += a.at(i);
        }
    }
  	cout << A - B << endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #niclude; did you mean #include?
    1 | #niclude <bits/std++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:9: 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 | #niclude <bits/std++.h>
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector <int> a(N);
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #niclude <bits/std++.h>
a.cc:7:17: error: expected primary-expression before 'int'
    7 |         vector <int> a(N);
      |                 ^~~
a.cc:9:16: error: 'a' was not declared in this scope
    9 |         cin >> a.at(i);
      |                ^
a.cc:11:14: error: 'a' was not declared in this scope
   11 |         sort(a.bigin(),a.end());
      |              ^
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |         sort(a.bigin(),a.end());
      |         ^~~~
      |         short
a.cc:19:9: error: 'cout' was not declared in this scope
   19 |         cout << A - B << endl;
      |         ^~~~
a.cc:19:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:26: error: 'endl' was not declared in this scope
   19 |         cout << A - B << endl;
      |                          ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #niclude <bits/std++.h>
Language: C++

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

int main() {
	int N;
	cin >> N;
	vector<int> a(N);
	for(int i=0;i<N;i++){
		cin >> a.at(i);
	}
	sort(a.begin(), a.end());

	int x,y;
	x=0;
	y=0;
	for(int j=0;j<N;j++){
		if(j%2==0) x+=a.at(j);
		else y+=a.at(j);
	}
	cout << x-y << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int a;
  
  int N;
   vector<int> a(N);
  cin>>a;
  for(int i=0;i<=N;i++){
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
  
    int A;
    int B;
    
    if(iN%2==0){cout<<A+=a<<endl;
              }
    else{cout<<B+=a<<endl;
        }}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: conflicting declaration 'std::vector<int> a'
    8 |    vector<int> a(N);
      |                ^
a.cc:5:6: note: previous declaration as 'int a'
    5 |  int a;
      |      ^
a.cc:11:12: error: request for member 'begin' in 'a', which is of non-class type 'int'
   11 |     sort(a.begin(), a.end());
      |            ^~~~~
a.cc:11:23: error: request for member 'end' in 'a', which is of non-class type 'int'
   11 |     sort(a.begin(), a.end());
      |                       ^~~
a.cc:12:15: error: request for member 'begin' in 'a', which is of non-class type 'int'
   12 |     reverse(a.begin(), a.end());
      |               ^~~~~
a.cc:12:26: error: request for member 'end' in 'a', which is of non-class type 'int'
   12 |     reverse(a.begin(), a.end());
      |                          ^~~
a.cc:17:8: error: 'iN' was not declared in this scope; did you mean 'i'?
   17 |     if(iN%2==0){cout<<A+=a<<endl;
      |        ^~
      |        i
a.cc:17:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   17 |     if(iN%2==0){cout<<A+=a<<endl;
      |                          ~^~~~~~
a.cc:19:20: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   19 |     else{cout<<B+=a<<endl;
      |                   ~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int a;
  
  int N;
   vector<int> a(N);
  cin>>a;
  for(int i=0;i<=N;i++){
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
  
    int A;
    int B;
    
    ifiN%2==0){cout<<A+=a<<endl;
              }
    else{cout<<B+=a<<endl;
        }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: conflicting declaration 'std::vector<int> a'
    8 |    vector<int> a(N);
      |                ^
a.cc:5:6: note: previous declaration as 'int a'
    5 |  int a;
      |      ^
a.cc:11:12: error: request for member 'begin' in 'a', which is of non-class type 'int'
   11 |     sort(a.begin(), a.end());
      |            ^~~~~
a.cc:11:23: error: request for member 'end' in 'a', which is of non-class type 'int'
   11 |     sort(a.begin(), a.end());
      |                       ^~~
a.cc:12:15: error: request for member 'begin' in 'a', which is of non-class type 'int'
   12 |     reverse(a.begin(), a.end());
      |               ^~~~~
a.cc:12:26: error: request for member 'end' in 'a', which is of non-class type 'int'
   12 |     reverse(a.begin(), a.end());
      |                          ^~~
a.cc:17:5: error: 'ifiN' was not declared in this scope
   17 |     ifiN%2==0){cout<<A+=a<<endl;
      |     ^~~~
a.cc:19:5: error: 'else' without a previous 'if'
   19 |     else{cout<<B+=a<<endl;
      |     ^~~~
a.cc:19:20: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   19 |     else{cout<<B+=a<<endl;
      |                   ~^~~~~~
a.cc:20:10: error: expected '}' at end of input
   20 |         }
      |          ^
a.cc:10:24: note: to match this '{'
   10 |   for(int i=0;i<=N;i++){
      |                        ^
a.cc:20:10: 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=0;
  
  int N;
   vector<int> a(N);
  cin>>a;
  for(int i=0;i<=N;i++){
    sort(a.begin(), a.end());
    reverse(a.begin(), a.end());
  
    int A=0;
    int B=0;
    
    ifiN%2==0){cout<<A+=a<<endl;
              }
    else{cout<<B+=a<<endl;
        }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: conflicting declaration 'std::vector<int> a'
    8 |    vector<int> a(N);
      |                ^
a.cc:5:6: note: previous declaration as 'int a'
    5 |  int a=0;
      |      ^
a.cc:11:12: error: request for member 'begin' in 'a', which is of non-class type 'int'
   11 |     sort(a.begin(), a.end());
      |            ^~~~~
a.cc:11:23: error: request for member 'end' in 'a', which is of non-class type 'int'
   11 |     sort(a.begin(), a.end());
      |                       ^~~
a.cc:12:15: error: request for member 'begin' in 'a', which is of non-class type 'int'
   12 |     reverse(a.begin(), a.end());
      |               ^~~~~
a.cc:12:26: error: request for member 'end' in 'a', which is of non-class type 'int'
   12 |     reverse(a.begin(), a.end());
      |                          ^~~
a.cc:17:5: error: 'ifiN' was not declared in this scope
   17 |     ifiN%2==0){cout<<A+=a<<endl;
      |     ^~~~
a.cc:19:5: error: 'else' without a previous 'if'
   19 |     else{cout<<B+=a<<endl;
      |     ^~~~
a.cc:19:20: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   19 |     else{cout<<B+=a<<endl;
      |                   ~^~~~~~
a.cc:20:10: error: expected '}' at end of input
   20 |         }
      |          ^
a.cc:10:24: note: to match this '{'
   10 |   for(int i=0;i<=N;i++){
      |                        ^
a.cc:20:10: error: expected '}' at end of input
   20 |         }
      |          ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <string>
#include <cmath>
sing namespace std;

int main() {
    int N;
    int a[110];  // 最大 100 個ですが余裕をもたせます
    cin >> N;
    for (int i = 0; i < N; ++i) cin >> a[i];

    sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート
    int Alice = 0;
    int Bob = 0;
    for (int i = 0; i < N; ++i) {
        if (i % 2 == 0) { // Alice のターン
            Alice += a[i];
        }
        else { // Bob のターン
            Bob += a[i];
        }
    }
    cout << Alice - Bob << endl;
}

Compiler output:
a.cc:4:1: error: 'sing' does not name a type
    4 | sing namespace std;
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |     cin >> N;
      |     ^~~
      |     std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:20: error: 'greater' was not declared in this scope; did you mean 'std::greater'?
   12 |     sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート
      |                    ^~~~~~~
      |                    std::greater
In file included from /usr/include/c++/14/string:49,
                 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:
/usr/include/c++/14/bits/stl_function.h:353:12: note: 'std::greater' declared here
  353 |     struct greater;
      |            ^~~~~~~
a.cc:12:28: error: expected primary-expression before 'int'
   12 |     sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート
      |                            ^~~
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   12 |     sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート
      |     ^~~~
      |     sqrt
a.cc:23:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |     cout << Alice - Bob << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:28: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |     cout << Alice - Bob << endl;
      |                            ^~~~
      |                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <string>
#include <cmath>
using namespace std;
 
int main() {
  int N;
  int a[110];
  cin >> N;
  for(int i=0;i<N;++i) cin >> a[i];
  sort(a,a+N,greater<int>()); //大きい順
  int Alice = 0;
  int Bob = 0;
  for(int i=0;i<N;++i){
    if(i%2==0){
      Alice += a[i];
    }
    else{
      Bob+=a[i];
    }
  }
  cout << Alice - Bob << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   11 |   sort(a,a+N,greater<int>()); //大きい順
      |   ^~~~
      |   sqrt
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int n,x,countera,counterb;
  countera = 0;
  counterb = 0;
  cin >> n;
  vector<int> vecx(0);
  for (int j = 0; j < n; j++) {
    cin >> x;
    vecx.push_back(x);
  }
  sort(vecx.begin(), vecx.end());
  reverse(vec.begin(), vec.end());
  for (int j = 0; j < n; j++) {
    if (j % 2 == 0) {
      countera = countera + vecx.at(j);
    } else {
      counterb = counterb + vecx.at(j);
    }
  }
  cout << countera - counterb << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'vec' was not declared in this scope; did you mean 'vecx'?
   14 |   reverse(vec.begin(), vec.end());
      |           ^~~
      |           vecx
Language: C++

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

int main()
{
    int n;
    int a[101];

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

    sort(a, a + N, greater<int>());
    int alice = 0;
    int bob = 0;
    for (int i = 0; i < n; i++) {
        if (i % 2 == 0) {
            alice += a[i];
        } else {
            bob += a[i];
        }
    }

    cout << alice - bob << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'N' was not declared in this scope
   15 |     sort(a, a + N, greater<int>());
      |                 ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  vector<int> card(N);
  
  for (int i = 0; i < N; i++) {
    cin >> card.at(i);
  }
  
  sort(card.begin(), card.end());
  reverse(card.begin(), card.end());
  
  bool ab = true;
  int Ap = 0;
  int Bp = 0;
  
  for (int i = 0; i < N; i++) {
    
    if (ab) {
      Ap += card.at(i)
    }
    else {
      Bp += card.at(i)
    }
  }
  
  cout << Ap - Bp << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: expected ';' before '}' token
   24 |       Ap += card.at(i)
      |                       ^
      |                       ;
   25 |     }
      |     ~                  
a.cc:27:23: error: expected ';' before '}' token
   27 |       Bp += card.at(i)
      |                       ^
      |                       ;
   28 |     }
      |     ~
Language: C++

#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int N, a[109]

int main(){
  cin >> N;
  for (int i = 0; i < N; i++){
    cin >> a[i];
  }
  sort(a, a + N, greater<int>());
  int ret = 0;
  for (int i = 0; i < N; i++){
    ret += a[i] * (i * 1 ? -1 : 1);
  }
  cout << ret << endl;
  return 0;
}


Compiler output:
a.cc:7:1: error: expected initializer before 'int'
    7 | int main(){
      | ^~~
Language: Java

import java.util.Scanner;
import java.util.Arrays;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] a = new int[n];
    int ans = 0;
    int sumAlice = 0;
    int sumBob = 0;

    for (int cnt = 0; cnt < n; cnt++) {
      a[cnt] = sc.nextInt();
    }
    Arrays.sort(a,Comparator.reverseOder());

    for (int cnt = 0; cnt < n; cnt++) {
      int tmp = a[n];
      if (cnt % 2 == 0) {
        sumAlice += tmp;
      }
      else{
        sumBob += tmp;
      }
    }
    ans = sumAlice - sumBob;
    System.out.println(ans);
    sc.close();
  }
}

Compiler output:
Main.java:16: error: cannot find symbol
    Arrays.sort(a,Comparator.reverseOder());
                  ^
  symbol:   variable Comparator
  location: class Main
1 error
Language: C++

#include<iostream>

using namespace std;

int N,a[109];
int main() {
  cin >> N;
  
  
  for(int i=0; i<N; i++); cin >>a[i];
  sort(a, a+N);
  reverse(a, a+N);

  
  int A=0, B=0;
  
  for (int i=0; i<N; i++) {
    if (a % 2== 0) {
      A += a;
    } else {
      B += a;
    }
  }
    
    cout << A-B << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: error: 'i' was not declared in this scope
   10 |   for(int i=0; i<N; i++); cin >>a[i];
      |                                   ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(a, a+N);
      |   ^~~~
      |   short
a.cc:12:3: error: 'reverse' was not declared in this scope
   12 |   reverse(a, a+N);
      |   ^~~~~~~
a.cc:18:11: error: invalid operands of types 'int [109]' and 'int' to binary 'operator%'
   18 |     if (a % 2== 0) {
      |         ~ ^ ~
      |         |   |
      |         |   int
      |         int [109]
a.cc:19:9: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   19 |       A += a;
      |       ~~^~~~
      |         |
      |         int*
a.cc:21:9: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   21 |       B += a;
      |       ~~^~~~
      |         |
      |         int*
Language: C++

#include<iostream>

using namespace std;

int main() {
  int N,a;
  cin >> N;
  
  for (int i=0; i<N; i++) {
    cin >> a;
    sort(a,a+N);
    reverse(a,a+N);
  }
  
  int A=0, B=0;
  
  for (int i=0; i>N; i++) {
    if (a % 2== 0) {
      A += a;
    } else {
      B += a;
    }
  }
    
    cout << A-B << endl;
}

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

#include<iostream>

using namespace std;


int main() {
  int N,a[110];
  cin >> N;
  
  for( int i=0; i<N; i++)  {
    cin >> a[i];
    sort(vec.begin(), vec.end());
    reverse(vec.begin(), vec.end());
  }
    
  int A=0, B=0;
  for (int i =0; i<N; i++) {
	if(i %2 ==0) {
	  A += a[i];
    } else {
      B += a[i];
    }
    }
    
   cout << A-B << endl;
  }
  
    

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

#include<iostream>

using namespace std;

int a[110];
int main() {
  int N;
  cin >> N;
  
  for( int i=0; i<N; i++)  {
    cin >> a[i];
    sort(a,a+N);
    reverse(a,a+N);
  }
    
  int A=0, B=0;
  for (int i =0; i<N; i++) {
	if(i %2 ==0) {
	  A += a[i];
    } else {
      B += a[i];
    }
    }
    
   cout << A-B << endl;
  }
  
    

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

#include <iostream>
#include <algorithm>

int main()
{
	int N;
	int a[100];
	for (int i=0; i<N; i++) std::cin >> a[i];
	std::sort(a, a+N, std::greater<int>);
	int res = 0;
	for (int i=0; i<N; i+=2) res += a[i];
	for (int i=1; i<N; i+=2) res -= a[i];
	std::cout << res << std::endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:44: error: expected primary-expression before ')' token
    9 |         std::sort(a, a+N, std::greater<int>);
      |                                            ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main() {
	int N;
	cin >> N;

	vector<int> number(N);

	for (int i = 0; i < N; i++) {
		cin >> number.at(i);
	}

	sort(number.begin(), number.end());
	reverse(number.begin(), number.end());

	int Alicep = 0;
	int Bobp = 0;

	for (int i = 0; i < N; i += 2) {
		Alicep += number.at(i);
	}
	for (int i = 1; i < N; i += 2) {
		Bobp += number.at(i);
	}

	cout << Alicep - Bobp << endl;
}

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

#include <iostream>
#include <algorithm>
using namespace std;
 
int main() {
  int Bob = 0;
  int Alice = 0;
  int cal = 0;
  int N;
  int a[100];
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  sort(a, a + N, greater<int>());
  for (int i = 0; i < N; i++) {
    if(a[i]%2 == 0){
      Alice += a[i]
    }
    else{
      Bob += a[i]
    }
  }
  cal = Alice - Bob;
  cout << cal;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> num(N);
  for(int i = 0; i < N; i++) {
    cin >> num[i];
  }
  sort(num.begin(), num.end());
  reverse(num.begin(), num.end());
  int alice = 0;
  int bob = 0;
  for (int i = 0; i < N; i++) {
    if (i % 2 == 0) {
      alice += num[i]
    } else {
      bob += num[i]
    }
  }
  cout << alice - bob << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: expected ';' before '}' token
   17 |       alice += num[i]
      |                      ^
      |                      ;
   18 |     } else {
      |     ~                 
a.cc:19:20: error: expected ';' before '}' token
   19 |       bob += num[i]
      |                    ^
      |                    ;
   20 |     }
      |     ~
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  int a,b = 0;
  for (int i = 0; i < n; i++) {
    if (i%2 == 0) {
      a += vec.(i);
    } else {
      b += vec.(i);
    }
  }
  cout << abs(a-b) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: expected unqualified-id before '(' token
   15 |       a += vec.(i);
      |                ^
a.cc:17:16: error: expected unqualified-id before '(' token
   17 |       b += vec.(i);
      |                ^
Language: C++

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

int main() {
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  sort(vec.begin(), vec.end());
  int a,b = 0;
  for (int i = 0; i < n; i++) {
    if (i%2 == 0) {
      a += vec.(i);
    } else {
      b += vec.(i);
    }
  }
  cout << abs(a-b) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   cin >> n;
      |          ^
      |          yn
a.cc:14:16: error: expected unqualified-id before '(' token
   14 |       a += vec.(i);
      |                ^
a.cc:16:16: error: expected unqualified-id before '(' token
   16 |       b += vec.(i);
      |                ^
Language: C++

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

int main() {
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  vec = sort(vec);
  int a,b = 0;
  for (int i = 0; i < n; i++) {
    if (i%2 == 0) {
      a += vec.(i);
    } else {
      b += vec.(i);
    }
  }
  cout << abs(a-b) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   cin >> n;
      |          ^
      |          yn
a.cc:10:13: error: no matching function for call to 'sort(std::vector<int>&)'
   10 |   vec = sort(vec);
      |         ~~~~^~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
a.cc:14:16: error: expected unqualified-id before '(' token
   14 |       a += vec.(i);
      |                ^
a.cc:16:16: error: expected unqualified-id before '(' token
   16 |       b += vec.(i);
      |                ^
Language: C++

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

int main() {
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  vec = sort(vec.begin(), vec.end());
  int a,b = 0;
  for (int i = 0; i < n; i++) {
    if (i%2 == 0) {
      a += vec.(i);
    } else {
      b += vec.(i);
    }
  }
  cout << abs(a-b) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   cin >> n;
      |          ^
      |          yn
a.cc:10:36: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'void')
   10 |   vec = sort(vec.begin(), vec.end());
      |                                    ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'void' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'void' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'void' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:14:16: error: expected unqualified-id before '(' token
   14 |       a += vec.(i);
      |                ^
a.cc:16:16: error: expected unqualified-id before '(' token
   16 |       b += vec.(i);
      |                ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  int sum_Alice = 0;
  int sum_Bob = 0;
  for (int i = 0; i < N; i++) {
    if (i % 2 =0) {
      sum_Alice += a.at(i);
    }
    else {
      sum_Bob += a.at(i);
    }
  }
  cout << sum_Alice - sum_Bob << endl;
}


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

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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  int sum_Alice = 0;
  int sum _Bob = 0;
  for (int i = 0; i < N; i++) {
    if (i % 2 =0) {
      sum_Alice += a.at(i);
    }
    else {
      sum_Bob += a.at(i);
    }
  }
  cout << sum_Alice - sum_Bob << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: expected initializer before '_Bob'
   14 |   int sum _Bob = 0;
      |           ^~~~
a.cc:16:11: error: lvalue required as left operand of assignment
   16 |     if (i % 2 =0) {
      |         ~~^~~
a.cc:20:7: error: 'sum_Bob' was not declared in this scope
   20 |       sum_Bob += a.at(i);
      |       ^~~~~~~
a.cc:23:23: error: 'sum_Bob' was not declared in this scope
   23 |   cout << sum_Alice - sum_Bob << endl;
      |                       ^~~~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  int Alice = 0, Bob = 0;
  for (int k = 0; k < (a.size() + 1)/2; k++) {
    Alice += a.at(2 * k);
  }
  for (int l = 0; l < a.size()/2; l++) {
    Bob += a.at(2 * k + 1);
  }
  cout << Alice - Bob << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: 'k' was not declared in this scope
   19 |     Bob += a.at(2 * k + 1);
      |                     ^
Language: C++

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

int main(){
  
  int N,a,b;
  a = 0;
  b = 0;
  cin >> N;
  
  vector<vec> vec(N);
  for(int i=0,i<N,i++){
    cin >> vec.at(i);
  }
  
  sort(vec.begin(),vec.end());
  for(int i = 0; i <vec.size();i++){
    if(i%2 != 0) vec.at(i) = (-1) * vec.at(i)
  }
  
  cout << accumulate(vec.begin(), vec.end()) << endl;
  
  
  
  
  
  
  
  
  
    




}




Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'vec' was not declared in this scope
   11 |   vector<vec> vec(N);
      |          ^~~
a.cc:11:13: error: template argument 1 is invalid
   11 |   vector<vec> vec(N);
      |             ^
a.cc:11:13: error: template argument 2 is invalid
a.cc:12:16: error: expected ';' before '<' token
   12 |   for(int i=0,i<N,i++){
      |                ^
      |                ;
a.cc:12:16: error: expected primary-expression before '<' token
a.cc:12:22: error: expected ';' before ')' token
   12 |   for(int i=0,i<N,i++){
      |                      ^
      |                      ;
Language: C++

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

int main(){
  int N;
  cin >> N;
  int a[101];
  
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  
  sort(a, a + N, greater<int>());
  
  int Alice = 0;
  int Bob = 0;
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      Alice += a[i];
    }
    
    else{
      Bob += a[i];
    }
  }
  cout << Alice - Bob << endl;
}
      
    

using namespace std;

int main(){
  int N;
  cin >> N;
  int a[101];
  
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  
  sort(a, a + N, greater<int>());
  
  int Alice = 0;
  int Bob = 0;
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      Alice += a[i];
    }
    
    else{
      Bob += a[i];
    }
  }
  cout << Alice - Bob << endl;
}
      
    


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

#include <iostream> 
using namespace std;

int main(){
  int N;
  cin >> N;
  int a[101];
  
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  
  sort(a, a + N, greater<int>());
  
  int Alice = 0;
  int Bob = 0;
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      Alice += a[i];
    }
    
    else{
      Bob += a[i];
    }
  }
  cout << Alice - Bob << endl;
}
      
    


Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(a, a + N, greater<int>());
      |   ^~~~
      |   short
Language: C++

#include <iostream> 
using namespace std;

int main(){
  int N;
  cin >> N;
  int a[101];
  
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  
  sort(a, a + N, greater<int>);
  
  int Alice = 0;
  int Bob = 0;
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      Alice += a[i];
    }
    
    else{
      Bob += a[i];
    }
  }
  cout << Alice - Bob << endl;
}
      
    


Compiler output:
a.cc: In function 'int main()':
a.cc:13:30: error: expected primary-expression before ')' token
   13 |   sort(a, a + N, greater<int>);
      |                              ^
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(a, a + N, greater<int>);
      |   ^~~~
      |   short
Language: C++

#include <iostream> 
using namespace std;

int main(){
  int N;
  cin >> N;
  int a[101];
  
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  
  sort(a, a + N; greater<int>);
  
  int Alice = 0;
  int Bob = 0;
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      Alice += a[i];
    }
    
    else{
      Bob += a[i];
    }
  }
  cout << Alice - Bob << endl;
}
      
    


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: expected ')' before ';' token
   13 |   sort(a, a + N; greater<int>);
      |       ~        ^
      |                )
a.cc:13:30: error: expected unqualified-id before ')' token
   13 |   sort(a, a + N; greater<int>);
      |                              ^
Language: C++

#include <iostream> 
using namespace std;

int main(){
  int N;
  cin >> N;
  int a[101];
  
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  
  sort(a, a + N; greater<int>());
  
  int Alice = 0;
  int Bob = 0;
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      Alice += a[i];
    }
    
    else{
      Bob += a[i];
    }
  }
  cout << Alice - Bob << endl;
}
      
    


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: expected ')' before ';' token
   13 |   sort(a, a + N; greater<int>());
      |       ~        ^
      |                )
a.cc:13:32: error: expected ';' before ')' token
   13 |   sort(a, a + N; greater<int>());
      |                                ^
      |                                ;
Language: C++

#include <iostream> 
using namespace std;

int main(){
  int N;
  cin >> N;
  int a[101];
  
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  
  sort(a, a + N; greater<int>();
  
  int Alice = 0;
  int Bob = 0;
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      Alice += a[i];
    }
    
    else{
      Bob += a[i];
    }
  }
  cout << Alice - Bob << endl;
}
      
    


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: expected ')' before ';' token
   13 |   sort(a, a + N; greater<int>();
      |       ~        ^
      |                )
Language: C++

#include <iostream> 
using namespace std;

int main(){
  int N;
  cin >> N;
  int a[101];
  
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  
  sort(a.begin(),a.end());
  reverse(a.begin,a.end());
  
  int Alice = 0;
  int Bob = 0;
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      Alice += a[i];
    }
    
    else{
      Bob += a[i];
    }
  }
  cout << Alice - Bob << endl;
}
      
    


Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: request for member 'begin' in 'a', which is of non-class type 'int [101]'
   13 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:13:20: error: request for member 'end' in 'a', which is of non-class type 'int [101]'
   13 |   sort(a.begin(),a.end());
      |                    ^~~
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(a.begin(),a.end());
      |   ^~~~
      |   short
a.cc:14:13: error: request for member 'begin' in 'a', which is of non-class type 'int [101]'
   14 |   reverse(a.begin,a.end());
      |             ^~~~~
a.cc:14:21: error: request for member 'end' in 'a', which is of non-class type 'int [101]'
   14 |   reverse(a.begin,a.end());
      |                     ^~~
a.cc:14:3: error: 'reverse' was not declared in this scope
   14 |   reverse(a.begin,a.end());
      |   ^~~~~~~
Language: C++

int <iostream> 
using namespace std;

int main(){
  int N;
  cin << N;
  int a[101];
  
  for(int i = 0; i < N; i++){
    cin >> a[i];
  }
  
  sort(a.begin(),a.end());
  reverse(a.begin,a.end());
  
  int Alice = 0;
  int Bob = 0;
  for(int i = 0; i < N; i++){
    if(i % 2 == 0){
      Alice += a[i];
    }
    
    else{
      Bob += a[i];
    }
  }
  cout << Alice - Bob << endl;
}
      
    

Compiler output:
a.cc:1:1: error: 'int' is not a template
    1 | int <iostream>
      | ^~~
a.cc:1:6: error: 'iostream' was not declared in this scope
    1 | int <iostream>
      |      ^~~~~~~~
a.cc:2:1: error: expected unqualified-id before 'using'
    2 | using namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin << N;
      |   ^~~
a.cc:13:10: error: request for member 'begin' in 'a', which is of non-class type 'int [101]'
   13 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:13:20: error: request for member 'end' in 'a', which is of non-class type 'int [101]'
   13 |   sort(a.begin(),a.end());
      |                    ^~~
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(a.begin(),a.end());
      |   ^~~~
      |   short
a.cc:14:13: error: request for member 'begin' in 'a', which is of non-class type 'int [101]'
   14 |   reverse(a.begin,a.end());
      |             ^~~~~
a.cc:14:21: error: request for member 'end' in 'a', which is of non-class type 'int [101]'
   14 |   reverse(a.begin,a.end());
      |                     ^~~
a.cc:14:3: error: 'reverse' was not declared in this scope
   14 |   reverse(a.begin,a.end());
      |   ^~~~~~~
a.cc:27:3: error: 'cout' was not declared in this scope
   27 |   cout << Alice - Bob << endl;
      |   ^~~~
a.cc:27:26: error: 'endl' was not declared in this scope
   27 |   cout << Alice - Bob << endl;
      |                          ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  int A;
  cin >> A;
  int AAA;
  vector<int> vec(A);
  rep(i, A) {
    cin >> AAA;
    vec.at(i) = AAA:
  }
  sort(vec.begin(), vec.end());
  reverce(vec.begin(), vec.end());
  int X = 0;
  for(int i = 0; int i < vec.size(); i += 2) {
    X += vec.at(i);
  }
  cout << X << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expected ';' before ':' token
   13 |     vec.at(i) = AAA:
      |                    ^
      |                    ;
a.cc:16:3: error: 'reverce' was not declared in this scope
   16 |   reverce(vec.begin(), vec.end());
      |   ^~~~~~~
a.cc:18:22: error: redeclaration of 'int i'
   18 |   for(int i = 0; int i < vec.size(); i += 2) {
      |                      ^
a.cc:18:11: note: 'int i' previously declared here
   18 |   for(int i = 0; int i < vec.size(); i += 2) {
      |           ^
a.cc:18:24: error: expected initializer before '<' token
   18 |   for(int i = 0; int i < vec.size(); i += 2) {
      |                        ^
a.cc:18:23: error: expected ';' before '<' token
   18 |   for(int i = 0; int i < vec.size(); i += 2) {
      |                       ^~
      |                       ;
a.cc:18:24: error: expected primary-expression before '<' token
   18 |   for(int i = 0; int i < vec.size(); i += 2) {
      |                        ^
a.cc:18:36: error: expected ')' before ';' token
   18 |   for(int i = 0; int i < vec.size(); i += 2) {
      |      ~                             ^
      |                                    )
a.cc:18:38: error: 'i' was not declared in this scope
   18 |   for(int i = 0; int i < vec.size(); i += 2) {
      |                                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  
  for (int i == 0; i < n; i++) cin >> a.at(i);
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  
  int alice = 0, bob = 0;
  
  for (int i = 0; i < n; i++) {
    if (i % 2 = 0) alice += a.at(i);
    else bob += a.at(i);
  }
  
  cout << alice - bob << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected ';' before '==' token
    9 |   for (int i == 0; i < n; i++) cin >> a.at(i);
      |             ^~~
      |             ;
a.cc:9:14: error: expected primary-expression before '==' token
    9 |   for (int i == 0; i < n; i++) cin >> a.at(i);
      |              ^~
a.cc:9:25: error: expected ')' before ';' token
    9 |   for (int i == 0; i < n; i++) cin >> a.at(i);
      |       ~                 ^
      |                         )
a.cc:9:27: error: 'i' was not declared in this scope
    9 |   for (int i == 0; i < n; i++) cin >> a.at(i);
      |                           ^
a.cc:16:11: error: lvalue required as left operand of assignment
   16 |     if (i % 2 = 0) alice += a.at(i);
      |         ~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  
  for (int i = 0; i < n; i++) cin >> a.at(i);
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  
  int alice = 0, bob = 0;
  
  for (int i = 0; i < n; i++) {
    if (i % 2 = 0) alice += a.at(i);
    else bob += a.at(i);
  }
  
  cout << alice - bob << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: lvalue required as left operand of assignment
   16 |     if (i % 2 = 0) alice += a.at(i);
      |         ~~^~~