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

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<60;
 
int main() {
	ll N;
  	cin >> N;
  	ll ans = 0;
  	vector<ll> L(N);
  	rep(i,N){
      cin >> L[i];
    }
  	sort(all(N));
  	rep(i,N-1){
      ans += min(L[i],L[i+1]);
    }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:20: error: request for member 'begin' in 'N', which is of non-class type 'll' {aka 'long long int'}
    2 | #define all(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:29:14: note: in expansion of macro 'all'
   29 |         sort(all(N));
      |              ^~~
a.cc:2:32: error: request for member 'end' in 'N', which is of non-class type 'll' {aka 'long long int'}
    2 | #define all(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:29:14: note: in expansion of macro 'all'
   29 |         sort(all(N));
      |              ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  int a[2*N];
  for(int i = 0;i<2*N;i++){
    cin >> a[i];
  }
  sort(a.begin(),a.end());
  int ans = 0;
  for(int i = 0;i<N;i++){
    ans = ans + a[i*2];
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: request for member 'begin' in 'a', which is of non-class type 'int [(N * 2)]'
   10 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:10:20: error: request for member 'end' in 'a', which is of non-class type 'int [(N * 2)]'
   10 |   sort(a.begin(),a.end());
      |                    ^~~
Language: C++

#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;

int main() {
int n;
  cin>>n;
  int k[2*n];
  for(int i=0;i<2*n;i++)
    cin>>k[i];
  
  sort(k;k+2*n);
  
  int res=0;
  for(int i=0;i<=2*n;i+=2){
    res+=k[i];}
  
  cout<<res<<endl;
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: expected ')' before ';' token
   14 |   sort(k;k+2*n);
      |       ~ ^
      |         )
a.cc:14:15: error: expected ';' before ')' token
   14 |   sort(k;k+2*n);
      |               ^
      |               ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i=0;i<m;i++)
int main(){
  int n; cin>>n;
  vector<int> length(2*n);
  int i,ans=0;
  rep(i,2*n){cin>>length[i];}
  sort(length.begin(),length.end());
  rep(i,2*n){if(i%2==1){ans+=length[i];}}
  return 0;            
}
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:3:28: error: 'm' was not declared in this scope
    3 | #define rep(i,n) for(i=0;i<m;i++)
      |                            ^
a.cc:8:3: note: in expansion of macro 'rep'
    8 |   rep(i,2*n){cin>>length[i];}
      |   ^~~
a.cc:3:28: error: 'm' was not declared in this scope
    3 | #define rep(i,n) for(i=0;i<m;i++)
      |                            ^
a.cc:10:3: note: in expansion of macro 'rep'
   10 |   rep(i,2*n){if(i%2==1){ans+=length[i];}}
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(i=0;i<m;i++)
int main(){
  int n; cin>>n;
  vector<int> length(2n);
  int i,ans=0;
  rep(i,2n){cin>>length[i];}
  sort(length.begin(),length.end());
  rep(i,2n){if(i%2==1){ans+=length[i];}}
  return 0;
    
            
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: unable to find numeric literal operator 'operator""n'
    6 |   vector<int> length(2n);
      |                      ^~
a.cc:3:28: error: 'm' was not declared in this scope
    3 | #define rep(i,n) for(i=0;i<m;i++)
      |                            ^
a.cc:8:3: note: in expansion of macro 'rep'
    8 |   rep(i,2n){cin>>length[i];}
      |   ^~~
a.cc:3:28: error: 'm' was not declared in this scope
    3 | #define rep(i,n) for(i=0;i<m;i++)
      |                            ^
a.cc:10:3: note: in expansion of macro 'rep'
   10 |   rep(i,2n){if(i%2==1){ans+=length[i];}}
      |   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[200005];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=2*n;i++) scanf("%d",&a[i]);
    sort(a+1,a+1+2*n);
    for(int i=1;i<=2*n;i+=2) ans+=min(a[i],a[i+1]);
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |     for(int i=1;i<=2*n;i+=2) ans+=min(a[i],a[i+1]);
      |                              ^~~
      |                              abs
a.cc:11:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C++

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

int main(){
  int n,l[1000],v=0;
  cin >> n;
  n*=2;
  for(int i=0;i<n;i++){
    cin >> l[i];
  }
  sort(l,l+n,greater<int>);
  for(int i=0;i<n;i++){
    if(i%2==1){
      v+=l[i];
    }
  }

  cout << v << endl;
  
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:11:26: error: expected primary-expression before ')' token
   11 |   sort(l,l+n,greater<int>);
      |                          ^
Language: C++

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

int main(){
	int n;
	cin>>n;
	int a=0;
	vector<int> s(2*n);
	for(int i=0;i<2*n;i++){
		cin>>s[i];
	}
	sort(s.begin(),s.end());
	for(int i=0;i<2*n;i+=2;){
		a+=min(s[i],s[i+1]);
	}
	cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: expected ')' before ';' token
   13 |         for(int i=0;i<2*n;i+=2;){
      |            ~                  ^
      |                               )
a.cc:13:32: error: expected primary-expression before ')' token
   13 |         for(int i=0;i<2*n;i+=2;){
      |                                ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
int N;
int main(){
  cin >> N;
  int kusi[n*2];
  for(int i=0;i!=2*N;i++){
    cin >> kusi[i];
  }
  sort(kusi,kusi+(2*N),greater<int>());
  int ans=0;
  for(int i=0;i!=N*2;i+=2){
    ans+=kusi[i+1];
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'n' was not declared in this scope
    7 |   int kusi[n*2];
      |            ^
a.cc:9:12: error: 'kusi' was not declared in this scope
    9 |     cin >> kusi[i];
      |            ^~~~
a.cc:11:8: error: 'kusi' was not declared in this scope
   11 |   sort(kusi,kusi+(2*N),greater<int>());
      |        ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;
int N;
int kusi[102];
int main(){
  cin >> N;
  for(int i=0;i!=2*N;i++){
    cin >> kusi[i];
  }
  sort(kusi,kusi+2*N;
  int ans=0;
  for(int i=0;i!=N;i++){
    ans+=kusi[2*i];
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: expected ')' before ';' token
   11 |   sort(kusi,kusi+2*N;
      |       ~             ^
      |                     )
Language: C++

#include<bits/stdc++.h>

using namespace std;
int N;
vector<int> kusi;
int main(){
  cin >> N;
  for(int i=0;i!=2N;i++){
    cin >> kusi.at(i);
  }
  sort(kusi.begin(),kusi.end());
  int ans=0;
  for(int i=0;i!=N;i++){
    ans+=kusi.at(2*i);
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: unable to find numeric literal operator 'operator""N'
    8 |   for(int i=0;i!=2N;i++){
      |                  ^~
Language: C++

#include<bits/stdc++>

using namespace std;
int N;
vector<int> kusi;
int main(){
  cin >> N;
  for(int i=0;i!=2N;i++){
    cin >> kusi.at(i);
  }
  sort(kusi.begin(),kusi.end());
  int ans=0;
  for(int i=0;i!=N;i++){
    ans+=kusi.at(2*i);
  }
  cout << ans << endl;
}


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

int main(){
	int N,tmp,cnt;
	int L[100];
	int i,p,q;

	scanf("%d", &N);
	


	for( i=0; i<N*2; i++ ){
		scanf("%d ",&L[i]);
	}

	//降順ソート
	for( p = 0; p < N*2; p++){
		for(q = p + 1; q < (N*2)+1; q++){
			if(L[p] < L[q]){
				tmp = L[p];
				L[p] = <[q];
				L[q] = tmp;
			}
		}
	}

	//最大数の和を求める
	for( i= 0; i<N*2; i++ ){
		cnt += L[i+1];
	}

	printf("%d",cnt);

	return 0;
}




Compiler output:
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 |         scanf("%d", &N);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 |         scanf("%d", &N);
      |         ^~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:19:40: error: expected expression before '<' token
   19 |                                 L[p] = <[q];
      |                                        ^
main.c:30:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   30 |         printf("%d",cnt);
      |         ^~~~~~
main.c:30:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:30:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:30:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

int main(){
	int N,tmp,cnt;
	int L[100];
	int i,p,q

	scanf("%d", &N)
	


	for( i=0; i<N*2; i++ ){
		scanf("%d ",&L[i]);
	}

	//降順ソート
	for( p = 0; p < N*2; p++){
		for(q = p + 1; q < (N*2)+1; q++){
			if(L[p] < L[q]){
				tmp = L[p];
				L[p] = <[q];
				L[q] = tmp;
			}
		}
	}

	//最大数の和を求める
	for( i= 0; i<N*2; i++ ){
		cnt += L[i+1];
	}

	printf("%d",cnt);

	return 0;
}




Compiler output:
main.c: In function 'main':
main.c:6:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
    6 |         scanf("%d", &N)
      |         ^~~~~
main.c:10:29: error: expected ';' before ')' token
   10 |         for( i=0; i<N*2; i++ ){
      |                             ^~
      |                             ;
main.c:10:30: error: expected statement before ')' token
   10 |         for( i=0; i<N*2; i++ ){
      |                              ^
main.c:11:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |                 scanf("%d ",&L[i]);
      |                 ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(){
main.c:11:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |                 scanf("%d ",&L[i]);
      |                 ^~~~~
main.c:11:17: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:16:21: error: 'q' undeclared (first use in this function)
   16 |                 for(q = p + 1; q < (N*2)+1; q++){
      |                     ^
main.c:16:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:40: error: expected expression before '<' token
   19 |                                 L[p] = <[q];
      |                                        ^
main.c:30:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   30 |         printf("%d",cnt);
      |         ^~~~~~
main.c:30:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:30:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:30:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>

int main(){
	int N,tmp,cnt
	int L[100];

	scanf("%d", &N)

	for( int i=0; i<N*2; i++ ){
		scanf("%d ",&L[i]);
	}

	//降順ソート
	for(int p = 0; p < N*2; p++){
		for(int q = p + 1; q < (N*2)+1; q++){
			if(L[p] < L[q]){
				tmp = L[p];
				L[p] = <[q];
				L[q] = tmp;
			}
		}
	}

	//最大数の和を求める
	for( int i= 0; i<N*2; i++ ){
		cnt += L[i+1];
	}

	printf("%d",cnt);

	return 0;
}




Compiler output:
main.c: In function 'main':
main.c:5:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
    5 |         int L[100];
      |         ^~~
main.c:7:24: error: expected ';' before 'for'
    7 |         scanf("%d", &N)
      |                        ^
      |                        ;
    8 | 
    9 |         for( int i=0; i<N*2; i++ ){
      |         ~~~
Language: C

#include <stdio.h>

void main()
{int a[200],length,result,error,n2;

error=scanf("%d",&length);
n2=length*2;
for (i=0;i++;i<n2) error=scanf("%d",&a[i]);

for(int i=0;i<n2;i++)
	{
      	for(int j=n2-1;j>i;j--)
		{
		if(a[j]<a[j-1])
			{
			  int t=a[j];
			  a[j]=a[j-1];
			  a[j-1]=t;
			}
	      }
	}

for(result=0,i=0;i<n2;i=i+2)
	result=result+a[i];

printf( "%d", result );
}


Compiler output:
main.c: In function 'main':
main.c:8:6: error: 'i' undeclared (first use in this function)
    8 | for (i=0;i++;i<n2) error=scanf("%d",&a[i]);
      |      ^
main.c:8:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

void main()
{int i,j,a[100],length,result,error,scanf(),printf();

error=scanf("%d",&length);

for (i=0;i++;i<100) error=scanf("%d",&a[i]);

for(int i=0;i<length-1;i++)
	{
      	for(int j=length-1;j>i;j--)
		{
		if(a[j]<a[j-1])
			{
			  int t=a[j];
			  a[j]=a[j-1];
			  a[j-1]=t;
			}
	      }
	}

for(int i=0;i<length;i=i+2)
	result=result+a[i];

printf( "%d", result );
}


Compiler output:
main.c: In function 'main':
main.c:4:37: error: conflicting types for 'scanf'; have 'int()'
    4 | {int i,j,a[100],length,result,error,scanf(),printf();
      |                                     ^~~~~
main.c:4:1: note: a parameter list with an ellipsis cannot match an empty parameter name list declaration
    4 | {int i,j,a[100],length,result,error,scanf(),printf();
      | ^
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:28,
                 from main.c:1:
/usr/include/stdio.h:466:12: note: previous declaration of 'scanf' with type 'int(const char *, ...)'
  466 | extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
      |            ^~~~~~~~~~
main.c:4:45: error: conflicting types for 'printf'; have 'int()'
    4 | {int i,j,a[100],length,result,error,scanf(),printf();
      |                                             ^~~~~~
main.c:4:1: note: a parameter list with an ellipsis cannot match an empty parameter name list declaration
    4 | {int i,j,a[100],length,result,error,scanf(),printf();
      | ^
/usr/include/stdio.h:363:12: note: previous declaration of 'printf' with type 'int(const char *, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |            ^~~~~~
Language: Java

import java.util.*;

public class Main {
  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String line = sc.nextLine();
    
    // Nを取り出す
    int N = Integer.parseInt(line);
    
    // L1... を取り出す
    line = sc.nextLine();
    String[] l1l2 = line.split(" ");
    List<Integer> kusi = new ArrayList<>();
    
    for(int i = 0; i < l1l2.length; i++ ) {
      kusi.add(Integer.parseInt(l1l2[i]);
    }
    
    Collections.sort(kusi);
    
    calc(kusi);
  }
  
  // 計算する
  public static calc(List<integer> list) {
    int total = 0;
    for(int i = 0; i < list.size(); i=i+2) {
      total += list.get(i);
    }
    
    System.out.println(total);
  }
}

Compiler output:
Main.java:18: error: ')' or ',' expected
      kusi.add(Integer.parseInt(l1l2[i]);
                                        ^
Main.java:27: error: invalid method declaration; return type required
  public static calc(List<integer> list) {
                ^
2 errors
Language: C

#include <stdio.h>

main()
{int a[100],length;

scanf("%d",length);

for (i=0;i++;i<100) scanf("%d",&a[i]);

for(int i=0;i<length-1;i++)
	{
      for(int j=a.length-1;j>i;j--){
	if(a[j]<a[j-1]){
	  int t=a[j];
	  a[j]=a[j-1];
	  a[j-1]=t;
	}
      }


for(int i=0;i<length;i=i+2)
	result=result+a[i];

printf( "\n", result );
}

Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main()
      | ^~~~
main.c: In function 'main':
main.c:8:6: error: 'i' undeclared (first use in this function)
    8 | for (i=0;i++;i<100) scanf("%d",&a[i]);
      |      ^
main.c:8:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:18: error: request for member 'length' in something not a structure or union
   12 |       for(int j=a.length-1;j>i;j--){
      |                  ^
main.c:22:9: error: 'result' undeclared (first use in this function)
   22 |         result=result+a[i];
      |         ^~~~~~
main.c:25:1: error: expected declaration or statement at end of input
   25 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int arr[205];

int main()
{
	int n;
	int res=0;
scanf("%d",&n);

		int m=2*n;
	for(int i=1;i<=m;i++)
	{
		scanf("%d",&arr[i]);
	}
	sort(arr+1,arr+m+1);
	int k;
	for(int j=1;j<=m;j=j+2)
	{
		k=arr[j];
		
		res=res+k;
		
	}
	
	printf("%d\n",res);
	

}
 

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

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

int main() {
    int N;
    cin >> N;
    N *= 2;
    vector<int> L(N);
    for (int i = 0; i < N; i++) {
            cin >> L[i];
        }
    }

    sort(L.begin(), L.end());
    int ans = 0;
    for (int i = 0; i < N; i += 2) {
        ans += L[i];
    }
    cout << ans << endl;
}

Compiler output:
a.cc:14:9: error: expected constructor, destructor, or type conversion before '(' token
   14 |     sort(L.begin(), L.end());
      |         ^
a.cc:16:5: error: expected unqualified-id before 'for'
   16 |     for (int i = 0; i < N; i += 2) {
      |     ^~~
a.cc:16:21: error: 'i' does not name a type
   16 |     for (int i = 0; i < N; i += 2) {
      |                     ^
a.cc:16:28: error: 'i' does not name a type
   16 |     for (int i = 0; i < N; i += 2) {
      |                            ^
a.cc:19:5: error: 'cout' does not name a type
   19 |     cout << ans << endl;
      |     ^~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

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

int main() {
    int N;
    cin >> N;
    N *= 2;
    vector<int> L(N) {
        for (int i = 0; i < N; i++) {
            cin >> L[i];
        }
    }

    sort(L.begin(), L.end());
    int ans = 0;
    for (int i = 0; i < N; i += 2) {
        ans += L[i];
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ',' or ';' before '{' token
    8 |     vector<int> L(N) {
      |                      ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int a[110];
int main(){
  int a,k;
  cin>>a;
  int b=a*2
  for(int i=0;i<b;i++){
    cin>>a[i];
    sort(a,a+b);
  }
  for(int i=0;i<a+1;i++){
    k+=a[i*2];
  }
  cout<<k<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'for'
    9 |   for(int i=0;i<b;i++){
      |   ^~~
a.cc:9:15: error: 'i' was not declared in this scope
    9 |   for(int i=0;i<b;i++){
      |               ^
a.cc:14:9: error: invalid types 'int[int]' for array subscript
   14 |     k+=a[i*2];
      |         ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int a[110];
int main(){
  int a,k;
  cin>>a;
  int b=a*2
  for(int i=0;i<b;i++){
    cin>>a[i];
    sort(a,a+b);
  }
  for(int i=0;i<a+1;i++){
    k+=a[i*2;
  }
  cout<<k<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected ',' or ';' before 'for'
    9 |   for(int i=0;i<b;i++){
      |   ^~~
a.cc:9:15: error: 'i' was not declared in this scope
    9 |   for(int i=0;i<b;i++){
      |               ^
a.cc:14:13: error: expected ']' before ';' token
   14 |     k+=a[i*2;
      |             ^
      |             ]
a.cc:14:9: error: invalid types 'int[int]' for array subscript
   14 |     k+=a[i*2;
      |         ^
Language: C

#include<stdio.h>
#include<stdlib.h>
///*
void sort_N(int *x,int n);

int main() {

	int i, n, *ary;
	int counter=0;

	scanf("%d", &n);

	ary = (int*)calloc(2 * n, sizeof(int));
	if (ary == NULL) {
		return 0;
	}

	for (i = 0; i < 2 * n; i++) {
		scanf_s("%d", &ary[i]);
	}

	sort_N(ary, 2 * n);

	for (i = 0; i < n; i++) {
		counter += ary[2 * i];
	}

	for (i = 0; i < 2 * n; i++) {
		printf("%d ", ary[i]);
	}
	printf("\n");

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

	free(ary);

	return 0;
}

void sort_N(int *x,int n) {

	int i,j,fake;
	
	for (i = 0; i < n - 1; i++) {
		for (j = 0; j < n - 1;j++){
			if (x[j] > x[j + 1]) {
				fake = x[j];
				x[j] = x[j + 1];
				x[j + 1] = fake;
			}
		}
	}
}
//*/

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

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

void sort_N(int *x,int n);

int main() {

	int i, n, *ary;
	int counter=0;

	scanf_s("%d", &n);

	ary = (int*)calloc(2 * n, sizeof(int));
	if (ary == NULL) {
		return 0;
	}

	for (i = 0; i < 2 * n; i++) {
		scanf_s("%d", &ary[i]);
	}

	sort_N(ary, 2 * n);

	for (i = 0; i < n; i++) {
		counter += ary[2 * i];
	}

	for (i = 0; i < 2 * n; i++) {
		printf("%d ", ary[i]);
	}
	printf("\n");

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

	free(ary);

	return 0;
}

void sort_N(int *x,int n) {

	int i,j,fake;
	
	for (i = 0; i < n - 1; i++) {
		for (j = 0; j < n - 1;j++){
			if (x[j] > x[j + 1]) {
				fake = x[j];
				x[j] = x[j + 1];
				x[j + 1] = fake;
			}
		}
	}
}

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

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<cstring>
using namespace std;
int mian()
{
	int n,a[100001],s=0;
	cin>>n;
	for(int i=0;i<2*n;i++)
	cin>>a[i];
	sort(a,a+2*n);
	for(int i=0;i<2*n;i+=2)
	s+=a[i];
	cout<<s;
}

Compiler output:
a.cc: In function 'int mian()':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <stdio.h>
#include <algorithm>
using namespace std;

int l[300];

int main () {
	int n;
	cin >> n;
	for (int i = 0; i < 2 * n; ++i) {
		cin >> l[i];
	}
	sort(l, l + 2 * n);
	int sum = 0;
	for (int i = 0; i < 2 * n; i += 2) {
		sum += l[i];
	}
	cout << sum << endl;
	return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin >> n;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << sum << endl;
      |         ^~~~
a.cc:18:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:24: error: 'endl' was not declared in this scope
   18 |         cout << sum << endl;
      |                        ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <algorithm>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

#include <iostream>

using namespace std;
int main(int argc, char *argv[]) {
	int used,n,l[300],max,res = 0;
	cin >> n;
	for(int i = 0; i < n*2; i++) cin >> l[i];a
	for(int j = 0; j < n*2; j++){
		max = 0;
		for(int i = 0; i < n*2; i++){
			if(l[i] > max){
				max = l[i];
				used = i;
			}
		}
		if((j+1) % 2 == 0) res += max;
		l[used] = -1;
	}
	cout << res << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:7:50: error: 'a' was not declared in this scope
    7 |         for(int i = 0; i < n*2; i++) cin >> l[i];a
      |                                                  ^
a.cc:8:24: error: 'j' was not declared in this scope
    8 |         for(int j = 0; j < n*2; j++){
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n,x;
ll get(ll x,ll y){
	ll a=min(x,y),b=max(x,y);
	if (a==0)return -b;
	return get(a,b%a)+2*a*(b/a);
}
signed main(){
	scanf("%lld%lld",&n,&x);
	prllf("%lld\n",get(x,n-x)+n);
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'prllf' was not declared in this scope
   12 |         prllf("%lld\n",get(x,n-x)+n);
      |         ^~~~~
Language: C

#include<stdio.h>
int fact(int n);
int main()
{
int n,i,j,sum=0;
scanf("%d",&n);
int a[n],b[n];
for(int i=0;i<n;i++)
{
scanf("%d%d",&a[i],&b[i]);
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
sum+=fact((a[i]+b[i]+a[j]+b[j]),a[i]+b[i]);
}
}
printf("%d",sum);
return 0;
}
int fact(int n,int r)
{
if(n==r)
return 1;
else if(r==1)
return n;
else
return (fact(n-1,r)+fact(n-1,r-1));
}

Compiler output:
main.c: In function 'main':
main.c:16:6: error: too many arguments to function 'fact'
   16 | sum+=fact((a[i]+b[i]+a[j]+b[j]),a[i]+b[i]);
      |      ^~~~
main.c:2:5: note: declared here
    2 | int fact(int n);
      |     ^~~~
main.c: At top level:
main.c:22:5: error: conflicting types for 'fact'; have 'int(int,  int)'
   22 | int fact(int n,int r)
      |     ^~~~
main.c:2:5: note: previous declaration of 'fact' with type 'int(int)'
    2 | int fact(int n);
      |     ^~~~
Language: C

#include<stdio.h>
int main()
{
int n,temp,sum=0;
scanf("%d",&n);
int l[2*n];
for(int i=0;i<2*n;i++)
{ 
   scanf("%d",&l[i]);
} 
    for(int i=0;i<2*n;i++)
    {
     for(int j=0;j<(2*n-i-1);j++)
      {
       if(l[j]>l[j+1]
         {
          temp=l[j];
          l[j]=l[j+1];
          l[j+1]=temp;
          }
         }
     } 
for(int i=0;i<2*n;i=i+2)
{
 sum=sum+l[i];
} 
printf("%d",sum);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:22: error: expected ')' before '{' token
   15 |        if(l[j]>l[j+1]
      |          ~           ^
      |                      )
   16 |          {
      |          ~            
main.c:21:10: error: expected expression before '}' token
   21 |          }
      |          ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, x;
    cin >> n >> x;
    cout << 3 * (n - _gcd(n, x))<< '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: '_gcd' was not declared in this scope
    8 |     cout << 3 * (n - _gcd(n, x))<< '\n';
      |                      ^~~~
Language: C++

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

struct node{
	char name[30];
	long num;
	struct node *next;};

typedef struct node NODE;
NODE *start, *end, *gnode();

void menu(void)
{
	printf("\n\n");
	printf("\e[10C    Load Data ==> .L\n");
    printf("\e[10C  Find Data ==> .F\n");
	printf("\e[10C         Quit ==> .Q\n");
	printf("\e[12C");
	printf("Enter Command >>");
}

NODE *gnode()
{
	NODE *p;
	p = malloc(sizeof(NODE));
	if (p == NULL )
		printf("Not enouph memry\n");
	return p;
}

void printlist()
{
	NODE *p;
	printf("\n\nContents:\n\n");
	p = start;
	while (p != end){
		printf("%8ld %-40s %p\n", p->num, p->name, p->next);
		p = p->next;
	} 

	menu();
}


void loadlist()
{
	NODE *p;
	char str[100];
	printf("\e[12C =>");
	scanf("%s",str);
	p=end;
    end=gnode();
    p->next=end;
    strcpy(p->name,str);
    menu();
}

void finddata(){
  printf("\e[12C =>");
  char str[100];
  scanf("%s",str);
}

void bye(void)
{
    printf("\e[0m");
	exit(0);
}

void main()
{
	char str[100];
	int  ch;
	long ii;
	int  indic, found;
	NODE *p;

	printf("\e[2J");
	printf("\e[1m\e[33m");

	menu();

	start = gnode();
	end = start;

	while(1){
		scanf("%s",str);
		if (str[0] == '.')
			switch (toupper(str[1])){
				case 'L':  loadlist();			break;
		    case 'F':  finddata();      break;
				case 'Q':  bye();
				default :  printf("\nWrong command use L, F or Q\n");
			}
	}
}

Compiler output:
a.cc: In function 'NODE* gnode()':
a.cc:27:19: error: invalid conversion from 'void*' to 'NODE*' {aka 'node*'} [-fpermissive]
   27 |         p = malloc(sizeof(NODE));
      |             ~~~~~~^~~~~~~~~~~~~~
      |                   |
      |                   void*
a.cc: At global scope:
a.cc:72:1: error: '::main' must return 'int'
   72 | void main()
      | ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <thread>
#include <chrono>
#include <queue>
#include <set>

using namespace std;

double temp(int t, int x){
	return t - (x*0.006);
}

int main(void){
	int n;
	cin >> n;
	vector<int> arr(n);

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

	sort(arr.begin(), arr.end());

	int sum = 0;

	for(int i=0;i<arr.size();i=i+2){
		sum += min(arr[i], arr[i+1])
	}

	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:45: error: expected ';' before '}' token
   32 |                 sum += min(arr[i], arr[i+1])
      |                                             ^
      |                                             ;
   33 |         }
      |         ~
Language: C++

void bubbleSort(int arr[], int n) { 
    int i, j, temp; 
    for (i = 0; i < n-1; i++){          
       for (j = 0; j < n-i-1; j++)  {
            if(arr[j] > arr[j+1]){
               temp = arr[j];  
               *arr[j] = *arr[j - 1];
               arr[j - 1] = temp;
            } 
       }
   }
} 
 
int main(){
    int N, L[101];
    cin >> N;
    for(int i = 0; i < 2 * N; i++){
        cin >> L[i];
    }
    bubbleSort(L, 2 * N);
    int ans = 0;
    for(int i = 0; i < N; i++){
        if(L[2 * i] <= L[2 * i + 1]) ans += L[2 * i];
        else ans += L[2 * i + 1];
    }
    cout << ans << endl;
    return 0;
}
#include <bits/stdc++.h>
 
using namespace std;
void bubbleSort(int arr[], int n) { 
    int i, j, temp; 
    for (i = 0; i < n-1; i++){          
       for (j = 0; j < n-i-1; j++)  {
            if(arr[j] > arr[j+1]){
               temp = arr[j];  
               arr[j] = arr[j - 1];
               arr[j - 1]= temp;
            } 
       }
   }
} 
 
int main(){
    int N, L[101];
    cin >> N;
    for(int i = 0; i < 2 * N; i++){
        cin >> L[i];
    }
    bubbleSort(L, 2 * N);
    int ans = 0;
    for(int i = 0; i < N; i++){
        if(L[2 * i] <= L[2 * i + 1]) ans += L[2 * i];
        else ans += L[2 * i + 1];
    }
    cout << ans << endl;
    return 0;
}
提出情報

Compiler output:
a.cc: In function 'void bubbleSort(int*, int)':
a.cc:7:16: error: invalid type argument of unary '*' (have 'int')
    7 |                *arr[j] = *arr[j - 1];
      |                ^~~~~~~
a.cc:7:26: error: invalid type argument of unary '*' (have 'int')
    7 |                *arr[j] = *arr[j - 1];
      |                          ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'cin' was not declared in this scope
   16 |     cin >> N;
      |     ^~~
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout << ans << endl;
      |     ^~~~
a.cc:26:20: error: 'endl' was not declared in this scope
   26 |     cout << ans << endl;
      |                    ^~~~
a.cc: At global scope:
a.cc:32:6: error: redefinition of 'void bubbleSort(int*, int)'
   32 | void bubbleSort(int arr[], int n) {
      |      ^~~~~~~~~~
a.cc:1:6: note: 'void bubbleSort(int*, int)' previously defined here
    1 | void bubbleSort(int arr[], int n) {
      |      ^~~~~~~~~~
a.cc:45:5: error: redefinition of 'int main()'
   45 | int main(){
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main(){
      |     ^~~~
a.cc:60:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
   60 | 提出情報
      | ^~~~~~~~
Language: C++

void bubbleSort(int arr[], int n) { 
    int i, j, temp; 
    for (i = 0; i < n-1; i++){          
       for (j = 0; j < n-i-1; j++)  {
            if(arr[j] > arr[j+1]){
               temp = *arr[j];  
               *arr[j] = *arr[j - 1];
               *arr[j - 1] = temp;
            } 
       }
   }
} 
 
int main(){
    int N, L[101];
    cin >> N;
    for(int i = 0; i < 2 * N; i++){
        cin >> L[i];
    }
    bubbleSort(L, 2 * N);
    int ans = 0;
    for(int i = 0; i < N; i++){
        if(L[2 * i] <= L[2 * i + 1]) ans += L[2 * i];
        else ans += L[2 * i + 1];
    }
    cout << ans << endl;
    return 0;
}
#include <bits/stdc++.h>
 
using namespace std;
void bubbleSort(int arr[], int n) { 
    int i, j, temp; 
    for (i = 0; i < n-1; i++){          
       for (j = 0; j < n-i-1; j++)  {
            if(arr[j] > arr[j+1]){
               temp = arr[j];  
               arr[j] = arr[j - 1];
               arr[j - 1]= temp;
            } 
       }
   }
} 
 
int main(){
    int N, L[101];
    cin >> N;
    for(int i = 0; i < 2 * N; i++){
        cin >> L[i];
    }
    bubbleSort(L, 2 * N);
    int ans = 0;
    for(int i = 0; i < N; i++){
        if(L[2 * i] <= L[2 * i + 1]) ans += L[2 * i];
        else ans += L[2 * i + 1];
    }
    cout << ans << endl;
    return 0;
}
提出情報

Compiler output:
a.cc: In function 'void bubbleSort(int*, int)':
a.cc:6:23: error: invalid type argument of unary '*' (have 'int')
    6 |                temp = *arr[j];
      |                       ^~~~~~~
a.cc:7:16: error: invalid type argument of unary '*' (have 'int')
    7 |                *arr[j] = *arr[j - 1];
      |                ^~~~~~~
a.cc:7:26: error: invalid type argument of unary '*' (have 'int')
    7 |                *arr[j] = *arr[j - 1];
      |                          ^~~~~~~~~~~
a.cc:8:16: error: invalid type argument of unary '*' (have 'int')
    8 |                *arr[j - 1] = temp;
      |                ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'cin' was not declared in this scope
   16 |     cin >> N;
      |     ^~~
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout << ans << endl;
      |     ^~~~
a.cc:26:20: error: 'endl' was not declared in this scope
   26 |     cout << ans << endl;
      |                    ^~~~
a.cc: At global scope:
a.cc:32:6: error: redefinition of 'void bubbleSort(int*, int)'
   32 | void bubbleSort(int arr[], int n) {
      |      ^~~~~~~~~~
a.cc:1:6: note: 'void bubbleSort(int*, int)' previously defined here
    1 | void bubbleSort(int arr[], int n) {
      |      ^~~~~~~~~~
a.cc:45:5: error: redefinition of 'int main()'
   45 | int main(){
      |     ^~~~
a.cc:14:5: note: 'int main()' previously defined here
   14 | int main(){
      |     ^~~~
a.cc:60:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
   60 | 提出情報
      | ^~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
void bubbleSort(int arr[], int n) { 
    int i, j, temp; 
    for (i = 0; i < n-1; i++){          
       for (j = 0; j < n-i-1; j++)  {
            if(arr[j] > arr[j+1]){
               temp = x[j];  
               x[j] = x[j - 1];
               x[j - 1]= temp;
            } 
       }
   }
} 

int main(){
    int N, L[101];
    cin >> N;
    for(int i = 0; i < 2 * N; i++){
        cin >> L[i];
    }
    bubbleSort(L, 2 * N);
    int ans = 0;
    for(int i = 0; i < N; i++){
        if(L[2 * i] <= L[2 * i + 1]) ans += L[2 * i];
        else ans += L[2 * i + 1];
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void bubbleSort(int*, int)':
a.cc:9:23: error: 'x' was not declared in this scope
    9 |                temp = x[j];
      |                       ^
Language: Java

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<int> l(n * 2);
    for(int i = 0; i < n * 2; i++){
        cin >> l[i];
    }
    sort(l.begin(), l.end());
    int ans = 0;
    for(int i = n * 2 - 2; i >= 0; i -= 2)
        ans += l[i];
    cout << ans << endl;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
         ^
Main.java:5: error: not a statement
    cin >> n;
        ^
Main.java:6: error: not a statement
    vector<int> l(n * 2);
                    ^
Main.java:8: error: not a statement
        cin >> l[i];
            ^
Main.java:14: error: not a statement
    cout << ans << endl;
                ^
Main.java:3: error: unnamed classes are a preview feature and are disabled by default.
int main(){
^
  (use --enable-preview to enable unnamed classes)
Main.java:6: error: ';' expected
    vector<int> l(n * 2);
                 ^
Main.java:6: error: ';' expected
    vector<int> l(n * 2);
                       ^
9 errors
Language: C++

#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define LL long long
#define int LL
#define P pair<int, int>
const LL N = 2e3 + 10;
const LL mod = 1e9 + 7;
const LL inf = 0x3f3f3f3f;
using namespace std;
template <typename tp>
inline void read(tp &x)
{
    x = 0;char c = getchar();bool f = 0;
    for (; c < '0' || c > '9'; f |= (c == '-'), c = getchar());
    for (; c >= '0' && c <= '9'; x = (x << 3) + (x << 1) + c - '0', c = getchar());
    if (f) x = -x;
}
LL n, x, ans;
LL Gcd(LL x, LL n)
{
    if (n % x == 0)
        return n * 2 - x;
    ans = n / x * x * 2 + Gcd(n % x, x);
    return ans;
}
int main()
{
    read(n),read(x);
    printf("%lld\n",Gcd(x, n - x) + n);
    return 0;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
using namespace std;
int main()
{
  	int n, arr[101];cin>>n;
  	assert(n%2==0);	
  for(int i=1;i<=n;i++) cin>>arr[i];
  	sort(arr+1, arr+n+1);
  	int ans=0;
  	
    for(int i=1;i<=n;i+=2)
    {
      ans+=arr[i];
    }
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'assert' was not declared in this scope
    6 |         assert(n%2==0);
      |         ^~~~~~
a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    1 | #include<iostream>
  +++ |+#include <cassert>
    2 | using namespace std;
a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |         sort(arr+1, arr+n+1);
      |         ^~~~
      |         short
Language: C++

#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
using namespace std;
signed main(){
	int n,ans=0;
	cin >> n;
	vec(a,n);
	REP(i,n){
		cin >> a[i];
	}
	sort(a.begin(),a,end());
	REP(i,n){
		if(i%2 == 0){
			ans += a[i];
		}
	}
	cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: no matching function for call to 'end()'
   15 |         sort(a.begin(),a,end());
      |                          ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 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/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'class std::vector<int>' has no member named 'sort'
   11 |   a.sort(a.begin(),a.end());
      |     ^~~~
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*2;i++){
    cin>>a.at(i);
  }
  a.sort(a.begin(),a.end());
  int c=0;
  for(int i=0;i<n;i++){
    c+=a.at(i*2);
  }
  cout<<c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'class std::vector<int>' has no member named 'sort'
   10 |   a.sort(a.begin(),a.end());
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

#define For(i, j, k) for (int i = j; i <= k; ++ i)
#define Forr(i, j, k) for (int i = j; i >= k; -- i)

using namespace std;

inline int read() {
	int x = 0, p = 1; char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') p = -1;
	for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
	return x * p;
}

inline void File() {
	freopen("D.in", "r", stdin);
	freopen("D.out", "w", stdout);
}

const int N = 1e2 + 10;
int a[N], sta[N], tp, n, m, lst, sum, cnt, ans[N];

int main() {

	n = read(), m = read();
	For(i, 1, m) {
		a[i] = read();
		if (a[i] & 1) sta[++ tp] = i;
	}

	if (tp > 2) return puts("Impossible"), 0;

	if (tp > 0) swap(a[1], a[sta[1]]);
	if (tp > 1) swap(a[m], a[sta[2]]);

//	For(i, 1, m) cout << a[i] << ' '; cout << endl;

	if (m == 1) return printf("%d\n2\n%d %d", a[1], a[1] - 1, 1), 0;

	For(i, 1, m) printf("%d ", a[i]); puts("");

	ans[++ cnt] = lst = a[1] - 1; sum = 1;
	For(i, 1, m) sum += a[i], ans[++ cnt] = sum - lst, lst = sum;
	ans[cnt] -= 1;

	iNt tt = 0; For(i, 1, cnt) if (ans[i] == 0) ++ tt;		

	printf("%d\n", cnt - tt);
	For(i, 1, cnt) if (ans[i]) printf("%d ", ans[i]); puts("");

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: 'iNt' was not declared in this scope; did you mean 'int'?
   46 |         iNt tt = 0; For(i, 1, cnt) if (ans[i] == 0) ++ tt;
      |         ^~~
      |         int
a.cc:46:56: error: 'tt' was not declared in this scope; did you mean 'tp'?
   46 |         iNt tt = 0; For(i, 1, cnt) if (ans[i] == 0) ++ tt;
      |                                                        ^~
      |                                                        tp
a.cc:48:30: error: 'tt' was not declared in this scope; did you mean 'tp'?
   48 |         printf("%d\n", cnt - tt);
      |                              ^~
      |                              tp
Language: C++

#include <cstdio>
#include <algorithm>
#define rg register int
#define rep(a, b, c) for(rg a=b; a<=c; ++a)

int a[102];

inline int read() {
    int x=0; char ch=getchar();
    while(ch<'0'||ch>'9') ch=getchar();
    while(ch>='0'&&ch<='9') {
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    return x;
}

int main() {
    int n; n=read();
    int ans=0;
    rep(i, 1, n) a[i]=read();
    std::sort(a+1, a+i+1);
    for(rg i=1; i<=2*n; i+=2) ans+=a[i];
    printf("%d", ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |     rep(i, 1, n) a[i]=read();
      |         ^
a.cc:4:29: note: in definition of macro 'rep'
    4 | #define rep(a, b, c) for(rg a=b; a<=c; ++a)
      |                             ^
a.cc:22:22: error: 'i' was not declared in this scope
   22 |     std::sort(a+1, a+i+1);
      |                      ^
a.cc:23:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   23 |     for(rg i=1; i<=2*n; i+=2) ans+=a[i];
      |            ^
Language: C++

#include "pch.h"
#include <iostream>
#include<algorithm>
using namespace std;
int n[1919];

int main()
{
	int a;
	int iwa = 0;
	cin >> a;
	int b = a * 2;
	for (int i = 0; i < b; i++) {
		cin >> n[i];
	}
	sort(n, n + b);
	for (int i = 0; i < b; i += 2) {
		iwa += n[i];
	}
	cout << iwa << endl;
}

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

#include <iostream>
using namespace std;
int n,l[200],a;
int main(){
  cin>>n;
  for(int i=0;i<n*2;i++)cin>>l[i];
  sort(l,l+n*2);
  for(int i=0;i<n;i++)a+=l[i*2];
  cout<<a<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    7 |   sort(l,l+n*2);
      |   ^~~~
      |   short
Language: C++

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

int main(){
  int n; cin >> n;
  vector<int> L(2 * n);
  for(int i = 0; i < 2 * n; i++) cin >> L[i];
  sort(L.begin(), L.end());
  int ans = 0;
  for(int i = 0; i < 2 * n; i++) ans += L[2 * i];
  cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> L(2 * n);
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> L(2 * n);
      |          ^~~
a.cc:8:41: error: 'L' was not declared in this scope
    8 |   for(int i = 0; i < 2 * n; i++) cin >> L[i];
      |                                         ^
a.cc:9:8: error: 'L' was not declared in this scope
    9 |   sort(L.begin(), L.end());
      |        ^
Language: C++

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

int main(){
  int n; cin >> n;
  vector<int> L(2 * n);
  for(int i = 0; i < 2 * n; i++) cin >> L[i];
  sort(L.begin(), L.end());
  int ans = 0;
  for(int i = 0; i < 2 * n; i++) ans += L[2 * i];
  cout << ans;
  return 0;
}

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