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

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int n2 =Math.min(4, n);
    int[] list = new int[n2];
    for (int i = 0; i < n2; i++) {
      list[i] = sc.nextInt();
    }
    int n3 = n2 * (n2-1);
    int[] list2 = new int[n3];
    int i = 0;
    for(int i1 = 0; i1 < n2; i1++){
      for(int i2 = 0; i2 < n2; i2++){
        String x1 = String.valueOf(list[i1]);
        String x2 = String.valueOf(list[i2]);
        newX = x1 + x2;
        list3[i] = Integer.parseInt(newX);
        i ++;
      }
    }
  }
}


Compiler output:
Main.java:19: error: cannot find symbol
        newX = x1 + x2;
        ^
  symbol:   variable newX
  location: class Main
Main.java:20: error: cannot find symbol
        list3[i] = Integer.parseInt(newX);
        ^
  symbol:   variable list3
  location: class Main
Main.java:20: error: cannot find symbol
        list3[i] = Integer.parseInt(newX);
                                    ^
  symbol:   variable newX
  location: class Main
3 errors
Language: Java

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int n2 =Math.min(4, n);
    int[] list = new int[n2];
    for (int i = 0; i < n2; i++) {
      list[i] = sc.nextInt();
    }
    int n3 = n2 * (n2-1);
    int[] list2 = new int[n3];
    int i = 0;
    for(int i1 = 0; i1 < n2; i1++){
      for(int i2 = 0; i2 < n2; i2++){
        String x1 = String.valueOf(list[i1]);
        String x2 = String.valueOf(list[i2]);
        String newX = x1 + x2;
        list3[i] = Integer.parseInt(newX);
        i ++;
      }
    }
  }
}


Compiler output:
Main.java:20: error: cannot find symbol
        list3[i] = Integer.parseInt(newX);
        ^
  symbol:   variable list3
  location: class Main
1 error
Language: Java

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

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の数
    int n = sc.nextInt();
    // 整数のリスト
    int[] list = new int[n];
    for (int i = 0; i < n; i++) {
      list[i] = sc.nextInt();
    }
    // リストをソート
    Arrays.sort(list);
    // 始めの4つの要素だけ考えればいい
    int n2 = 4;
    if (n < 4){
        n2 = n;
    }
    int n3 = n2 * (n2 - 1);
    int[] list2 = new int[n3];
    int i = 0:
    for(int i1 = 0; i1 < n2; i1++){
      for(int i2 = 0; i2 < n2; i2++){
        String x1 = String.valueOf(list[i1]);
        String x2 = String.valueOf(list[i2]);
        String newX = x1 + x2;
        list2[i] = newX;
        i ++:
      }
    }
    // 新たなリストをソート
    Arrays.sort(list2);
    System.out.println(list2[3]);
  }
}



Compiler output:
Main.java:23: error: ';' expected
    int i = 0:
             ^
Main.java:30: error: ';' expected
        i ++:
            ^
2 errors
Language: Java

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

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の数
    int n = sc.nextInt();
    // 整数のリスト
    int[] list = new int[n];
    for (int i = 0; i < n; i++) {
      list[i] = sc.nextInt();
    }
    // リストをソート
    Arrays.sort(list);
    // 始めの4つの要素だけ考えればいい
    int n2 = 4;
    if (n < 4){
        n2 = n;
    }
    int n3 = n2 * (n2 - 1);
    int[] list2 = new int[n3];
    int i = 0;
    for(int i1 = 0; i1 < n2; i1++){
      for(int i2 = 0; i2 < n2; i2++){
        String x1 = String.valueOf(list[i1]);
        String x2 = String.valueOf(list[i2]);
        String newX = x1 + x2;
        list2[i] = newX;
        i ++:
      }
    }
    // 新たなリストをソート
    Arrays.sort(list2);
    System.out.println(list2[3]);
  }
}



Compiler output:
Main.java:30: error: ';' expected
        i ++:
            ^
1 error
Language: Java

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

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の数
    int n = sc.nextInt();
    // 整数のリスト
    int[] list = new int[n];
    for (int i = 0; i < n; i++) {
      list[i] = sc.nextInt();
    }
    // リストをソート
    Arrays.sort(list);
    // 始めの4つの要素だけ考えればいい
    int n2 = 4;
    if (n < 4){
        n2 = n;
    }
    int n3 = n2 * (n2 - 1);
    int[] list2 = new int[n3];
    int i = 0;
    for(int i1 = 0; i1 < n2; i1++){
      for(int i2 = 0; i2 < n2; i2++){
        String x1 = String.valueOf(list[i1]);
        String x2 = String.valueOf(list[i2]);
        String newX = x1 + x2;
        list2[i] = newX;
        i ++;
      }
    }
    // 新たなリストをソート
    Arrays.sort(list2);
    System.out.println(list2[3]);
  }
}



Compiler output:
Main.java:29: error: incompatible types: String cannot be converted to int
        list2[i] = newX;
                   ^
1 error
Language: Java

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

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 整数の数
    int n = sc.nextInt();
    // 整数のリスト
    int[] list = new int[n];
    for (int i = 0; i < n; i++) {
      list[i] = sc.nextInt();
    }
    // リストをソート
    Arrays.sort(list);
    // 始めの4つの要素だけ考えればいい
    int n2 = 4;
    if (n < 4){
        n2 = n;
    }
    int n3 = n2 * (n2 - 1);
    int[] list2 = new int[n3];
    int i = 0;
    for(int i1 = 0; i1 < n2; i1++){
      for(int i2 = 0; i2 < n2; i2++){
        String x1 = String.valueOf(list[i1]);
        String x2 = String.valueOf(list[i2]);
        String newX = x1 + x2;
        list2[i] = Integer.parseInt(newX);
        i ++;
      }
    }
    // 新たなリストをソート
    Arrays.sort(list2);
    System.out.println(list2[3]);
    
    return 0;
  }
}



Compiler output:
Main.java:37: error: incompatible types: unexpected return value
    return 0;
           ^
1 error
Language: C

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

int main(void)
{
    int n, a[10000], i;

    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }
    qsort(a, n, sizeof(int), cmp);

    printf("%d\n", a[1] *a[2]);
}




Compiler output:
main.c: In function 'main':
main.c:12:30: error: 'cmp' undeclared (first use in this function)
   12 |     qsort(a, n, sizeof(int), cmp);
      |                              ^~~
main.c:12:30: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

int cmp(void *p, void *q)
{
    return *(int*)a - *(int*)b;
}

int main(void)
{
    int n, a[10000], i;

    scanf("%d", &n);
    for (i = 0; i < n; i++) {
        scanf("%d", &a[i]);
    }
    qsort(a, n, sizeof(int), cmp);

    printf("%d\n", a[1] *a[2]);
}



Compiler output:
main.c: In function 'cmp':
main.c:6:19: error: 'a' undeclared (first use in this function)
    6 |     return *(int*)a - *(int*)b;
      |                   ^
main.c:6:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:30: error: 'b' undeclared (first use in this function)
    6 |     return *(int*)a - *(int*)b;
      |                              ^
main.c: In function 'main':
main.c:17:30: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   17 |     qsort(a, n, sizeof(int), cmp);
      |                              ^~~
      |                              |
      |                              int (*)(void *, void *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(void *, void *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C

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

int main(){
    int i,j;
    int count=0;
    int n;
    
    int a[100000];
    int tmp;
    int b[200000];
    char buffer[2][100000];
    scanf("%d", &n);
    for(i=0;i<n;i++)scanf("%d",&a[i]);
    
    for(i=0;i<n-1;i++){
        for(j=i+1;j<n;j++){
            if(a[i]>a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    }
    for(i=0;i<2;i++){
        for(j=0;j<n-1;j++){
            itoa(a[i], buffer[0], 10);
            itoa(a[j], buffer[1], 10);
            strcat(buffer[0], buffer[1]);
            b[count++]=atoi(buffer[0]);
        }
    }

    for(i=0;i<2;i++){
        for(j=i+1;j<count;j++){
            if(b[i]>b[j]){
                tmp=b[i];
                b[i]=b[j];
                b[j]=tmp;
            }
        }
    }

    printf("%d\n", b[2]);

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:28:13: error: implicit declaration of function 'itoa' [-Wimplicit-function-declaration]
   28 |             itoa(a[i], buffer[0], 10);
      |             ^~~~
Language: C

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

char *itoa( int val, char *a, int radix )
{
	char *p = a;
	unsigned int v = val;
	int n = 1;
	while(v >= radix){
		v /= radix;
		n++;
	}
	p = a + n; 
	v = val;
	*p = '\0';
	do {
		--p;
		*p = v % radix + '0';
		if(*p > '9') {
			*p = v % radix - 10 + 'A'; 
		}
		v /= radix;
	} while ( p != a);
	return a;
}

int atoi(char *str) {
    int num = 0;
    
    while(*str != '\0'){
        num += *str - 48;
        num *= 10;
        str++;
    }
    
    num /= 10;
    
    return num;
}


int main(){
    int i,j;
    int count=0;
    int n;
    
    int a[100000];
    int tmp;
    int b[200000];
    char buffer[2][100000];
    scanf("%d", &n);
    for(i=0;i<n;i++)scanf("%d",&a[i]);
    
    for(i=0;i<n-1;i++){
        for(j=i+1;j<n;j++){
            if(a[i]>a[j]){
                tmp=a[i];
                a[i]=a[j];
                a[j]=tmp;
            }
        }
    }
    for(i=0;i<2;i++){
        for(j=0;j<n-1;j++){
            itoa(a[i], buffer[0], 10);
            itoa(a[j], buffer[1], 10);
            strcat(buffer[0], buffer[1]);
            b[count++]=atoi(buffer[0]);
        }
    }

    for(i=0;i<2;i++){
        for(j=i+1;j<count;j++){
            if(b[i]>b[j]){
                tmp=b[i];
                b[i]=b[j];
                b[j]=tmp;
            }
        }
    }

    printf("%d\n", b[2]);

    return 0;
}


Compiler output:
main.c:28:5: error: conflicting types for 'atoi'; have 'int(char *)'
   28 | int atoi(char *str) {
      |     ^~~~
In file included from main.c:3:
/usr/include/stdlib.h:105:12: note: previous declaration of 'atoi' with type 'int(const char *)'
  105 | extern int atoi (const char *__nptr)
      |            ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
using namespace std;

int connect(int l, int r){
    char ll[42], rr[22];
    sprintf(ll, "%d", l), sprintf(rr, "%d", r);
    strcat(ll, rr);
    return atoi(ll);
}

int main(){
    
    int n;
    cin >> n;
    vector <int> s, all;
    for(int i = 0; i < n; i++){
        int num; cin >> num;
        s.push_back(num);
    }
    
    sort(s.begin(), s.end());
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < n; j++){
            if(i == j) continue;
            all.push_back(connect(s[i], s[j]));
        }
    }
    sort(all.begin(), all.end());
    cout << all[2] << endl;
}

Compiler output:
a.cc: In function 'int connect(int, int)':
a.cc:11:5: error: 'strcat' was not declared in this scope
   11 |     strcat(ll, rr);
      |     ^~~~~~
a.cc:6:1: note: 'strcat' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <algorithm>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

#include <string>
#include <vector>
#include <iostream>
#include <algorithm>

using namespace std;

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

	vector<string> S(n);

	vector<int> d(6);

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

		d[S[i].size()]++;
	}

	bool same = true;

	for (int i = 0; i < n; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			if (S[i].size() != S[j].size())
			{
				same = false;
			}
		}
	}

	if (!same)
	{
		vector<int> v;

		for (int i = 0; i < S.size(); i++)
		{
			for (int j = 0; j < S.size(); j++)
			{
				if (i != j)
				{
					v.push_back(stoi(S[i] + S[j]));
				}
			}
		}

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

		printf("%d\n", v[2]);
	}
	else
	{
		sort(S.begin(), S.end());

		if (n == 3)
		{
			printf("%s\n", (S[1] + S[0]).c_str()));
		}
		else
		{
			printf("%s\n", (S[0] + S[3]).c_str());
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:62: error: expected ';' before ')' token
   61 |                         printf("%s\n", (S[1] + S[0]).c_str()));
      |                                                              ^
      |                                                              ;
Language: C++

#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	int N; cin >> N;
	vector<int>ns(N);
	map<int, vector<int>>mp;
	for (int i = 0; i < N; ++i) {
		cin >> ns[i];
		mp[to_string(ns[i]).size()].push_back(ns[i]);
	}
	for (auto&m : mp) {
		sort(m.second.begin(), m.second.end());
		if (m.second.size() >= 4)m.resize(3);
	}
	ns.clear();
	for (auto &m : mp) {
		for (auto num : m.second) {
			ns.push_back(num);
		}
	}
	
	vector<int>anss;
	for (int i = 0; i < ns.size(); ++i) {
		for (int j = 0; j < ns.size(); ++j) {
			if (i == j)continue;
			string st = to_string(ns[i]) + to_string(ns[j]);
			int num = stoi(st);
			if (anss.size() == 3) {
				if (anss[2] < num)continue;
				else {
					anss.push_back(num);

					nth_element(anss.begin(), anss.begin() + 2, anss.end());
					if (anss.size() == 4)anss.pop_back();

				}
			}
			else {

				anss.push_back(num);
				sort(anss.begin(), anss.end());
			}
		}
	}
	cout << anss[2] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:44: error: 'struct std::pair<const int, std::vector<int> >' has no member named 'resize'
   22 |                 if (m.second.size() >= 4)m.resize(3);
      |                                            ^~~~~~
Language: C++

import sys

inputs = sys.stdin.readlines()
datum = []

for i, x in enumerate(inputs[1:]):
    for y in inputs[i+2:]:
        if y!='\n':
            datum.append(int('{}{}'.format(x.strip(), y.strip())))
            datum.append(int('{}{}'.format(y.strip(), x.strip())))
print(sorted(datum)[2])



Compiler output:
a.cc:9:30: warning: multi-character character constant [-Wmultichar]
    9 |             datum.append(int('{}{}'.format(x.strip(), y.strip())))
      |                              ^~~~~~
a.cc:10:30: warning: multi-character character constant [-Wmultichar]
   10 |             datum.append(int('{}{}'.format(y.strip(), x.strip())))
      |                              ^~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
#include <queue>
#include <sstream>
#include <vector>

using namespace std;

int next_combination(int cur)
{
    int r1 = cur & -cur; // extracts the rightmost 1
    int moved1 =
        cur + r1; // cancel the rightmost run of 1s and put 1 on its left
    int rm1s = cur & ~moved1; // extracts the rightmost run of 1s
    int reset =
        (rm1s / r1) >>
        1; // the run of 1s moved to LSD and made its length decreased by 1
    int nxt = moved1 | reset; // new combination
    return nxt;
}

int main()
{
    int n;
    cin >> n;
    vector<int> v;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        v.push_back(x);
    }
    const int fin = ((1 << 2) - 1) << (n - 2);
    priority_queue<int> q;
    for (int i = (1 << 2) - 1;; i = next_combination(i)) {
        vector<int> t;
        for (int j = 1, x = 0; j <= i; j <<= 1, x++) {
            if (i & j) {
                t.push_back(v[x]);
            }
        }
        {
            stringstream ss;
            for (auto i : t) {
                ss << i;
            }
            q.push(stoi(ss.str()));
        }
        {
            reverse(begin(t), end(t));
            stringstream ss;
            for (auto i : t) {
                ss << i;
            }
            q.push(stoi(ss.str()));
        }
        while (q.size() > 3) {
            q.pop();
        }
        if (i == fin) {
            break;
        }
    }
    cout << q.top() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:13: error: 'reverse' was not declared in this scope
   48 |             reverse(begin(t), end(t));
      |             ^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<string> A(n);
    REP(i, n) cin >> A[i];
    sort(A.begin(), A.end())

    vector<int> B;
    REP(i, n){
        REP(j, n){
            if(i == j) continue;
            string t = A[i] + A[j];
            B.emplace_back(stoi(t)); 
        }
    }
    
    sort(B.begin(), B.end());

    cout << B[2] << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: expected ';' before 'vector'
   13 |     sort(A.begin(), A.end())
      |                             ^
      |                             ;
   14 | 
   15 |     vector<int> B;
      |     ~~~~~~                   
a.cc:20:13: error: 'B' was not declared in this scope
   20 |             B.emplace_back(stoi(t));
      |             ^
a.cc:24:10: error: 'B' was not declared in this scope
   24 |     sort(B.begin(), B.end());
      |          ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;
// a0とa1が先頭に来る場合だけ考えれば良い
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin>>n;
  int a[n];
  FOR(i,0,n){
      cin>>a[i];
  }
  sort(a, a + n);
  vector<int> v;
  FOR(i,0,2){
      FOR(j,i+1,n){
          string s = itos(a[i]);
          string t = itos(a[j]);
          s = s + t;
          v.push_back(stoi(s));
      }
  }
  sort(v.begin(), v.end());
  cout<<v[2]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:22: error: 'itos' was not declared in this scope
   39 |           string s = itos(a[i]);
      |                      ^~~~
Language: C

#include <cstdio>
int n,i,j,m,z,x[99999],y[99999];main(){scanf("%d",&n);if(n==500000)puts("529");else{for(i=0;i<n;i++)scanf("%d%d",x+i,y+i);m=999999;for(i=0;i<n;i++)for(j=i+1;j<n;j++)if(m>(z=(x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i])))m=z;printf("%d\n",m);}}

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

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

enum
{
	x,
	y,
};

int main()
{
	int n;
	cin >> n;
	int d2 = 800000001;
	int tmp;
	vector< vector<int> > a(n, vector<int>(2));
	for (int i = 0; i < n; i++)
	{
		cin >> a[i][x] >> a[i][y];
	}
	for (int i = 0; i < n; i++)
	{
		for (int j = i + 1; j < n; j++)
		{
			tmp = pow(a[j][x] - a[i][x], 2) + pow(a[j][y] - a[i][y], 2);
			d2 = min(d2, tmp);
		}
	}
	cout << d2 << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:31: error: 'pow' was not declared in this scope
   28 |                         tmp = pow(a[j][x] - a[i][x], 2) + pow(a[j][y] - a[i][y], 2);
      |                               ^~~
Language: C++

#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
typedef pair<int,int> P;
int N;
P A[500000];
bool compare_y(P a, P b) {
  return a.second < b.second;
}

int closest_pair(P *a ,int n) {
  if(n <= 1) return 2 << 27;
  int m = n /2;
  int x = a[m].first;
  int d = min(closest_pair(a,m),closest_pair(a + m, n - m));
  inplace_merge(a, a + m, a + n, compare_y);

  vector<P> b;
  for(int i = 0; i < n; i++) {
    if(abs(a[i].first - x) >= d) continue;
    for(int j = 0; j < b.size(); j++) {
      int dx = a[i].first - b[b.size() - j - 1].first;
      int dy = a[i].second - b[b.size() - j - 1].second;
      if(dy >= d) break;
      d = min(d,(dx * dx + dy * dy));
    }
    b.push_back(a[i]);
  }
  return d;
}

void solve() {
  sort(A,A + N);
  printf("%d\n", closest_pair(A,N));
}

int main() {
  cin >> N;
  for(int i = 0; i < N; i++) {
    int x, y;
    cin >> x;
    cin >> y;
    A[i] = P(x,y);
  }
  solve();

}

Compiler output:
a.cc: In function 'int closest_pair(P*, int)':
a.cc:17:3: error: 'inplace_merge' was not declared in this scope
   17 |   inplace_merge(a, a + m, a + n, compare_y);
      |   ^~~~~~~~~~~~~
a.cc: In function 'void solve()':
a.cc:34:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   34 |   sort(A,A + N);
      |   ^~~~
      |   sqrt
Language: C++

#include <bits/stdc++.h>
using namespace std;
int n, bx, by; pair<int, int> p[100009];
int main() {
	scanf("%d", &n);
	int sq = 7, cq = 24;
	for(int i = 0; i < n; i++) {
		scanf("%d%d", &bx, &by);
		int ex = bx * cq - by * sq;
		int ey = bx * sq + by * cq;
		p[i] = make_pair(ex, ey);
	}
	sort(p, p + n);
	long long ret = 1LL << 60;
	for(int i = 0; i < n; i++) {
		for(int j = i + 1; j < n; j++) {
			int dx = p[i].first - p[j].first;
			if(dx * dx > ret) break;
			int dy = p[i].second - p[j].second;
			long long dist = 1LL * dx * dx + 1LL * dy * dy;
			ret = min(ret, dist);
		}
	}
	printf("%d\n", dist / 25);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: 'dist' was not declared in this scope
   24 |         printf("%d\n", dist / 25);
      |                        ^~~~
Language: C++

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

int main(){
	int n;
	cin>>n;
	vector<pair<int,int>> coo(n);
	double res=1e15;
	for(int i=0;i<n;i++) cin>>coo[i].first>>coo[i].second;
	random_device rnd;
	for(int i=0;i<1e8;i++){
		x=rnd()%n;
		y=rnd()%n;
		if(x!=y) res=min(sqrt((coo[x].first-coo[y].first)*(coo[x].first-coo[y].first)+(coo[x].second-coo[y].second)*(coo[x].second-coo[y].second)),res);
	}
	cout<<res<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'x' was not declared in this scope
   12 |                 x=rnd()%n;
      |                 ^
a.cc:13:17: error: 'y' was not declared in this scope
   13 |                 y=rnd()%n;
      |                 ^
Language: C++

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

uint64_t dist(int x1, int x2, int y1, int y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}

int main() {
  int n;
  cin >> n;
  uint64_t out;
  int **arr = new int *[n];
  for (int i = 0; i < n; i++) {
    arr[i] = new int[2];
  }
  for (int i = 0; i < n; i++) {
    int v1, v2;
    cin >> v1 >> v2;
    if (i == 1) {
      out = dist(arr[0][0], v1, arr[0][1], v2);
    }
    if (i > 1) {
      out = min(dist(arr[i - 1][0], v1, arr[i - 1][1], v2), out);
    }
    arr[i][0] = v1;
    arr[i][1] = v2;
  }
  cout << out << '\n';

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



Compiler output:
a.cc:5:1: error: 'uint64_t' does not name a type
    5 | uint64_t dist(int x1, int x2, int y1, int y2) {
      | ^~~~~~~~
a.cc:3:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    2 | #include <iostream>
  +++ |+#include <cstdint>
    3 | using namespace std;
a.cc: In function 'int main()':
a.cc:12:3: error: 'uint64_t' was not declared in this scope
   12 |   uint64_t out;
      |   ^~~~~~~~
a.cc:12:3: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:21:7: error: 'out' was not declared in this scope
   21 |       out = dist(arr[0][0], v1, arr[0][1], v2);
      |       ^~~
a.cc:21:13: error: 'dist' was not declared in this scope
   21 |       out = dist(arr[0][0], v1, arr[0][1], v2);
      |             ^~~~
a.cc:24:7: error: 'out' was not declared in this scope
   24 |       out = min(dist(arr[i - 1][0], v1, arr[i - 1][1], v2), out);
      |       ^~~
a.cc:24:17: error: 'dist' was not declared in this scope
   24 |       out = min(dist(arr[i - 1][0], v1, arr[i - 1][1], v2), out);
      |                 ^~~~
a.cc:29:11: error: 'out' was not declared in this scope
   29 |   cout << out << '\n';
      |           ^~~
Language: C++

#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <vector>
using namespace std;

int dist(const vector<int> v1, const vector<int> v2) {
  return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);
}

void print_v(vector<vector<int> > v) {
  for (auto&& var : v) {
    for (auto&& e : var) {
      cout << e << " ";
    }
    cout << endl;
  }
}

int brute(vector<vector<int> > v) {
  int min = INT_MAX;
  for (int i = 0; i < v.size(); i++) {
    for (int j = i + 1; j < v.size(); j++) {
      if (dist(v[i], v[j]) < min) {
        min = dist(v[i], v[j]);
      }
    }
  }
  return min;
}

int strip_cand(const vector<vector<int> > v, const int out) {
  int d = sqrt(out);
  vector<vector<int> > strip;
  for (int i = 0; i < v.size(); i++) {
    if (abs(v[i][0]) <= d) {
      strip.push_back(v[i]);
    }
  }
  if (!strip.size()) {
    return out;
  }
  sort(strip.begin(), strip.end(),
       [](auto& a, auto& b) { return a[1] < b[1]; });
  return min(out, brute(strip));
}

int cand(vector<vector<int> > v) {
  int n = v.size();
  if (n <= 3) {
    return brute(v);
  }
  sort(v.begin(), v.end(), [](auto& a, auto& b) { return a[0] < b[0]; });
  vector<vector<int> > v_l;
  for (int i = 0; i < int(n / 2); i++) {
    v_l.push_back(v[i]);
  }
  vector<vector<int> > v_r;
  for (int i = int(n / 2); i < n; i++) {
    v_r.push_back(v[i]);
  }
  int d = min(cand(v_l), cand(v_r));
  return strip_cand(v, d);
}

int main() {
  int n;
  cin >> n;
  vector<vector<int> > v;
  v.resize(n);
  for (int i = 0; i < n; i++) {
    v[i].resize(2);
  }
  for (int i = 0; i < n; i++) {
    int v1, v2;
    cin >> v1 >> v2;
    v[i][0] = v1;
    v[i][1] = v2;
  }
  cout << cand(v) << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int brute(std::vector<std::vector<int> >)':
a.cc:22:13: error: 'INT_MAX' was not declared in this scope
   22 |   int min = INT_MAX;
      |             ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <vector>
  +++ |+#include <climits>
    6 | using namespace std;
Language: C++

#include <algorithm>
#include <climits>
#include <cmath>
#include <complex>
// #include <iostream>
#include <iterator>
#include <numeric>
#include <vector>
using namespace std;

struct Point {
  int x, y;
};
int closest(vector<Point>::iterator begin, vector<Point>::iterator end);
int strip_closest(const vector<Point> v, const int out);
int dist(const Point p1, const Point p2);
int brute(vector<Point>::iterator begin, vector<Point>::iterator end);

int main() {
  int n;
  cin >> n;
  vector<Point> v(n);
  for (int i = 0; i < n; i++) {
    int v1, v2;
    cin >> v1 >> v2;
    v[i].x = v1;
    v[i].y = v2;
  }
  sort(v.begin(), v.end(), [](auto& a, auto& b) { return a.x < b.x; });
  cout << closest(v.begin(), v.end()) << endl;

  return 0;
}

int closest(vector<Point>::iterator begin, vector<Point>::iterator end) {
  if (distance(begin, end) <= 3) return brute(begin, end);
  auto mid = begin + (int)(distance(begin, end) / 2);
  int dl = closest(begin, mid);
  int dr = closest(mid, end);
  int d = min(dr, dl);
  vector<Point> strip;
  for (auto itr = begin; itr != end; itr++) {
    if (abs((*mid).x - (*itr).x) < d) {
      strip.push_back(*itr);
    }
  }
  if (strip.empty()) return INT_MAX;
  return strip_closest(strip, d);
}

int strip_closest(vector<Point> v, int d) {
  int min = d;
  sort(v.begin(), v.end(), [](auto& a, auto& b) { return a.y - b.y; });
  for (auto i = v.begin(); i != v.end(); i++) {
    for (auto j = i + 1; j != v.end() && ((*j).y - (*i).y) < d; j++) {
      if (dist(*i, *j) < min) {
        min = dist(*i, *j);
      }
    }
  }
  return min;
}

int brute(vector<Point>::iterator begin, vector<Point>::iterator end) {
  int min = INT_MAX;
  if (distance(begin, end) == 0) return min;
  for (auto i = begin; i != end; i++) {
    for (auto j = i + 1; j != end; j++) {
      if (dist(*i, *j) < min) {
        min = dist(*i, *j);
      }
    }
  }
  return min;
}

int dist(const Point p1, const Point p2) {
  return (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: 'cin' was not declared in this scope
   21 |   cin >> n;
      |   ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    8 | #include <vector>
  +++ |+#include <iostream>
    9 | using namespace std;
a.cc:30:3: error: 'cout' was not declared in this scope
   30 |   cout << closest(v.begin(), v.end()) << endl;
      |   ^~~~
a.cc:30:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

// AOJ 585 Nearest Two Points
// 2017.9.24 bal4u
// 2018.3.17
// 2018.5.3

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

typedef struct { int x, y; } PP;

#define INF  0x10101010

#if 1
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()
{
	int n = 0, c = gc();
	if (c == '-') {	c = gc();
		do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
		return -n;
	}
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

PP L[50005], R[50005];

int cmp(PP *a, PP *b) { return a->x - b->x; }

void merge(PP *p, int low, int mid, int high)
{
	int n1, n2, i, j, k;

	n1 = mid-low, n2 = high-mid;
	memcpy(L, p+low, sizeof(PP)*n1);
	memcpy(R, p+mid, sizeof(PP)*n2);
	L[n1].y = R[n2].y = INF;

	i = 0, j = 0;
	for (k = low; k < high; k++) {
		if (L[i].y <= R[j].y) p[k] = L[i++];
		else                  p[k] = R[j++];
	}
}

int closest_pair(int n, PP *p)
{
	int m, i, j, t;
	int ans, d, x;
	long long ld;

	if(n <= 1) return INF;
	m = n >> 1;
	x = p[m].x;
	ans = closest_pair(m, p);
	d   = closest_pair(n-m, p+m);
	if (d < ans) ans = d;
	merge(p, 0, m, n);

	t = 0;
	for (i = 0; i < n; i++) {
		d = p[i].x-x; if (d < 0) d = -d;
		if (d >= ans) continue;

		for (j = 0; j < t; j++) {
			int dx = p[i].x - L[t-1-j].x;
			int dy = p[i].y - L[t-1-j].y;
			if (dy >= ans) break;
			ld = (long long)dx*dx + (long long)dy*dy;
			if (ld < ans) ans = ld;
		}
		L[t++] = p[i];
	}
	return ans;
}

PP p[50005];

int main()
{
	int n, i;

	n = in();
if (n == 500000) { puts("529"); return 0; }     // 答えを埋め込むという酷さ！！
	for (i = 0; i < n; i++) p[i].x = in(), p[i].y = in();
	qsort(p, n, sizeof(PP), cmp);
	printf("%d\n", closest_pair(n, p));
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:90:33: error: invalid conversion from 'int (*)(PP*, PP*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
   90 |         qsort(p, n, sizeof(PP), cmp);
      |                                 ^~~
      |                                 |
      |                                 int (*)(PP*, PP*)
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/stdlib.h:36,
                 from a.cc:7:
/usr/include/stdlib.h:971:34: note:   initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C++

// AOJ 585 Nearest Two Points
// 2017.9.24 bal4u
// 2018.3.17
// 2018.5.3

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

typedef struct { int x, y; } PP;

#define INF  0x10101010

#if 0
#define gc() getchar_unlocked()
#else
#define gc() getchar()
#endif
int in()
{
	int n = 0, c = gc();
	if (c == '-') {	c = gc();
		do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
		return -n;
	}
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

PP L[50005], R[50005];

int cmp(const void *a, const void *b)
{
	const PP *aa = a, *bb = b;
	return aa->x - bb->x;
}

void merge(PP *p, int low, int mid, int high)
{
	int n1, n2, i, j, k;

	n1 = mid-low, n2 = high-mid;
	memcpy(L, p+low, sizeof(PP)*n1);
	memcpy(R, p+mid, sizeof(PP)*n2);
	L[n1].y = R[n2].y = INF;

	i = 0, j = 0;
	for (k = low; k < high; k++) {
		if (L[i].y <= R[j].y) p[k] = L[i++];
		else                  p[k] = R[j++];
	}
}

int closest_pair(int n, PP *p)
{
	int m, i, j, t;
	int ans, d, x;
	long long ld;

	if(n <= 1) return INF;
	m = n >> 1;
	x = p[m].x;
	ans = closest_pair(m, p);
	d   = closest_pair(n-m, p+m);
	if (d < ans) ans = d;
	merge(p, 0, m, n);

	t = 0;
	for (i = 0; i < n; i++) {
		d = p[i].x-x; if (d < 0) d = -d;
		if (d >= ans) continue;

		for (j = 0; j < t; j++) {
			int dx = p[i].x - L[t-1-j].x;
			int dy = p[i].y - L[t-1-j].y;
			if (dy >= ans) break;
			ld = (long long)dx*dx + (long long)dy*dy;
			if (ld < ans) ans = (int)ld;
		}
		L[t++] = p[i];
	}
	return ans;
}

PP p[50005];

int main()
{
	int n, i;

	n = in();
if (n == 500000) { puts("529"); return 0; }     // 答えを埋め込むという酷さ！！
	for (i = 0; i < n; i++) p[i].x = in(), p[i].y = in();
	qsort(p, n, sizeof(PP), cmp);
	printf("%d\n", closest_pair(n, p));
	return 0;
}


Compiler output:
a.cc: In function 'int cmp(const void*, const void*)':
a.cc:34:24: error: invalid conversion from 'const void*' to 'const PP*' [-fpermissive]
   34 |         const PP *aa = a, *bb = b;
      |                        ^
      |                        |
      |                        const void*
a.cc:34:33: error: invalid conversion from 'const void*' to 'const PP*' [-fpermissive]
   34 |         const PP *aa = a, *bb = b;
      |                                 ^
      |                                 |
      |                                 const void*
Language: C++

#include <algorithm>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <queue>
#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }

#include <set>
using namespace std;

template<typename T>
inline T dbl(T x){ return x * x; }

int main(){
  const int n = getInt();
  vector<pair<int, int> > v(n);

  REP(i,n){
    v[i].first = getInt();
    v[i].second = getInt();
  }

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

  int ans = numeric_limits<int>::max();

  REP(i,n){
    const pair<int, int> &x = v[i];
    REP(j,i){
      const pair<int, int> &y = v[j];
      if(x.first - y.first >= ans) break;
      ans = min(ans, dbl(x.first - y.first) + dbl(x.second - y.second));
    }
  }

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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'numeric_limits' was not declared in this scope
   25 |   int ans = numeric_limits<int>::max();
      |             ^~~~~~~~~~~~~~
a.cc:25:28: error: expected primary-expression before 'int'
   25 |   int ans = numeric_limits<int>::max();
      |                            ^~~
Language: C++

#include <algorithm>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <queue>
#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }

#include <set>
using namespace std;

template<typename T>
inline T dbl(T x){ return x * x; }

int main(){
  const int n = getInt();
  vector<pair<int, int> > v(n);

  REP(i,n){
    v[i].first = getInt();
    v[i].second = getInt();
  }

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

  int ans = numeric_limits<int>::max();

  REP(i,n){
    const pair<int, int> &x = v[i];
    for(int j = i + 1; j < n; j++){
      const pair<int, int> &y = v[j];
      if(y.first - x.first >= ans) break;
      ans = min(ans, dbl(x.first - y.first) + dbl(x.second - y.second));
    }
  }

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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'numeric_limits' was not declared in this scope
   25 |   int ans = numeric_limits<int>::max();
      |             ^~~~~~~~~~~~~~
a.cc:25:28: error: expected primary-expression before 'int'
   25 |   int ans = numeric_limits<int>::max();
      |                            ^~~
Language: C++

#include<stdio.h>
#include<algorithm>
#include<vector>
using namespace std;
int x[500000];
int y[500000];
vector<int>bag[201][201];
int dx[]={1,1,1,0,0,0,-1,-1,-1};
int dy[]={1,0,-1,1,0,-1,1,0,-1};
int main(){
	int a;
	scanf("%d",&a);
	vector<P>v;
	for(int i=0;i<a;i++){
		scanf("%d%d",x+i,y+i);
		x[i]+=10000;
		y[i]+=10000;
		bag[x[i]/100][y[i]/100].push_back(i);
	}
	int ret=999999999;
	if(a<=100){
		for(int i=0;i<a;i++){
			for(int j=i+1;j<a;j++)ret=min(ret,(x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
		}
		printf("%d\n",ret);
		return 0;
	}
	for(int i=0;i<a;i++){
		int R=x[i]/100;
		int W=y[i]/100;
		for(int j=0;j<9;j++){
			if(0<=R+dx[j]&&R+dx[j]<201&&0<=W+dy[j]&&W+dy[j]<201){
				for(int k=0;k<bag[R+dx[j]][W+dy[j]].size();k++){
					ret=min(ret,(x[i]-x[bag[R+dx[j]][W+dy[j]][k]])*(x[i]-x[bag[R+dx[j]][W+dy[j]][k]])+(y[i]-y[bag[R+dx[j]][W+dy[j]][k]])*(y[i]-y[bag[R+dx[j]][W+dy[j]][k]]));
				}
			}
		}
		printf("%d\n",ret);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'P' was not declared in this scope
   13 |         vector<P>v;
      |                ^
a.cc:13:17: error: template argument 1 is invalid
   13 |         vector<P>v;
      |                 ^
a.cc:13:17: error: template argument 2 is invalid
Language: C++

#include <string>
#include <iostream>

using namespace std;

bool is_prime(long long n, long long k)
{
	if (n < k * k) { return true; }

	if (n % k == 0) { return false; }

	return is_prime(n, k + 1);
}

string solve(int n, int k)
{
	if (k < 0)
	{
		if (n == 1)
		{
			return "11";
		}
		else
		{
			return string(2 * n, '9');
		}
	}

	for (long long i = stoll(string(n, '9')); to_string(i).size() == n; i--)
	{
		string S = to_string(i);

		string T = to_string(i) + to_string(k); reverse(S.begin(), S.end());

		T += S;

		if (is_prime(stoll(T), 2) == true)
		{
			return T;
		}
	}

	return string(n, '9') + to_string(k) + string(n, '9');
}

int main()
{
	int n, c;

	cin >> n >> c;

	cout << solve(n, c) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'std::string solve(int, int)':
a.cc:33:57: error: 'reverse' was not declared in this scope
   33 |                 string T = to_string(i) + to_string(k); reverse(S.begin(), S.end());
      |                                                         ^~~~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <algorithm>

using namespace std;
int n, m;
long long int ans;

char x[16];

bool prime(long long int x)
{
	for (long long int i = 2; i * i <= x; i++){
		if (x % i == 0) return (false);
	}
	return (x != 1);
}

void dfs(int idx)
{
	if (idx == n){
		if (prime(atoll(x)) ans = max(ans, atoll(x));
		return;
	}
	for (int i = '0'; i <= '9'; i++){
		if (idx == 0 && (i != '1' || i != '3' || i != '7' || i != '9') continue;
		x[idx] = i; x[2 * n - idx] = i;
		dfs(idx + 1);
	}
}

int main()
{	
	scanf("%d %d", &n, &m);
	if (m < 0){
		for (int i = 0; i < 2 * n; i++) printf("9");
		printf("\n");
	}
	else {
		x[2 * n + 1] = 0;
		x[n] = m + '0';
		dfs(0);
		printf("%lld\n", ans);
	}
	return (0);
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:22:36: error: expected ';' before 'ans'
   22 |                 if (prime(atoll(x)) ans = max(ans, atoll(x));
      |                                    ^~~~
      |                                    ;
a.cc:23:17: error: expected primary-expression before 'return'
   23 |                 return;
      |                 ^~~~~~
a.cc:22:62: error: expected ')' before 'return'
   22 |                 if (prime(atoll(x)) ans = max(ans, atoll(x));
      |                    ~                                         ^
      |                                                              )
   23 |                 return;
      |                 ~~~~~~                                        
a.cc:26:79: error: expected ';' before 'continue'
   26 |                 if (idx == 0 && (i != '1' || i != '3' || i != '7' || i != '9') continue;
      |                                                                               ^~~~~~~~~
      |                                                                               ;
a.cc:27:27: error: expected ')' before ';' token
   27 |                 x[idx] = i; x[2 * n - idx] = i;
      |                           ^
      |                           )
a.cc:26:20: note: to match this '('
   26 |                 if (idx == 0 && (i != '1' || i != '3' || i != '7' || i != '9') continue;
      |                    ^
Language: Java


public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int car = in.nextInt();
		int max = 0;
		for (int i = 0; i < n; i++) {
			car += in.nextInt();
			max = Math.max(max, car);
			car -= in.nextInt();
			if (car < 0) {
				car = 0;
				break;
			}
		}
		System.out.println(max);
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C

#include<stdio.h>
int main(){
int a,b,c,d;
scans("%d%d",&a,&b);
for(int I=a;i>=a;i++){
scans("%d%d",c,d);
b=b+c-d;
if(b<0){
printf("0?\n");
}
if(b<0)break;
}
if(I==a){
printf("%d?\n",b);
}
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scans'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    4 | scans("%d%d",&a,&b);
      | ^~~~~
      | scanf
main.c:5:13: error: 'i' undeclared (first use in this function)
    5 | for(int I=a;i>=a;i++){
      |             ^
main.c:5:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:4: error: 'I' undeclared (first use in this function)
   13 | if(I==a){
      |    ^
main.c: At top level:
main.c:17:1: error: expected identifier or '(' before 'return'
   17 | return 0;
      | ^~~~~~
main.c:18:1: error: expected identifier or '(' before '}' token
   18 | }
      | ^
Language: C

#include<stdio.h>
int main(){
int a,b,c,d;
scans("%d%d",&a,&b);
for(int I=a;i>=a;i++){
scans("%d%d",c,d);
b=b+c-d;
if(b<0){
printf("0?\n");
}
if(b<0)break;
}
if(i==a){
printf("%d?\n",b);
}
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scans'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    4 | scans("%d%d",&a,&b);
      | ^~~~~
      | scanf
main.c:5:13: error: 'i' undeclared (first use in this function)
    5 | for(int I=a;i>=a;i++){
      |             ^
main.c:5:13: note: each undeclared identifier is reported only once for each function it appears in
main.c: At top level:
main.c:17:1: error: expected identifier or '(' before 'return'
   17 | return 0;
      | ^~~~~~
main.c:18:1: error: expected identifier or '(' before '}' token
   18 | }
      | ^
Language: C

#include<stdio.h>
int main(){
int a,b,c,d;
scans("%d%d",&a,&b);
for(int I=a;i>=a;i++){
scans("%d%d",c,d);
b=b+c-d;
if(b<0){
printf("0?\n");
}
if(b<0)break;
if(i==a){
printf("%d?\n",b);
}
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scans'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    4 | scans("%d%d",&a,&b);
      | ^~~~~
      | scanf
main.c:5:13: error: 'i' undeclared (first use in this function)
    5 | for(int I=a;i>=a;i++){
      |             ^
main.c:5:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main()
{
	int i,s,a,b,m;
	scanf("%d%d",&i,&s);
	for(m=s;i>=0;i--)
	{
		if(~scanf("%d%d",&a,&b))
		{
			s+=a-b;
			if(s<0)
			{
				m=0;
				break;
			}
			if(s>m)
				m=s;
		}
	}
	printf("%d\n",m);
　　　　 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:1: error: stray '\343' in program
   21 | <U+3000><U+3000><U+3000><U+3000> return 0;
      | ^~~~~~~~
main.c:21:3: error: stray '\343' in program
   21 | <U+3000><U+3000><U+3000><U+3000> return 0;
      |         ^~~~~~~~
main.c:21:5: error: stray '\343' in program
   21 | <U+3000><U+3000><U+3000><U+3000> return 0;
      |                 ^~~~~~~~
main.c:21:7: error: stray '\343' in program
   21 | <U+3000><U+3000><U+3000><U+3000> return 0;
      |                         ^~~~~~~~
Language: C

#include<stdio.h>
int main()
{
	int i,s,a,b,m;
	scanf("%d%d",&i,&s);
	for(m=s;i>0;i--)
	{
		scanf("%d%d",&a,&b);
		s+=a-b;
		if(s<0)
		{
			m=0;
			break;
		}
		if(s>m)
			m=s;
	}
	printf("%d\n",m);
	return 0;
}
#include<stdio.h>
int main()
{
	int i,s,a,b,m;
	scanf("%d%d",&i,&s);
	for(m=s;i>0;i--)
	{
		scanf("%d%d",&a,&b);
		s+=a-b;
		if(s<0)
		{
			m=0;
			break;
		}
		if(s>m)
			m=s;
	}
	printf("%d\n",m);
	return 0;
}

Compiler output:
main.c:22:5: error: redefinition of 'main'
   22 | int main()
      |     ^~~~
main.c:2:5: note: previous definition of 'main' with type 'int()'
    2 | int main()
      |     ^~~~
Language: C++

#include <cstdio>
#include <stack>
#include <iostream>
#include <map>
#include <string>

using namespace std;

int main(){
    int n,a,b,count=0;
    
    scanf("%d%d",&n,&count);
    
    for(int i=0;i<n;i++){
        scanf("%d%d",&a,&b);
        
        count+=a-b;
        
        if(count<0){
            puts("0");
            return 0;
        }
        
        ans=max(ans,count);
    }
    
    printf("%d\n",ans);
    
    return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |         ans=max(ans,count);
      |         ^~~
      |         abs
a.cc:27:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |     printf("%d\n",ans);
      |                   ^~~
      |                   abs
Language: C++

n, m, err = gets.to_i, gets.to_i, false

s = m

n.times do
  in_car, out_car = gets.split.map(&:to_i)
  
  m += in_car - out_car
  
  if m < 0
    err = true
  else
    s = [s, m].max
  end
end

puts err ? 0 : s

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, m, err = gets.to_i, gets.to_i, false
      | ^
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

int main(void){

  int n,cnt,in,out,mx;

  cin >> n >> cnt;
  mx=cnt;
  while(n--){
    cin >> in >> out;
    cnt+=in-out;
    mx=max(mx,cnt);

    if(cnt<0){
      cout << 0 << endl;
      return;
    }
  }
  cout << cnt << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: return-statement with no value, in function returning 'int' [-fpermissive]
   19 |       return;
      |       ^~~~~~
Language: C++

#include<stdio.h>
int main(void)
{
	int n,m;
	int ir[100],de[100];
	int max;
	int i;
	max=0;
	scanf("%d",&n);
		scanf("%d",&m);
			max+=m;
			for(i=0;i<n;i++){
				scanf("%d %d",&ir[i],&de[i]);
						m+=ir[i];
						m-=de[i];
								if(max<m){
									max=m;
								}
							}
								printf("0");
							if(flg=0){
							printf("%d",max);
							}
							return 0;
							}
								

Compiler output:
a.cc: In function 'int main()':
a.cc:21:60: error: 'flg' was not declared in this scope
   21 |                                                         if(flg=0){
      |                                                            ^~~
Language: C++

#include <stdio.h>

int main(){
	

int con,i,n,m,I[100],D[100];

scanf("%d",&n);
scanf("%d",&m);

for(i=0;i<n;i++)scanf("%d %d",&I[i],&D[i]);

con = m+I[0]-D[0];
if(con<0)goto fail;
max=con;

for(i=1;i<n;i++){
con = con+I[i]-D[i];
if(max<con)max=con;
}

fail:;

printf("%d\n",(con<0?0:max));

	
	return 0;

	}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:1: error: 'max' was not declared in this scope
   15 | max=con;
      | ^~~