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

#include<stdio.h>
int n,a[100010],s=0;
int main()
{
        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)
        s+=a[i];
    printf("%d\n",s);
    return 0;
 } 

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

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,a[210];
int main()
{
	cin>>n;
	for(int i=1;i<=2*n;++i){
		scanf("%d",a+i);
	}
	sort(a+1,a+2*n+1);
	int ans=0;
	for(int i=1;i<=2*n;i+=2){
		ans+=a[i];
	}
	cout<<ans<<endl;
}

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

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

int main(){
  int ans=0,n,array[200];
  cin>>n;
  for(int i=0;i<2n;i++){
    cin>>array[i];
  }
  sort(array,array+2n);
  for(int i=0;i<2n;i+=2){
    ans+=array[i];
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: unable to find numeric literal operator 'operator""n'
    7 |   for(int i=0;i<2n;i++){
      |                 ^~
a.cc:10:20: error: unable to find numeric literal operator 'operator""n'
   10 |   sort(array,array+2n);
      |                    ^~
a.cc:11:17: error: unable to find numeric literal operator 'operator""n'
   11 |   for(int i=0;i<2n;i+=2){
      |                 ^~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: 'n' was not declared in this scope
    7 |     cin>>n;
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[10001],ans=0,bns=0,n;
int main(){
    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)bns+=a[i];。
    printf("%d\n",bns);
    return 0;
}

Compiler output:
a.cc:8:39: error: extended character 。 is not valid in an identifier
    8 |     for(int i=1;i<=2*n;i+=2)bns+=a[i];。
      |                                       ^
a.cc: In function 'int main()':
a.cc:8:39: error: '\U00003002' was not declared in this scope
    8 |     for(int i=1;i<=2*n;i+=2)bns+=a[i];。
      |                                       ^~
Language: C++

#include <iostream>
#include <vector>
#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.at(i);
    }
  	sort(L.begin(). L.end());
  	int ans =0;
  	for(int i = 0; i < N; i++){
      	ans += L.at(2*i);
    }
  	cout << ans;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: 'std::vector<int>::iterator' has no member named 'L'
   15 |         sort(L.begin(). L.end());
      |                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{int n,s=0;
 int a[200];
 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<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: expected ';' before 'for'
    9 |  sort(a,a+2*n)
      |               ^
      |               ;
   10 |  for(int i=0;i<2*n;i+=2)
      |  ~~~           
a.cc:10:14: error: 'i' was not declared in this scope
   10 |  for(int i=0;i<2*n;i+=2)
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[10001],ans=0,bns=0,n;
int main(){
    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){
        bns+=a[i];
    } 
    printf("%d\n",bns);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: expected ';' before '\U0000ff1b'
    5 |     scanf("%d",&n)；
      |                   ^~
      |                   ;
a.cc:6:17: error: 'i' was not declared in this scope
    6 |     for(int i=1;i<=2*n;i++){
      |                 ^
Language: C++

#include<abits/stdc++.h>
using namespace std;
int a[10001],ans=0,bns=0,n;
int main(){
    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){
        bns+=a[i];
    } 
    printf("%d\n",bns);
    return 0;
}

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

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

int main() {
	int n;
	cin >> n;
  	int ans = 0;
  	int arr[2*n];
  	for(int i=0; i<2*n; i++)
      	cin >> arr[i];
  	sort(arr);
  	for(int i=0; i<2*n; i++) {
      	if(i % 2 == 0)
        	ans += arr[i];
    }
  	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: no matching function for call to 'sort(int [(n * 2)])'
   12 |         sort(arr);
      |         ~~~~^~~~~
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:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
Language: C++

//
// Analog Clock
//
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>

void Display(void);
void Reshape(int,int);
void Keyboard(unsigned char, int, int);
void Timer(int);

double Time=90;
int ls, lm, lh; // Length of Needle
int xs, ys;	// Second Hand Coordinate
int xm, ym;	// Minute Hand Coordinate
int xh , yh;	// Second Hand Coordinate
int xc, yc;	// Center Coordinate
double xd, yd;	// Scale of Panel
int ld;		// Radius of Panel
int ld0;	// Radius of Panel Indicate
int tmp[360][2];
double theta;	// Angle
int i ;		// Loop Counter
double tmpx,tmpy;
double maxy=0,miny=1e9;
char wt[20];

int main(int argc, char **argv)
{
	glutInit(&argc, argv);
	glutInitWindowSize (450, 300);
	glutCreateWindow("takeuti");
	glutDisplayFunc(Display);
	glutKeyboardFunc(Keyboard);
	glutReshapeFunc(Reshape);
	glutTimerFunc (1, Timer, 0);
	glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
	glClearColor(0.5, 0.0, 1.0, 1.0);

	glutMainLoop();

	return(0);
}


//
// Update Window Display
//
void Display(void)
{

	ls = 129;
	lm = 120;
	lh = 90;
	ld = ls + 10;
	ld0 = ls-10;

	xc = 150;
	yc = 150;

// Getting Current Time
//	time(&tt);
//	ts = localtime(&tt);
//	 It's 10:40:20 ,now.
	
	// Window Title
	glutSetWindowTitle(wt);

	// Bachground Paint
	glClear(GL_COLOR_BUFFER_BIT);
// Watch face
	for (i = 0 ; i < 360 ; i++)
	{
		theta = 2.0 * M_PI * (double)i / 360.0;
		xd = xc + (int)(ld * sin(theta));
		yd = yc - (int)(ld * cos(theta));
		
		glPointSize (5.0);
		
		tmp[i][0] = xd;
		tmp[i][1] = yd;
		if(maxy < yd) {
			maxy = yd;
		}
		if(miny > yd) {
			miny = yd;
		}
		
	}
	glLineWidth(3.0);
	glBegin(GL_LINE_LOOP);
	for(i = 0; i < 360; i++) {
		glVertex2i(tmp[i][0], tmp[i][1]);
	}
	glEnd();
	glBegin(GL_LINES);
	glVertex2i(340,miny);
	glVertex2i(340,maxy);
	glEnd();
	// Needle
	// Second
	glColor3ub (255, 255, 255);
	theta = M_PI * (double) Time / 180.0;
	double Theta = theta - (M_PI/2);
	tmpx = xc + (int)(ld * sin(theta));
	tmpy= yc - (int)(ld * cos(theta));
	glColor3ub (220 , 220, 220);
	glPointSize(10.0);
	glBegin(GL_POINTS);
	glVertex2d(tmpx , tmpy);
	glVertex2d(340 ,tmpy);
	glEnd();
	printf("x = %d : ",(int)(ld * M_PI * sin(Theta)));
	printf("v = %d : ",(int)(ld * M_PI * cos(Theta)));	
	printf("a = %d\n ",(int)((-1) * ld * M_PI * M_PI * sin(Theta)));

	if(Time == 0) {
		Time = 360;
	}else{
		Time-=0.08;
	}
	// Finish
	glFlush();
	glutSwapBuffers();
}


// Reset Coordinate if occurs Window Resizing
//
void Reshape(int w, int h)
{
	glViewport(0, 0, w, h);
	glMatrixMode(GL_MODELVIEW) ;
	glLoadIdentity();
	gluOrtho2D(0 , w, 0, h);
	glScaled(1, -1, 1);
	glTranslated(0, -h, 0);
	glutReshapeWindow(450, 300); // Window Size Fixing
}

// Timer Interrupt
void Timer(int value)
{
	glutPostRedisplay();
	glutTimerFunc(1, Timer, value);
}
void Keyboard(unsigned char key, int x, int y)
{
	if ((key == 'q') || (key == 27))
	{
		printf("Finished\n");
		exit(0);
	}
}


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

printf("x = %d : ",(int)(ld * M_PI * sin(Theta)));
printf("v = %d : ",(int)(ld * M_PI * cos(Theta)));	
printf("a = %d\n ",(int)((-1) * ld * M_PI * M_PI * sin(Theta)));

Compiler output:
a.cc:1:7: error: expected constructor, destructor, or type conversion before '(' token
    1 | printf("x = %d : ",(int)(ld * M_PI * sin(Theta)));
      |       ^
a.cc:2:7: error: expected constructor, destructor, or type conversion before '(' token
    2 | printf("v = %d : ",(int)(ld * M_PI * cos(Theta)));
      |       ^
a.cc:3:7: error: expected constructor, destructor, or type conversion before '(' token
    3 | printf("a = %d\n ",(int)((-1) * ld * M_PI * M_PI * sin(Theta)));
      |       ^
Language: C++

//
// Analog Clock
//
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>

void Display(void);
void Reshape(int,int);
void Timer(int);

double Time=90;
double 

int main(int argc, char **argv)
{
	glutInit(&argc, argv);
	glutInitWindowSize (450, 300);
	glutCreateWindow("takeuti");
	glutDisplayFunc(Display);
	glutReshapeFunc(Reshape);
	glutTimerFunc (1, Timer, 0);
	glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
	glClearColor(0.5, 0.0, 1.0, 1.0);

	glutMainLoop();

	return(0);
}


//
// Update Window Display
//
void Display(void)
{
	int ls, lm, lh; // Length of Needle
	int xs, ys;	// Second Hand Coordinate
	int xm, ym;	// Minute Hand Coordinate
	int xh , yh;	// Second Hand Coordinate

	int xc, yc;	// Center Coordinate
	double xd, yd;	// Scale of Panel
	int ld;		// Radius of Panel
	int ld0;	// Radius of Panel Indicate
	int tmp[360][2];
	double theta;	// Angle
	int i ;		// Loop Counter
	double tmpx,tmpy;
	double maxy=0,miny=1e9;
	char wt[20];

	ls = 129;
	lm = 120;
	lh = 90;
	ld = ls + 10;
	ld0 = ls-10;

	xc = 150;
	yc = 150;

// Getting Current Time
//	time(&tt);
//	ts = localtime(&tt);
//	 It's 10:40:20 ,now.
	
	// Window Title
	glutSetWindowTitle(wt);

	// Bachground Paint
	glClear(GL_COLOR_BUFFER_BIT);
// Watch face
	for (i = 0 ; i < 360 ; i++)
	{
		theta = 2.0 * M_PI * (double)i / 360.0;
		xd = xc + (int)(ld * sin(theta));
		yd = yc - (int)(ld * cos(theta));
		
		glPointSize (5.0);
		
		tmp[i][0] = xd;
		tmp[i][1] = yd;
		if(maxy < yd) {
			maxy = yd;
		}
		if(miny > yd) {
			miny = yd;
		}
		
	}
	glLineWidth(3.0);
	glBegin(GL_LINE_LOOP);
	for(i = 0; i < 360; i++) {
		glVertex2i(tmp[i][0], tmp[i][1]);
	}
	glEnd();
	glBegin(GL_LINES);
	glVertex2i(340,miny);
	glVertex2i(340,maxy);
	glEnd();
	// Needle
	// Second
	glColor3ub (255, 255, 255);
	theta = M_PI * (double) Time / 180.0;
	tmpx = xc + (int)(ld * sin(theta));
	tmpy= yc - (int)(ld * cos(theta));
	glColor3ub (220 , 220, 220);
	glPointSize(10.0);
	glBegin(GL_POINTS);
	glVertex2d(tmpx , tmpy);
	glVertex2d(340 ,tmpy);
	glEnd();
	if(Time == 0) {
		Time = 360;
	}else{
		Time-=0.80;
	}
	// Finish
	glFlush();
	glutSwapBuffers();
}


// Reset Coordinate if occurs Window Resizing
//
void Reshape(int w, int h)
{
	glViewport(0, 0, w, h);
	glMatrixMode(GL_MODELVIEW) ;
	glLoadIdentity();
	gluOrtho2D(0 , w, 0, h);
	glScaled(1, -1, 1);
	glTranslated(0, -h, 0);
	glutReshapeWindow(450, 300); // Window Size Fixing
}

// Timer Interrupt
void Timer(int value)
{
	glutPostRedisplay();
	glutTimerFunc(5.8, Timer, value);
}


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

//
// Analog Clock
//
#include <GL/glut.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>

void Display(void);
void Reshape(int,int);
void Timer(int);

double Time=360;

int main(int argc, char **argv)
{
	glutInit(&argc, argv);
	glutInitWindowSize (600, 300);
	glutCreateWindow("takeuti");
	glutDisplayFunc(Display);
	glutReshapeFunc(Reshape);
	glutTimerFunc (1, Timer, 0);
	glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
	glClearColor(0.5, 0.0, 1.0, 1.0);

	glutMainLoop();

	return(0);
}


//
// Update Window Display
//
void Display(void)
{
	int ls, lm, lh; // Length of Needle
	int xs, ys;	// Second Hand Coordinate
	int xm, ym;	// Minute Hand Coordinate
	int xh , yh;	// Second Hand Coordinate

	int xc, yc;	// Center Coordinate
	int xd, yd;	// Scale of Panel
	int ld;		// Radius of Panel
	int ld0;	// Radius of Panel Indicate
	int tmp[360][2];
	double theta;	// Angle
	int i ;		// Loop Counter
	double tmpx,tmpy;
	double maxy=0,miny=1e9;
	char wt[20];

	ls = 129;
	lm = 120;
	lh = 90;
	ld = ls + 10;
	ld0 = ls-10;

	xc = 150;
	yc = 150;

// Getting Current Time
//	time(&tt);
//	ts = localtime(&tt);
//	 It's 10:40:20 ,now.
	
	// Window Title
	glutSetWindowTitle(wt);

	// Bachground Paint
	glClear(GL_COLOR_BUFFER_BIT);
// Watch face
	for (i = 0 ; i < 360 ; i++)
	{
		theta = 2.0 * M_PI * (double)i / 360.0;
		xd = xc + (int)(ld * sin(theta));
		yd = yc - (int)(ld * cos(theta));
		
		glPointSize (5.0);
		
		tmp[i][0] = xd;
		tmp[i][1] = yd;
		if(maxy < yd) {
			maxy = yd;
		}
		if(miny > yd) {
			miny = yd;
		}
		
	}
	glLineWidth(3.0);
	glBegin(GL_LINE_LOOP);
	for(i = 0; i < 360; i++) {
		glVertex2i(tmp[i][0], tmp[i][1]);
	}
	glEnd();
	glBegin(GL_LINES);
	glVertex2i(340,miny);
	glVertex2i(340,maxy);
	glEnd();
	// Needle
	// Second
	glColor3ub (255, 255, 255);
	theta = 2.0 * M_PI * (double) Time / 60.0;
	tmpx = xc + (int)(ld * sin(theta));
	tmpy= yc - (int)(ld * cos(theta));
	glColor3ub (220 , 220, 220);
	glPointSize(10.0);
	glBegin(GL_POINTS);
	glVertex2d(tmpx , tmpy);
	glVertex2d(340 ,tmpy);
	glEnd();
	if(Time == 0) {
		Time = 360;
	}else{
		Time-=0.18;
	}
	// Finish
	glFlush();
	glutSwapBuffers();
}


// Reset Coordinate if occurs Window Resizing
//
void Reshape(int w, int h)
{
	glViewport(0, 0, w, h);
	glMatrixMode(GL_MODELVIEW) ;
	glLoadIdentity();
	gluOrtho2D(0 , w, 0, h);
	glScaled(1, -1, 1);
	glTranslated(0, -h, 0);
	glutReshapeWindow(600, 300); // Window Size Fixing
}

// Timer Interrupt
void Timer(int value)
{
	glutPostRedisplay();
	glutTimerFunc(5.8, Timer, value);
}


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

#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
typedef long long ll;
using namespace std;

int main() {
	vector<int> a;
	int N,n;
	scanf("%d", &N);
	for (int i = 0; i < 2 * N - 1; i++) {
		scanf("%d", &n);
		a.push_back(n);
	}
	sort(a.begin(), a.end);
	int sum = 0;
	for (int i = 0; i < N; i++) {
		sum += a[2 * N];
	}
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: no matching function for call to 'sort(std::vector<int>::iterator, <unresolved overloaded function type>)'
   16 |         sort(a.begin(), a.end);
      |         ~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:63: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/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 <iostream>
#include <vector>
using namespace std;

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

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(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 t;
    cin >> t;
    l.push_back(t);
  }

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

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

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


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


#include <GL/glut.h>
#include <stdio.h>
#include <GL/glpng.h>
#include <GL/gl.h>
#include <stdlib.h>


void Display(void);
void Reshape(int, int);
void Mouse(int, int, int, int);
void Keyboard(unsigned char, int, int); // Added
void PassiveMotion(int, int);
void Motion(int, int);
void Entry(int);
void Timer(int);
void PutSprite(int, int, int, pngInfo *);

int XX,YY;
GLuint img1, img2;
pngInfo info1, info2;



int main(int argc, char **argv)
{
	glutInit(&argc, argv);
	glutInitWindowSize(320, 240);
	glutCreateWindow("Mouse Sample");
	glutDisplayFunc(Display);
        glutKeyboardFunc(Keyboard); // Added
	glutReshapeFunc(Reshape);
	glutInitDisplayMode(GLUT_RGBA);
	glClearColor(0.0, 0.0, 1.0, 1.0);


	glutMouseFunc(Mouse);
	glutPassiveMotionFunc(PassiveMotion);
	glutMotionFunc(Motion);
	glutEntryFunc(Entry);

//
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

// PWG
img1 = pngBind("sample1.png", PNG_NOMIPMAP, PNG_ALPHA,
	&info1, GL_CLAMP, GL_NEAREST, GL_NEAREST);
glutDisplayFunc(Display);
glutReshapeFunc (Reshape);
glutTimerFunc(1000, Timer, 0);
//

	glutMainLoop();

	return(0);
}
//
//
void Display(void)
{
int x, y;
//int w, h;


glClear(GL_COLOR_BUFFER_BIT);

//w = glutGet(GLUT_WINDOW_WIDTH);
//h = glutGet(GLUT_WINDOW_HEIGHT);

x = XX;
y = YY;
PutSprite(img1, x, y, &info1);

/*x = random() % w;
y = random() % h;
PutSprite(img2, x, y, &info2);
*/

glFlush();
}
//
//
//
void Reshape(int w, int h)
{
	glViewport(0, 0, w, h);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	gluOrtho2D(0, w, 0, h);
	glScaled(1, -1, 1);
	glTranslated(0, -h, 0);
}
//
//
void Mouse(int b, int s, int x, int y)
{
	if (b == GLUT_LEFT_BUTTON)
	{
	  XX=x;
	  YY=y;
	}

	if (b == GLUT_MIDDLE_BUTTON)
	{
		XX=x;
	  YY=y;
	}

	if (b == GLUT_RIGHT_BUTTON)
	{
	XX=x;
	  YY=y;
	}

	printf(" at (%d, %d) \n", x, y);
}


//
//
//
void PassiveMotion(int x, int y)
{
	printf("PassiveMotion : (x, y) = (%d, %d)\n", x, y);
}
//
//
void Motion(int x, int y)
{
	printf("Motion : (x, y) = (%d, %d)\n", x, y);
}

//
//
void Entry(int s)
{
	if (s == GLUT_ENTERED) printf("Entered\n");
	if (s == GLUT_LEFT ) printf("Exited\n");
}

//
// Processing Key Input
//
void Keyboard(unsigned char key, int x, int y)
{
	if ((key == 'q') || (key == 27))
	{
		printf("Finished\n");
		exit(0);
	}
}

void Timer(int t)
{
glutPostRedisplay();
glutTimerFunc(1000, Timer, 0);
}

void PutSprite(int num, int x, int y, pngInfo *info)
{
int w, h; //

w = info->Width;
h = info->Height;

glPushMatrix();
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, num);
glColor4ub(255, 255, 255, 255);

glBegin(GL_QUADS);

glTexCoord2i(0, 0);
glVertex2i(x, y);

glTexCoord2i(0, 1);
glVertex2i(x, y + h);

glTexCoord2i(1, 1);
glVertex2i(x + w, y + h);

glTexCoord2i(1,0);

glVertex2i(x + w, y);

glEnd();

glDisable(GL_TEXTURE_2D);
glPopMatrix();
}

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

#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
int n, ans;
vector<int> l;
int main() {
    cin >> n;
    for (int i = 1; i <= 2 * n; ++i) {
        int a;
        cin >> a;
        l.push_back(a);
    }
    sort(l.begin(), l.end());
    for (int i = 0; i < 2 * n; i += 2) {
        ans += l[i];
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<int> l;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:15:9: error: 'l' was not declared in this scope
   15 |         l.push_back(a);
      |         ^
a.cc:17:10: error: 'l' was not declared in this scope
   17 |     sort(l.begin(), l.end());
      |          ^
Language: C

#include<cstdio>
#include<algorithm>
using namespace std;
#define Mod 1000000007
#define ll long long
#define tc getchar()
inline int read(void){
    int a=0;static char c;
    while((c=tc)<'0'||c>'9');
    while(c>='0'&&c<='9')a=a*10+c-'0',c=tc;
    return a;
}
ll fac[8005],inv[8005],n,f[4005][4005],x[200005],y[200005],ans,b[4005][4005];
inline ll C(ll n,ll m){
    return (fac[n]*inv[m]%Mod)*inv[n-m]%Mod;
}
int main(){
    int i,j;
    fac[0]=inv[0]=inv[1]=1;
    for(i=2;i<=8004;++i)    
        inv[i]=(Mod-Mod/i)*inv[Mod%i]%Mod;
    for(i=1;i<=8004;++i)
        fac[i]=fac[i-1]*i%Mod,inv[i]=inv[i-1]*inv[i]%Mod;
    n=read();
    for(i=1;i<=n;++i)
        x[i]=read(),y[i]=read(),++f[2001-x[i]][2001-y[i]],++b[2001+x[i]][2001+y[i]];
    for(i=1;i<=4004;++i)
        for(j=1;j<=4004;++j){
            f[i][j]=(f[i][j]+f[i-1][j]+f[i][j-1])%Mod;
            if(b[i][j])ans=(ans+b[i][j]*f[i][j]%Mod)%Mod;
        }
    for(i=1;i<=n;++i)
        ans=(((ans-C((x[i]+y[i])*2,x[i]*2)))%Mod+Mod)%Mod;
    printf("%d",ans*inv[2]%Mod);
    return 0;
}

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

#include <iostream>
using namespace std;

int main(void){
	int n;
	int tmp;
	int sum = 0;
	cin >> n;
	int a[200]={999};
	for(int i=0;i<(2*n)-1;i++){
		for(int j=i;j<(2*n);j++){
			if(a[i]<a[j]){
				tmp=a[i];
				a[i]=a[j];
				a[j]=tmp;
			}
		}
	}
	for(i=1;i<N;i++){
		if(a[2*i]!=999)	sum += a[2*i];
	}
	cout << sum << endl;
	return 0;
}

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

#include <iostream>

int main(void){
	int n;
	int tmp;
	sum = 0;
	cin >> n;
	int a[200]={999};
	for(int i=0;i<(2*n)-1;i++){
		for(int j=i;j<(2*n);j++){
			if(a[i]<a[j]){
				tmp=a[i];
				a[i]=a[j];
				a[j]=tmp;
			}
		}
	}
	for(i=1;i<N;i++){
		if(a[2*i]!=999)	sum += a[2*i];
	}
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'sum' was not declared in this scope
    6 |         sum = 0;
      |         ^~~
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin >> n;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:18:13: error: 'i' was not declared in this scope
   18 |         for(i=1;i<N;i++){
      |             ^
a.cc:18:19: error: 'N' was not declared in this scope
   18 |         for(i=1;i<N;i++){
      |                   ^
a.cc:21:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |         cout << sum << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:21:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |         cout << sum << endl;
      |                        ^~~~
      |                        std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

public class ProblemA {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int[] skewers = new int[n * 2];
        for (int i = 0; i < n * 2; i++) {
            skewers[i] = sc.nextInt();
        }
        Arrays.sort(skewers);

        int sum = 0;
        for (int j = 0; j < n; j++) {
            sum += skewers[j * 2];
        }
        System.out.println(sum);

    }
}


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

import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

public class ProblemA {
    public static void main(String[] args) {
        try {
            Scanner sc = new Scanner(System.in);
            int n = sc.nextInt();

            int[] skewers = new int[n * 2];
            for (int i = 0; i < n * 2; i++) {
                skewers[i] = sc.nextInt();
            }
            Arrays.sort(skewers);

            int sum = 0;
            for (int j = 0; j < n; j++) {
                sum += skewers[j * 2];
            }
            System.out.println(sum);

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}


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

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

public class AtcoderAgc1A {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int [] values = new int[n * 2];
        for (int i = 0; i < n * 2; i++) {
            values[i] = input.nextInt();
        }
        Arrays.sort(values);
        int sum = 0;
        for (int i = 1; i < n * 2; i+=2) {
            sum += Math.min(values[i], values[i - 1]);
        }
        System.out.println(sum);
    }
}


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 AtcoderAgc1A {
      | ^~~~~~
Language: C++

#--- define function ---#
def num_check(n, l):
    if 2 * n == len(l):
        return True
    else:
        return False

#--- main ---#
num = int(input())
l = input().split()
list = [int(i) for i in l]

if not num_check(num, list):
    print("Invalid numbers.")
    exit()

list.sort()

meet = 0
for i in range(num):
    num1 = int(list.pop(0))
    list.pop(0)
    meet += num1

print(meet)


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #--
    1 | #--- define function ---#
      |  ^~
a.cc:8:2: error: invalid preprocessing directive #--
    8 | #--- main ---#
      |  ^~
a.cc:2:1: error: 'def' does not name a type
    2 | def num_check(n, l):
      | ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
using namespace std;
using ll =long long;

int main (void) {
  int N;
  cin >> N;
  int a[N];
  int b=0;
  int sum=0;
  for (int i=0; i<N; i++) {
    cin >> b;
    a[i]=b;
  }
  a.sort();
  for (int i=0; i<N; i=i+2) {
    sum=a[i]+sum;
  }
  cout << sum;
}

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

#include <bits/stdc++.h>
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());
  ll ans = 0;

  for (int i = 0; i < n; ++i) ans += l[2*i];
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'll' was not declared in this scope; did you mean 'l'?
    9 |   ll ans = 0;
      |   ^~
      |   l
a.cc:11:31: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |   for (int i = 0; i < n; ++i) ans += l[2*i];
      |                               ^~~
      |                               abs
a.cc:12:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;

public class ACG001B {
	public static void main(String args[]) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Integer N = Integer.parseInt(br.readLine());
		String L = br.readLine();
		String[] Llist = L.split(" ");

		ArrayList<Integer> numList = new ArrayList<Integer>();
		for(int i = 0; i < N*2; i++){
			numList.add(Integer.parseInt(Llist[i]));
		}
		Collections.sort(numList, Collections.reverseOrder());

		// 降順に並べて上から2つずつ取る
		// 低い方の値を採用して、全部足す
		Integer output = 0;
		for(int i = 0; i < N*2; i++){
			if(i % 2 == 0){
				continue;
			}else{
				output += numList.get(i);
			}
		}
		System.out.println(output);
	}
}

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

#include<iostream>
#include<algorithm>
using namespace std;
int n;
int l[120]={};
int main()
{
	cin>>n;
	for(int i=1;i<=2*n;i++)
	 {
	 	cin>>l[i];
	 }
	 sort(l+1,l+2*n+1);
	 int anss=0;
	 for(int i=1;i<=2*n;i++)
	 if(i%2!=0)
	 {
	  anss+=l[i];
     }
	cout<<anss<<endl;
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int n;
int l[120]={};
int main()
{
	cin>>n;
	for(int i=1;i<=2*n;i++)
	 {
	 	cin>>l[i];
	 }
	 sort(l+1,l+2*n+1);
	 int ans=0;
	 for(int i=1;i<=2*n;i++)
	 if(i%2!=0)
	 {
	  ans+=l[i];
     }
	cout<<ans<<endl;
	return 0;
}

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

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

int n,a[110],b[110],ans=0,minn,k;

int main()
{
	scanf("%d",&n);
	n*=2;
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)
	{
		minn=10000;
		k=0;
	    for(int j=i+1;j<=n;j++)
	    {
	    	if(abs(a[i]-a[j])<minn && a[i]!=10000 && a[j]!=10000)
	    	{
	    		minn=abs(a[i]-a[j]);
	    		k=j;
	    	}
	    }
	    if(a[i]!=10000 && a[k]!=10000)
		{
		    ans+=min(a[i],a[k]);
		    a[i]=10000;
	        a[k]=10000;
	    }
	}
	printf("%d",ans);
	return 0;
}

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

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

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

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

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

#include <bits/stdc++.h>
using namespace std;
const int N=1e4;
    int n,s;
	int a[N];
int main()
{
  cin>>n;
  n*=2;
  for (int i=0;++i<=n;) cin>>a[i];
  sort(a+1,a+n+1);
  for (int i=1;i<=n;i+=2) s+=a[i];
  cout<<s;
  return 0;
}




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

#include<bits/stdc++.h>
using namespace std;
int n,a[2001],sum=0;

inline void init() {
	scanf("%d",&n);
	n*=2;
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	sort(a+1,a+n+1);
}

inline void work() {
	for (int i=1;i<=n;i++) 
		if (i%2==1) 
			sum+=a[i]; 
}

int main() {
	init();
	work();
	printf("%d\n",sum);
	return 0;
}

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

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

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

#include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;
int a[100];
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++)
cin>>a[i];
sort(a.begin().a.end());
int ans;
for(int i=0;i<n;i+=2)
ans+=min(a[i],a[i+1]);
cout<<ans;
system("pause");
return 0;
}

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

input(),print(sum(sorted(list(map(int,input().split())))[::2]))

Compiler output:
a.cc:1:8: error: expected constructor, destructor, or type conversion before ',' token
    1 | input(),print(sum(sorted(list(map(int,input().split())))[::2]))
      |        ^
a.cc:1:14: error: expected constructor, destructor, or type conversion before '(' token
    1 | input(),print(sum(sorted(list(map(int,input().split())))[::2]))
      |              ^
Language: C++

import java.util.*;

public class Main {
    	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n;
		n = sc.nextInt();
		int[] a = new int[2*n];
		for(int i=0; i<2*n; i++) a[i] = sc.nextInt();
		Arrays.sort(a);
		int cnt=0;
		for(int i=0; i<2*n; i+=2) cnt+=a[i];
		System.out.println(cnt);
	}
}


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

gets;p gets.split.map(&:to_i).sort.each_slice(2).map(&:min).inject :+

Compiler output:
a.cc:1:1: error: 'gets' does not name a type
    1 | gets;p gets.split.map(&:to_i).sort.each_slice(2).map(&:min).inject :+
      | ^~~~
a.cc:1:6: error: 'p' does not name a type
    1 | gets;p gets.split.map(&:to_i).sort.each_slice(2).map(&:min).inject :+
      |      ^
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,a[102],cnt=0,;
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=2*n;i++) scanf("%d",&a[i]);
	sort(a+1,a+2*n+1);
	for(int i=1;i<=2*n-1;i+=2) cnt+=min(a[i],a[i+1]);
	printf("%d",cnt);
	return 0;
}


Compiler output:
a.cc:5:20: error: expected unqualified-id before ';' token
    5 | int n,a[102],cnt=0,;
      |                    ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<deque>
#include<caserrt>

using namespace std;

#define sz(x) (int)(x.size())
#define fi(a,b) for(int i=a;i<b;++i)
#define fj(a,b) for(int j=a;j<b;++j)
#define fo(a,b) for(int o=a;o<b;++o)
#define fdi(a,b) for(int i=a-1;i>=b;--i)
#define fdj(a,b) for(int j=a-1;j>=b;--j)
#define fdo(a,b) for(int o=a-1;o>=b;--o)
#define pb push_back
#define mp make_pair
typedef pair<int, int> pii;
typedef long long ll;
/////////////////////////////////

int const N = 241;

int n, l[N], ans;

void solve(){
	sort(l, l+n);
	fi(0, n){
		ans += l[i];
		++i;
	}
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	scanf("%d",&n);
	fi(0, n * 2) scanf("%d",&l[i]);

	solve();
	
	printf("%d\n",ans);

	return 0;
}

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



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

int main(){

	int n;
	cin >> n;
	vector <int> x(2*n);

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

  sort(x.begin(),x.end());
	int answer = 0;
	for(int i = 0;i < n;i++){
		answer = x[2*i];
		cout << answer << endl;
		return 0;
	}
}


Compiler output:
a.cc:16:1: error: extended character   is not valid in an identifier
   16 |   sort(x.begin(),x.end());
      | ^
a.cc: In function 'int main()':
a.cc:16:1: error: '\U000000a0' was not declared in this scope
   16 |   sort(x.begin(),x.end());
      | ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:4: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |    cin >> n;
      |    ^~~
      |    std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:4: error: 'vector' was not declared in this scope
    5 |    vector<int> x(2*n);
      |    ^~~~~~
a.cc:5:4: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:5:11: error: expected primary-expression before 'int'
    5 |    vector<int> x(2*n);
      |           ^~~
a.cc:7:11: error: 'x' was not declared in this scope
    7 |    cin >> x[i];
      |           ^
a.cc:8:9: error: 'x' was not declared in this scope
    8 |    sort(x.begin(), x.end());
      |         ^
a.cc:8:4: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    8 |    sort(x.begin(), x.end());
      |    ^~~~
      |    std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:12:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |    cout << ans << endl;
      |    ^~~~
      |    std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |    cout << ans << endl;
      |                   ^~~~
      |                   std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

1. using namespace std;
2.  
3. int main()
4. {
5.     int n;
6.     cin >> n;
7.     vector<int> x(2*n);
8.     for(int i=0; i<2*n; ++i)
9.         cin >> x[i];
10.  
11.     sort(x.begin(), x.end());
12.     int ans = 0;
13.     for(int i=0; i<n; ++i)
14.         ans += x[2*i];
15.     cout << ans << endl;
16.  
17.     return 0;
18. }

Compiler output:
a.cc:2:4: error: extended character   is not valid in an identifier
    2 | 2.  
      |    ^
a.cc:10:5: error: extended character   is not valid in an identifier
   10 | 10.  
      |     ^
a.cc:16:5: error: extended character   is not valid in an identifier
   16 | 16.  
      |     ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1. using namespace std;
      | ^~
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2.  
      | ^~
Language: C++

//InTheNameOfGod
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,j,k) for(int i=j;i<k;++i)
#define rrep(i,j,k) for(int i=j;i>=k;i--)
#define pb push_back
#define lb(i) i&(-i);
const int maxn =2e6+6;
int n,a[maxn];
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);
    cin>>n;
    rep(i,0,n)cin>>a[i];
    sort(a,a+n)cin>>a[i];
    int re=0;
    rep(i,0,n)
    {
        if(i%2==0)re+=a[i];
    }
    cout<<re;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: expected ';' before 'cin'
   16 |     sort(a,a+n)cin>>a[i];
      |                ^~~
      |                ;
Language: C++

//InTheNameOfGod
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,j,k) for(int i=j;i<k;++i)
#define rrep(i,j,k) for(int i=j;i>=k;i--)
#define pb push_back
#define lb(i) i&(-i);
const int maxn =2e6+6;
int n,a[maxn];
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);
    cin>>n;
    rep(i,0,n)cin>>a[i];
    sort(a,a+n);
    int re=0
    rep(i,0,n)
    {
        if(i%2==0)re+=a[i];
    }
    cout<<re;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: expected ',' or ';' before 'for'
    5 | #define rep(i,j,k) for(int i=j;i<k;++i)
      |                    ^~~
a.cc:18:5: note: in expansion of macro 'rep'
   18 |     rep(i,0,n)
      |     ^~~
a.cc:18:9: error: 'i' was not declared in this scope
   18 |     rep(i,0,n)
      |         ^
a.cc:5:32: note: in definition of macro 'rep'
    5 | #define rep(i,j,k) for(int i=j;i<k;++i)
      |                                ^
Language: C++

#include <iostream>
#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];
	int s=0;
	sort(a,a+2*n);
	for(int i=0;i<2*n;i+=2)
	s=(a[i]>a[i+1])?s+a[i+1]:s+a[i]);
	cout << s;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:40: error: expected ';' before ')' token
   14 |         s=(a[i]>a[i+1])?s+a[i+1]:s+a[i]);
      |                                        ^
      |                                        ;
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int a[2n];
	for(int i=0;i<2n;i++)
	cin>>a[i];
	int s=0;
	sort(a,a+2n);
	for(int i=0;i<2n;i++)
	s=s+((a[i]>a[i+1])?a[i+1]:a[i]);
	cout << s;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: unable to find numeric literal operator 'operator""n'
    8 |         int a[2n];
      |               ^~
a.cc:9:23: error: unable to find numeric literal operator 'operator""n'
    9 |         for(int i=0;i<2n;i++)
      |                       ^~
a.cc:10:14: error: 'a' was not declared in this scope
   10 |         cin>>a[i];
      |              ^
a.cc:12:14: error: 'a' was not declared in this scope
   12 |         sort(a,a+2n);
      |              ^
a.cc:12:18: error: unable to find numeric literal operator 'operator""n'
   12 |         sort(a,a+2n);
      |                  ^~
a.cc:13:23: error: unable to find numeric literal operator 'operator""n'
   13 |         for(int i=0;i<2n;i++)
      |                       ^~
Language: C++

include <iostream>
#include <algoithm>
using namespace std;
int main()
{
	int n;
	cin >> n;
	int a[2n];
	for(int i=0;i<2n;i++)
	cin>>a[i];
	int s=0;
	sort(a,a+2n);
	for(int i=0;i<2n;i++)
	s=s+((a[i]>a[i+1])?a[i+1]:a[i]);
	cout << s;
	
}

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