criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;
 
class Main{
 void main(String[]args){
 
  Scanner sc=new Scanner(System.in);
  
  int nagasa =sc.nextInt();
  int l[]=new int[nagasa];  
  
  for (int =0; i<length; i++){
   l[i]=sc.nextInt();
}
  Arrays.sort(l);

  for(int i=0; i<length-1; i++){
    int ans=0;
    ans +=<Math.min(l[i],l[i+1]);
    System.out.println(ans);
}



}}

Compiler output:
Main.java:11: error: not a statement
  for (int =0; i<length; i++){
       ^
Main.java:11: error: ';' expected
  for (int =0; i<length; i++){
          ^
Main.java:11: error: illegal start of expression
  for (int =0; i<length; i++){
           ^
Main.java:11: error: not a statement
  for (int =0; i<length; i++){
                ^
Main.java:11: error: ')' expected
  for (int =0; i<length; i++){
                       ^
Main.java:11: error: ';' expected
  for (int =0; i<length; i++){
                            ^
Main.java:18: error: > or ',' expected
    ans +=<Math.min(l[i],l[i+1]);
                   ^
Main.java:18: error: not a statement
    ans +=<Math.min(l[i],l[i+1]);
                     ^
Main.java:18: error: ';' expected
    ans +=<Math.min(l[i],l[i+1]);
                        ^
Main.java:18: error: not a statement
    ans +=<Math.min(l[i],l[i+1]);
                          ^
Main.java:18: error: ';' expected
    ans +=<Math.min(l[i],l[i+1]);
                               ^
11 errors
Language: C++

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

int main(){
  int skw, L[200], sum = 0;

  scanf("%d", &skw); 
  for(int i = 0;i < skw; i++)
    scanf("%d", &L[i]);  

 sort(L, skw);

  for(int j = 0; j < skw; j+2)
    sum = sum + min(L[j],L[j+1]);

  printf("%d\n", sum);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:6: error: no matching function for call to 'sort(int [200], int&)'
   12 |  sort(L, skw);
      |  ~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/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:   template argument deduction/substitution failed:
a.cc:12:6: note:   deduced conflicting types for parameter '_RAIter' ('int*' and 'int')
   12 |  sort(L, skw);
      |  ~~~~^~~~~~~~
/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, 2 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, 2 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, 2 provided
Language: C++

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

int main(){
  int skw, L[200], sum = 0;

  scanf("%d", &skw); //串の本数を取得(串焼きの数はこの半分)
  for(int i = 0;i < skw; i++)
    scanf("%d", &L[i]);  //長さを取得

 sort(L, skw);

  for(int j = 0; j < skw; j+2)
    sum = sum + min(L[j],L[j+1]);

  printf("%d\n", sum);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:6: error: no matching function for call to 'sort(int [200], int&)'
   12 |  sort(L, skw);
      |  ~~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/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:   template argument deduction/substitution failed:
a.cc:12:6: note:   deduced conflicting types for parameter '_RAIter' ('int*' and 'int')
   12 |  sort(L, skw);
      |  ~~~~^~~~~~~~
/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, 2 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, 2 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, 2 provided
Language: C++

#include <cstdio>
#include <cmath>
using namespace std;

void selectionSort(int L[], int N){
  int minj, t;
  for(int i = 0; i < N; i++){
    minj = i;
    for(int j = i; j < N; j++){
      if(L[j] < L[minj])
	minj = j;
    }
    t = L[i];
    L[i] = L[minj];
    L[minj] = t;
  }
}

int main(){
  int skw, L[200], sum = 0;

  scanf("%d", &skw); //串の本数を取得(串焼きの数はこの半分)
  for(int i = 0;i < skw; i++)
    scanf("%d", &L[i]);  //長さを取得

  selectionSort(L, skw);

  for(int j = 0; j < skw; j+2)
    sum = sum + min(L[j],L[j+1]);

  printf("%d\n", sum);
  rerutn 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:3: error: 'rerutn' was not declared in this scope
   32 |   rerutn 0;
      |   ^~~~~~
Language: C++

#include <cstdio>
#include <cmath>
using namespace std;

void selectionSort(int L[], int N){
  int minj, t;
  for(int i = 0; i < N; i++){
    minj = i;
    for(int j = i; j < N; j++){
      if(L[j] < L[minj])
	minj = j;
    }
    t = L[i];
    L[i] = L[minj];
    L[minj] = t;
  }
}

int main(){
  int skw, L[200], sum = 0;

  scanf("%d", &skw); //串の本数を取得(串焼きの数はこの半分)
  for(int i = 0;i < skw; i++)
    scanf("%d", &L[i]);  //長さを取得

  selectionSort(L, skw);

  for(int i = 0; i < skw; i+2)
    sum = sum + min(L[i],L[i+1]);

  printf("%d", sum);
  rerutn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:3: error: 'rerutn' was not declared in this scope
   32 |   rerutn 0;
      |   ^~~~~~
Language: C++

#include <cstdio>
using namespace std;

int selectionSort(int L[], int N){
  int minj, t, sw = 0;
  for(int i = 0; i < N; i++){
    minj = i;
    for(int j = i; j < N; j++){
      if(A[j] < A[minj])
	minj = j;
    }
    t = A[i];
    A[i] = A[minj];
    A[minj] = t;
    if(i != minj)
      sw++;
  }
  return sw;
}

int main(){
  int skw, L[200], sum = 0;

  scanf("%d", &skw); //串の本数を取得(串焼きの数はこの半分)
  for(int i = 0;i < skw; i++)
    scanf("%d", &L[i]);  //長さを取得

  selectionSort(L, skw);

  for(int i = 0; i < skw; i+2)
    sum = sum + min(L[i],L[i+1]);

  printf("%d", sum);
  rerutn 0;
}


Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:9:10: error: 'A' was not declared in this scope
    9 |       if(A[j] < A[minj])
      |          ^
a.cc:12:9: error: 'A' was not declared in this scope
   12 |     t = A[i];
      |         ^
a.cc: In function 'int main()':
a.cc:31:17: error: 'min' was not declared in this scope; did you mean 'main'?
   31 |     sum = sum + min(L[i],L[i+1]);
      |                 ^~~
      |                 main
a.cc:34:3: error: 'rerutn' was not declared in this scope
   34 |   rerutn 0;
      |   ^~~~~~
Language: Java

import java.util.*;

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

  Scanner sc=new Scanner(System.in);
  
  int nagasa =sc.nextInt();
  int i[]=new int[nagasa];  //要素数
  for(int j=0; j<i.length; j++){
   i[j]=sc.nextInt();
}
  
   for(int a=0; a< i.length-1; a++) {
            for(int b=0; b < i.length-a-1; b++) {
            	if(i[b] < i[b+1]) {
            		int asc = i[b];
            		i[b] = i[b+1];
            		i[b+1] = asc;
            	}
            }
        }

  for(int n=0; n<i.length-1; n++){
     int x=i[2*n+1];
     int sum +=x;
     System.out.println(sum);

}
}}

Compiler output:
Main.java:26: error: ';' expected
     int sum +=x;
            ^
Main.java:26: error: not a statement
     int sum +=x;
               ^
2 errors
Language: Java

import java.util.*;

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

  Scanner sc=new Scanner(System.in);
  
  int nagasa =sc.nextInt();
  int i[]=new int[nagasa];  //要素数
  for(int j=0; j<i.length; j++){
   i[j]=sc.nextInt();
}
  
  Arrays.sort(i,Comparator.reverseOrder());

  for(int n=0; n<i.length-1; n++){
     int x=i[2*n+1];
     sum +=x;
     System.out.println(sum);

}
}}

Compiler output:
Main.java:14: error: no suitable method found for sort(int[],Comparator<T#1>)
  Arrays.sort(i,Comparator.reverseOrder());
        ^
    method Arrays.<T#2>sort(T#2[],Comparator<? super T#2>) is not applicable
      (inference variable T#2 has incompatible bounds
        equality constraints: int
        upper bounds: Object)
    method Arrays.<T#3>sort(T#3[],int,int,Comparator<? super T#3>) is not applicable
      (cannot infer type-variable(s) T#3
        (actual and formal argument lists differ in length))
  where T#1,T#2,T#3 are type-variables:
    T#1 extends Comparable<? super T#1>
    T#2 extends Object declared in method <T#2>sort(T#2[],Comparator<? super T#2>)
    T#3 extends Object declared in method <T#3>sort(T#3[],int,int,Comparator<? super T#3>)
Main.java:18: error: cannot find symbol
     sum +=x;
     ^
  symbol:   variable sum
  location: class Main
Main.java:19: error: cannot find symbol
     System.out.println(sum);
                        ^
  symbol:   variable sum
  location: class Main
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
3 errors
Language: C++

#include <cstdio>
#include <vector>

using namespace std;

int main() {
	int N;
	scanf("%d", &N);
	vector<int> vec;
	for(int i=0; i<2*N; ++i) {
		int L;
		scanf("%d", &L);
		vec.push_back(L);
	}
	sort(vec.begin(), vec.end());
	int sum = 0;
	for(int i=0; i<N; ++i) {
		sum += vec[i*2];
	}
	printf("%d\n", sum);
	return 0;
}


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

#include <cstdio>

using namespace std;

int main() {
	int N;
	scanf("%d", &N);
	vector<int> vec;
	for(int i=0; i<2*N; ++i) {
		int L;
		scanf("%d", &L);
		vec.push_back(L);
	}
	sort(vec.begin(), vec.end());
	int sum = 0;
	for(int i=0; i<N; ++i) {
		sum += vec[i*2];
	}
	printf("%d\n", sum);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<int> vec;
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <cstdio>
  +++ |+#include <vector>
    2 | 
a.cc:8:16: error: expected primary-expression before 'int'
    8 |         vector<int> vec;
      |                ^~~
a.cc:12:17: error: 'vec' was not declared in this scope
   12 |                 vec.push_back(L);
      |                 ^~~
a.cc:14:14: error: 'vec' was not declared in this scope
   14 |         sort(vec.begin(), vec.end());
      |              ^~~
a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |         sort(vec.begin(), vec.end());
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
	int N;
	cin >> N ;
	vector<int> L;
	for (int i = 0; i <2*N; i++) {
		int m;
		cin >> m;
		L.push_back(m);
	}
	std::sort(L.begin(),  L.end());
	int Guzai =0;
	for(int i = 0; 2*i >2*N; i++){
		Guzai += i;
	}
	cout << Guzai << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   15 |         std::sort(L.begin(),  L.end());
      |              ^~~~
      |              qsort
Language: Java

import java.util.*;
public class Main_1 {

	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int n=sc.nextInt();
		int kusim[]=new int[2*n];
		int ans=0;
		
		for(int i=0;i<2*n;i++){
			kusim[i]=sc.nextInt();
		}
		
		int turn=kusim.length-1;
		for(int j=0;j<turn;j++){
			for(int k=0;k<turn-j;k++){
				if(kusim[k]>kusim[k+1]){
					int a=kusim[k];
					kusim[k]=kusim[k+1];
					kusim[k+1]=a;
				}
			}
		}
		for(int l=0;l<n;l++){
			ans+=kusim[2*l+1];
		}

	}

}

Compiler output:
Main.java:2: error: class Main_1 is public, should be declared in a file named Main_1.java
public class Main_1 {
       ^
1 error
Language: C++

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

int main()
{
  int64 N, X;
  cin >> N >> X;
  int64 Line = (N - 1) * 3;
  
  if(N % X == 0) {
    cout << Line - (kyori - 1) * 3 << endl;
  } else {
    cout << Line << endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'kyori' was not declared in this scope
   12 |     cout << Line - (kyori - 1) * 3 << endl;
      |                     ^~~~~
Language: C

#include <stdio.h>

void Qsort(int x[], int left, int right);
void Swap(int x[], int i, int j);

int main(void) 
{
	int N, L[100], sum = 0;

	if (scanf("%d", &N) != 1)return 0;

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

	Qsort(L, 0, 2 * N - 1);

	for (int i = 0; i < N; i++) {
		sum += L[2 * i];
	}

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


	return 0;
}

void Swap(int x[], int i, int j) {
	int w;

	w = x[i];
	x[i] = x[j];
	x[j] = w;

}

void Qsort(int x[], int left, int right) {

	int i, j, pivot;

	i = left;
	j = right;
	pivot = x[(i + j) / 2];

	while (1) {

		while (x[i] < pivot)
			i++;

		while (x[j] > pivot)
			j--;
		if (i >= j)
			break;

		Swap(x, i, j);
		i++;
		j--;
	}

	if (left < i - 1)
		Qsort(x, left, i - 1);
	if (right > j + 1)
		Qsort(x, j + 1, right);

}
/*

Compiler output:
main.c:66:1: error: unterminated comment
   66 | /*
      | ^
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.stream.Stream;
import java.util.Arrays;

public class A {
	public static void main(String args[]) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		int N = Integer.parseInt(line);
		String readline = br.readLine();
		readline = readline.trim();
		String[] stra = readline.split(" ");
		int[] inta = Stream.of(stra).mapToInt(Integer::parseInt).toArray();
		
		//for (int j = 0; j < inta.length; j++) {
		//	System.out.println(j.class);
		//}
		
		Arrays.sort(inta);
		//System.out.println(Arrays.toString(inta));
		
		int count = 0;
		for (int i = 0; i < N ; i++ ){
			count = count + inta[2 * i];
		}
		
		System.out.println(count);
	}
}

Compiler output:
Main.java:6: error: class A is public, should be declared in a file named A.java
public class A {
       ^
1 error
Language: C++

#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;

int main()
{
	int N;
	cin >> N;

	vector<int> L(2 * N);
	for (auto& li : L)
		cin >> li;

	int cnt = 0;
	while (L.size() > 0)
	{
		auto maxIt = max_element(L.begin(), L.end()), L.erase(maxIt);
		auto secondIt = max_element(L.begin(), L.end());
		cnt += *secondIt, L.erase(secondIt);
	}

	cout << cnt << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:64: error: expected initializer before '.' token
   34 |                 auto maxIt = max_element(L.begin(), L.end()), L.erase(maxIt);
      |                                                                ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void main(void) {
	int n;
	cin >> n;
	n *= 2;
	vector<int> vec;
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		vec.push_back(x);
	}
	sort(vec.begin(), vec.end());
	int sum = 0;
	for (int i = 0; i < n; i += 2) {
		sum += vec[i];
	}
	cout << sum << endl;
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main(void) {
      | ^~~~
Language: C++

#include <stdio.h>

int N = 0;
int L[201];



int main(){
	scanf_s("%d", &N);
	for (int i = 0; i < 2 * N; i++){
		scanf_s("%d", &L[i]);
	}
	int temp;
	for (int i = 0; i < 2 * N; i++){
		for (int j = 0; j < 2 * N - 1; j++){
			if (L[j] < L[j + 1]){
				temp = L[j];
				L[j] = L[j + 1];
				L[j + 1] = temp;
			}
		}
	}
	int answer = 0;
	for (int i = 0; i < N; i++){
		answer += L[i*2 + 1];
	}

	printf("%d\n", answer);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    9 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C

#include <iostream>
#include <cstdio>

using namespace std;

void sort(int *array, int num){
	for(int i = 0; i < num - 1; i++){
		for(int j = i + 1; j < num; j++){
			if(array[i] < array[j]){
				int temp = array[i];
				array[i] = array[j];
				array[j] = temp;
			}
		}
	}
}

int main(){
	int N, result = 0;
	int L[200];
	cin >> N;
	for(int i = 0; i < 2 * N; i++)
		cin >> L[i];
	sort(L,2*N);

	for(int i = 0; 2*i + 1 <= 2*N; ++i){
		result += L[2*i + 1];
	}
	printf("%d\n",result);
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int kushi = sc.nextInt();

        ArrayList<Integer> lengthList = new ArrayList<Integer>();
        for (int i = 0, max = kushi * 2; i < max; i++) {
            int n = sc.nextInt();
            lengthList.add(n);

        }
        Collections.sort(lengthList);

        int tot = 0;
        for (int i = 0; i < lengthList.size(); i+=2) {
            tot += lengthList.get(i);
        }

        System.out.println(tot);
    }
}


Compiler output:
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
        ArrayList<Integer> lengthList = new ArrayList<Integer>();
        ^
  symbol:   class ArrayList
  location: class Main
Main.java:8: error: cannot find symbol
        ArrayList<Integer> lengthList = new ArrayList<Integer>();
                                            ^
  symbol:   class ArrayList
  location: class Main
Main.java:14: error: cannot find symbol
        Collections.sort(lengthList);
        ^
  symbol:   variable Collections
  location: class Main
5 errors
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'i' was not declared in this scope
   13 |     cout << A[ i ] << "\n";
      |                ^
Language: Java

import java.util.Scanner;
import java.util.Arrays;
public class Main{
public static void main(String args[]){
int N = 0;
int L[] = new int[200];
int ans = 0;
Arrays.fill(L, 1000);

Scanner scan = new Scanner(System.in);
N = scan.next();
for(int i=0;i<2*N;i++){
L[i] = scan.next();
}
Arrays.sort(a);
for(int i=0;i<2*N;i=i+2){
add = add+L[i];
}
System.out.println(add);
}
}

Compiler output:
Main.java:11: error: incompatible types: String cannot be converted to int
N = scan.next();
             ^
Main.java:13: error: incompatible types: String cannot be converted to int
L[i] = scan.next();
                ^
Main.java:15: error: cannot find symbol
Arrays.sort(a);
            ^
  symbol:   variable a
  location: class Main
Main.java:17: error: cannot find symbol
add = add+L[i];
^
  symbol:   variable add
  location: class Main
Main.java:17: error: cannot find symbol
add = add+L[i];
      ^
  symbol:   variable add
  location: class Main
Main.java:19: error: cannot find symbol
System.out.println(add);
                   ^
  symbol:   variable add
  location: class Main
6 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class A001 {

	public static void main(String[] args) throws Exception{
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(br.readLine());
		Integer[] L2 = new Integer[2*N];
		String[] L = br.readLine().split(" ");
		for(int i=0;i<L.length;i++){
			L2[i] = Integer.parseInt(L[i]);
		}
		
		int sum = 0;
		Arrays.sort(L2);
		for(int i=L2.length-1;i>0;i-=2){
			sum += Math.min(L2[i], L2[i-1]);
		}
		
		System.out.println(sum);
	}
}


Compiler output:
Main.java:5: error: class A001 is public, should be declared in a file named A001.java
public class A001 {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int SIZE = 1e6+10;
int a[111111];
int main(){
    DRII(n);
REP(i,N*2)RI(a[i]);
sort(a,a+2*n);
int an=0;
REP(i,n)an+=a[i*2];
cout<<an<<endl;
    return 0;
}

Compiler output:
a.cc:32:11: error: macro "DRII" requires 2 arguments, but only 1 given
   32 |     DRII(n);
      |           ^
a.cc:10:9: note: macro "DRII" defined here
   10 | #define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
      |         ^~~~
a.cc: In function 'int main()':
a.cc:32:5: error: 'DRII' was not declared in this scope
   32 |     DRII(n);
      |     ^~~~
a.cc:33:7: error: 'N' was not declared in this scope
   33 | REP(i,N*2)RI(a[i]);
      |       ^
a.cc:4:40: note: in definition of macro 'REP'
    4 | #define REP(I, N) for (int I = 0; I < (N); ++I)
      |                                        ^
a.cc:34:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   34 | sort(a,a+2*n);
      |            ^
      |            yn
Language: C++

#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <ctime>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>

using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define debug(x) cout<<#x<<": "<<x<<endl
#define MOD 1000000007

#define MAX_N 100

typedef long long ll;
typedef unsigned long long ull;

template <class T, class U> amax(T& x, U y) {if (x < y) x = y;}
template <class T, class U> amin(T& x, U y) {if (x > y) x = y;}

int main(void)
{
    int N, L[2 * MAX_N];
    cin >> N;
    REP(i, 2 * N) cin >> L[i];
    sort(L, L + 2 * N);
    int ret = 0;
    REP(i, N) ret += L[2 * i];
    cout << ret << endl;
    return 0;
}


Compiler output:
a.cc:34:29: error: ISO C++ forbids declaration of 'amax' with no type [-fpermissive]
   34 | template <class T, class U> amax(T& x, U y) {if (x < y) x = y;}
      |                             ^~~~
a.cc: In function 'int amax(T&, U)':
a.cc:34:63: warning: no return statement in function returning non-void [-Wreturn-type]
   34 | template <class T, class U> amax(T& x, U y) {if (x < y) x = y;}
      |                                                               ^
a.cc: At global scope:
a.cc:35:29: error: ISO C++ forbids declaration of 'amin' with no type [-fpermissive]
   35 | template <class T, class U> amin(T& x, U y) {if (x > y) x = y;}
      |                             ^~~~
a.cc: In function 'int amin(T&, U)':
a.cc:35:63: warning: no return statement in function returning non-void [-Wreturn-type]
   35 | template <class T, class U> amin(T& x, U y) {if (x > y) x = y;}
      |                                                               ^
Language: C++

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

int main() {

    int N; cin >> N;
    vector<int> L;

    for(int i = 0; i < 2*N; i++){
        int tmp; cin >> tmp;
        L.push_back(tmp);
    }

    int ans;
    sort(L.begin(), L.end());

    for(int i = 0; i < 2*N; i += 2){
        ans += min(L[i], L[i+1]);
    }


    cout << ans << endl;

    return 0;
}

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

#include <iostream>
using namespace std;

int main()
{
  int n;
  cin >> n;
  int a[n * 2];
  for (int i = 0; i < n * 2; i++) {
    cin >> a[i];
  }
  sort(a, a + n*2);
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int x = a[2*i];
    int y = a[2*i+1];
    if (x > y) {
      cnt += y;
    } else {
      cnt += x;
    }
  }
  cout << cnt << endl;
  return 0;
}

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

#include<iostream>
#include<vector>

using namespace std;

#define all(c) ((c).begin()), ((c).end())
#define dump(c) cerr << "> " << #c << " = " << (c) << endl;
#define REP(i, a, b) for (int i = (a); i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;

const int INF = 1001001001;
const double EPS = 1e-10;


template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
  return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
  os<<'[';
  rep(i,a.size()) os<<(i?" ":"")<<a[i];
  return os<<']';
}

int main() {
    int n; cin >> n;
    vector<int> li(n * 2);
    rep(i, n * 2) {
        cin >> li[i];
    }
    sort(all(li));

    int ans = 0;
    rep(i, n * 2) {
        int a = i * 2;
        ans += li[a];
    }
    cout << ans << endl;
  
  
  return 0;
}


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

N = int(raw_input())
L = map(int,raw_input().split())
L.sort(reverse = True)
ans = 0
for i in xrange(N):
	ans += min(L[2*i],L[2*i+1])
print ans

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

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

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int N = sc.nextInt();
		int[] L = new int[2 * N];
		for (int i = 0; i < 2 * N; ++i) {
			L[i] = sc.nextInt();
		}
		Arrays.sort(L);
		int ans = 0;
		for (int i = 0; i < N; ++i) {
			ans += L[2 * i];
		}
		System.out.println(ans);
	}

}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Arrays;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  ull N, X;
  cin >> N >> X;

  cout << N + 3 * X + X / 2;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'ull' was not declared in this scope
    5 |   ull N, X;
      |   ^~~
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N >> X;
      |          ^
a.cc:6:15: error: 'X' was not declared in this scope
    6 |   cin >> N >> X;
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,m;
int a[225];
int main(){
	cin>>n>>m;
	cout<<(6*x);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: 'x' was not declared in this scope
    7 |         cout<<(6*x);
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define f(i,a,n) for(i=a;i<n;i++)
#define in(x) scanf("%lld",&x)
void solve()
{
    ll n,x;
    in(n);
    in(x);
    if(n==2*x)
        ans=3*x;
    else
        ans=6*x;
    printf("%lld\n",ans);
}
int main()
{
    ll t;
	// cin>>t;
	// while(t--)
		solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |         ans=3*x;
      |         ^~~
      |         abs
a.cc:14:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         ans=6*x;
      |         ^~~
      |         abs
a.cc:15:21: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |     printf("%lld\n",ans);
      |                     ^~~
      |                     abs
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define fo(i,n) for(int i=0;i<n;i++)

int ;
ll a,b,x,n,ans;

void solve() {
    ans=n;
    a=x,b=n-x;
	while(true){
            if(a<b)
                swap(a,b);
            
            ans+=((a/b)*2)*b;
            
            if(a%b==0){
                ans-=b;
                break;
            }
            a=a%b;
	}
    cout << ans;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    
    cin >> n >> x;
    solve();
    return 0;
}


Compiler output:
a.cc:8:1: error: declaration does not declare anything [-fpermissive]
    8 | int ;
      | ^~~
Language: C++

#include <stdio.h>
long long n, x, a, b, c, ans;
int main() {
	scanf("%lld%lld", &n, &x);
	ans = n;
	if (x < n - x) {
		a = n - x;
		b = x;
	}#
	else {
		a = x;
		b = n - x;
	}
	while (true) {
		if (a % b == 0) {
			ans += (2 * a / b - 1) * b;
			break;
		}
		else {
			ans += 2 * (a / b) * b;
			c = a % b;
			a = b;
			b = c;
		}
	}
	printf("%lld\n", ans);
}

Compiler output:
a.cc:9:10: error: stray '#' in program
    9 |         }#
      |          ^
Language: C++

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,k;
    cin>>n>>k;
    int ans=3*(n-__gcd(n,k));
    cout<<ans;
    return 0;
}
AC

Compiler output:
a.cc:15:1: error: 'AC' does not name a type
   15 | AC
      | ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int gcd(int a,in b){
  if(a==0)return b;
  if(b==0)return a;
  if(a>b)
    return gcd(a-b,b);
  return gcd(a,b-a);
}
 
int main()
{
  long long int a,b;
  cin>>a>>b;
  long long int ans=0;
  ans=3*(a-gcd(a,b));
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc:3:15: error: 'in' has not been declared
    3 | int gcd(int a,in b){
      |               ^~
Language: C++

int gcd(int a,in b){
  if(a==0)return b;
  if(b==0)return a;
  if(a>b)
    return gcd(a-b,b);
  return gcd(a,b-a);
}

int main()
{
  long long int a,b;
  cin>>a>>b;
  long long int ans=0;
  ans=3*(a-gcd(a,b));
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc:1:15: error: 'in' has not been declared
    1 | int gcd(int a,in b){
      |               ^~
a.cc: In function 'int main()':
a.cc:12:3: error: 'cin' was not declared in this scope
   12 |   cin>>a>>b;
      |   ^~~
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout<<ans<<endl;
      |   ^~~~
a.cc:15:14: error: 'endl' was not declared in this scope
   15 |   cout<<ans<<endl;
      |              ^~~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
int main() {
   // cout<<"Hello World!";
   ll n,x;
   cin>>n>>x;
   cout<<n*x+x;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:4: error: 'll' was not declared in this scope
    5 |    ll n,x;
      |    ^~
a.cc:6:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |    cin>>n>>x;
      |         ^
      |         yn
a.cc:6:12: error: 'x' was not declared in this scope
    6 |    cin>>n>>x;
      |            ^
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (long long i=0; i < (n); ++i)
#define rep2(i,n,m) for(long long i=n;i<=m;i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}

int main(){
 ll n ;
 cin>> n ;
 cout <<3*n<<endl ;
 
  } return 0;
}

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <time.h>
#define ll long long
#define double long double
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl;
#define COYE cout<<"YES"<<endl;
#define COYe cout<<"Yes"<<endl;
#define COye cout<<"yes"<<endl;
#define CONO cout<<"NO"<<endl;
#define CONo cout<<"No"<<endl;
#define COno cout<<"no"<<endl;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define ALL(V) ((V).begin(),(V).end())
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
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;}
const int vx[4]={0,1,0,-1},vy[4]={1,0,-1,0};
using namespace std;

int main(){
  ll N,X;
  cin>>N>>X;
  
  cout<<3*(N-gcd(N,X))<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:14: error: 'gcd' was not declared in this scope
   50 |   cout<<3*(N-gcd(N,X))<<endl;
      |              ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;


int main()
{
std:
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int N,X;
  cin>>N>>X;
  cout<<3(N-__gcd(N,X))<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: expression cannot be used as a function
   15 |   cout<<3(N-__gcd(N,X))<<endl;
      |         ~^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll gcd(ll n,ll x){
    if(!(n%x)) return n*2-x;
    return n/x*x*2+gcd(x,n%x);
} 
int main(){
    cin>>n>>x;
    cout<<gcd(n-x,x)+n<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |     cin>>n>>x;
      |          ^
      |          yn
a.cc:9:13: error: 'x' was not declared in this scope
    9 |     cin>>n>>x;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
ll gcd(ll n,ll x){
    if(!(n%x)) return n*2-x;
    return n/x*x*2+gcd(x,n%x);
} 
int main(){
    cin>>n>>x;
    cout<<gcd(n-x,x)+n<<endl;
    return 0;
}

Compiler output:
a.cc:3:1: error: 'll' does not name a type
    3 | ll gcd(ll n,ll x){
      | ^~
a.cc: In function 'int main()':
a.cc:8:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |     cin>>n>>x;
      |          ^
      |          yn
a.cc:8:13: error: 'x' was not declared in this scope
    8 |     cin>>n>>x;
      |             ^
Language: C++

#include <iostream>
using namespace std;

long long int n, x;

int main(){
  cin>>n>>x;
  cout<<n+((7*x)/2)
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected ';' before '}' token
    8 |   cout<<n+((7*x)/2)
      |                    ^
      |                    ;
    9 | }
      | ~
Language: C++

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

int sum(a,b){
  if(a==b){
    return sum(a,b) + a;
  }
  if(a>b){
    return sum(a-b,b) + 2*b;
  }
  if(a<b){
    return sum(a,b-a) + 2*a;
  }
}

int main(){
  int n,x;
  cin >> n >> x;
  cout << sum(x,n-x)+n << endl;
}


Compiler output:
a.cc:4:9: error: 'a' was not declared in this scope
    4 | int sum(a,b){
      |         ^
a.cc:4:11: error: 'b' was not declared in this scope
    4 | int sum(a,b){
      |           ^
a.cc:4:12: error: expression list treated as compound expression in initializer [-fpermissive]
    4 | int sum(a,b){
      |            ^
a.cc: In function 'int main()':
a.cc:19:14: error: 'sum' cannot be used as a function
   19 |   cout << sum(x,n-x)+n << endl;
      |           ~~~^~~~~~~
Language: C++

#include<stdio.h>
#include<iostream>
int main(){

long long N,X;


cin>>N>>X;

cout<<(N-X)*X*X;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 | cin>>N>>X;
      | ^~~
      | std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 | cout<<(N-X)*X*X;
      | ^~~~
      | 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++.h>

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrepa(i,a,n) for(int i=(n)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

ll sol(ll a, ll b){

    if(a<b)swap(a,b);
    if(a%b==0)return b*(2*b-1)

    ll t;
    t = a/b;
    return sol(b,a-b*t) + t*2*b;

}

int main(){
   
    ll n,x;
    cin >> n >> x;
    // ll ans=n;

    // ll a=n-x,b=x;
    // if(a<b)swap(a,b);

    // ll tmp;
    // while(a%b != 0){
    //     tmp = a/b;
    //     ans += 2*b*tmp;
    //     a -= b*tmp;
    //     swap(a,b);
    // }
    // ans += b*((a/b)*2-1);

    // cout << ans << endl;

    cout << sol(n-x,x) + n << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'll sol(ll, ll)':
a.cc:21:31: error: expected ';' before 'll'
   21 |     if(a%b==0)return b*(2*b-1)
      |                               ^
      |                               ;
   22 | 
   23 |     ll t;
      |     ~~
Language: C

#include<stdio.h>

int main (){

  long long N=2,X=1,sum=0,y=0;

  scanf("%lld %lld",&N,&X);

  if(N-X<1){
    X=N-1;
  }

  sum=N;

  if(N>=2*X){
    if(N==2*X){
      sum=X*3;
    }else
      y=X/(N-X);
    sum=(y+1)*y
  }
  else{
  }

  printf("%lld\n",sum);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:16: error: expected ';' before '}' token
   20 |     sum=(y+1)*y
      |                ^
      |                ;
   21 |   }
      |   ~
Language: C

#include<stdio.h>

int main (){

  long long N=2,X=1,sum=0,y=0;

  scanf("%lld %lld",&N,&X);

  if(N-X<1){
    X=N-1;
  }

  sum=N;

  if(N>2X){
    sum+=X*2;
    y+=N-2*X;
    sum+=(X/y+1)*y; 
  }
  else{
    y+=X/(N-X);
    sum+=(y+1)*(N-X);
  }

  printf("%lld\n",sum);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:8: error: invalid suffix "X" on integer constant
   15 |   if(N>2X){
      |        ^~
Language: C

#include<stdio.h>

int main (){

  long long N=2,X=1,sum=0,y=0;

  scanf("%lld %lld",&N,&X);

  if(N-x>1){
    X=N-1;
  }

  sum=N;

  if(N/2>X){
    sum+=X*2;
    y+=N-2*X;
    sum+=(X/y+1)*y; 
  }
  else{
    y+=X/(N-X);
    sum+=(y+1)*(N-X);
  }

  printf("%lld\n",sum);

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:8: error: 'x' undeclared (first use in this function)
    9 |   if(N-x>1){
      |        ^
main.c:9:8: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
#define st first
#define nd second

using namespace std;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(long long _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

// const long long N = ;
long long n, x, ans;

int main() {
	ios_base::sync_with_stdio(false);
	cin >> n >> x;

	ans += n;

	long long a = x;
	long long b = n - x;
	if(a < b) swap(a, b);

	while(b) {
		// if(a < b) swap(a, b);
		long long c = a % b;
		ans += 2 * (a / b) * b;
		dbg(a, b, ans);
		if(c == 0) ans -= bz;
		a = b;
		b = c;
	}
	// ans += b;
	cout << ans << '\n';

}	

	

Compiler output:
a.cc: In function 'int main()':
a.cc:37:35: error: 'bz' was not declared in this scope; did you mean 'b'?
   37 |                 if(c == 0) ans -= bz;
      |                                   ^~
      |                                   b
Language: C++

#include "ccc.hpp"

// http://drken1215.hatenablog.com/entry/2019/03/15/205900
// など

ll calc(ll a, ll b) {
    if (a < b) swap(a, b);
    if (b == 0) return -a; // 最後2 * b * (q - 1) + bとしたい
    ll q = a / b;
    ll ret = 2 * b * q;
    ret += calc(b, a % b);
    return ret;
}
int main() {
    ll n, x; cin >> n >> x;
    out(n + calc(n - x, x));
}


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

	#pragma GCC optimize("Ofast")
	//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
	#include <bits/stdc++.h>
	using namespace std;
	//#include <ext/pb_ds/assoc_container.hpp>
	//#include <ext/pb_ds/tree_policy.hpp>
	//using namespace __gnu_pbds;
	//#ifndef rd
	#define endl '\n'
	//#endif
	#ifdef rd
	#define trace(...) cout<<"Line:"<<__LINE__<<" "; __f(#__VA_ARGS__, __VA_ARGS__)
	template<typename Arg1>
	void __f(const char* name, Arg1&& arg1) {
		cout<<name<<" : "<<arg1<<endl;
	}
	template<typename Arg1, typename ... Args>
	void __f(const char* names, Arg1&& arg1, Args&&... args) {
		const char* comma=strchr(names+1,',');
		cout.write(names,comma-names)<<" : "<<arg1<<" | ";
		__f(comma+1,args...);
	}
	#else
	#define trace(...)
	#endif
	#define pb push_back
	#define fi first
	#define se second
	#define mkp make_pair
	//#define int long long
	typedef long long ll;
	typedef long double f80;
	//#define double long double
	#define pii pair<int,int>
	#define pll pair<ll,ll>
	#define sz(x) ((long long)x.size())
	#define fr(a,b,c) for(int a=b; a<=c; a++)
	#define frdec(a,b,c) for(int a=b; a>=c; a--)
	#define rep(a,b,c) for(int a=b; a<c; a++)
	#define trav(a,x) for(auto &a:x)
	#define all(con) con.begin(),con.end()
	const ll infl=2e18;
	const int infi=2e9;
	const int mod=1e9+7;
	typedef vector<int> vi;
	//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> oset;
	mt19937 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
	auto clk=clock();
	int rng(int lim) {
		uniform_int_distribution<int> uid(0,lim-1);
		return uid(rang);
	}
	template<class t1, class t2, class t3>
	t1 fast_expo(t2 x, t3 p) {
		if(p == 0) return 1;
		t1 r = fast_expo(x,p/2);
		if(p%2 != 0) return r * r * x;
		return r * r;
	}
	// Code from here...

	void solve() {
		ll n ,x;
        cin >> n >> x;
        
        cout << ((n-2x) * (n-x) + (n + 2*x));
	}

	signed main() {
		ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
		srand(chrono::high_resolution_clock::now().time_since_epoch().count());
		cout<<fixed<<setprecision(10);
		int t=1;
		// cin>>t;
		while(t--)
			solve();
	#ifdef rd
		cout<<endl<<endl<<"Time elapsed: "<<(double)(clock()-clk)/CLOCKS_PER_SEC<<endl;
	#endif
		return 0;
	}

Compiler output:
a.cc: In function 'void solve()':
a.cc:66:21: error: unable to find numeric literal operator 'operator""x'
   66 |         cout << ((n-2x) * (n-x) + (n + 2*x));
      |                     ^~