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

#include<algorithm>
#include<iostream>

using namespace std;
using ll = long long;


int main() {
    ll n;
    cin>>n;
    for(ll i=0;i<n;i++){
        ll a,b;
        cin>>a>>b;
        ll hoge=a*b-1;
        ll alpha=sqrt(hoge-1);
        if((alpha+1)*(alpha+1)<=hoge)alpha++;
        if((a*b-1)/alpha==alpha){
            cout<<alpha*2-2<<endl;
        }else{
            if(a==b){
                cout<<alpha*2<<endl;
            }else{
                cout<<alpha*2-1<<endl;
            }
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: 'sqrt' was not declared in this scope
   15 |         ll alpha=sqrt(hoge-1);
      |                  ^~~~
Language: C++

#ifdef DBG1
  #define LOCAL
#endif

#ifdef LOCAL
  #define _GLIBCXX_DEBUG
#endif

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

#ifdef DBG1
    #define dbg(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dbg(...)
#endif

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;

bool solve() {
  ll a, b;
  if (scanf("%lld%lld", &a, &b) != 2) { return false; }

  if (a == b) {
    printf("%lld\n", 2 * a - 2);
    return true;
  }

  if (a > b) { swap(a, b); }
  ll x = (int)(sqrt(a + 0.0) * sqrt(b + 0.0));
  while (x * x < a * b) x += 1;
  while (x * x >= a * b) x -= 1;
/*  vector <int> ind;
  ind.push_back(1);
  ind.push_back(a);
  ind.push_back(x);

  const int D = 100;

  int ans = 0;
  ll last_used = a * b + 1;
  for (int i = 1; i <= D && i < a - D; ++i) {
    ll maxP = min(last_used - 1, (a * b - 1 + i - 1) / i);
    if (maxP == b) {
      maxP--;
    }
    if (maxP > 0) {
      ans++;
    }
    last_used = maxP;
  }
  ans += max(0, (a - D) - D - 1);
  for (int i = a - D; i <= a + 2 * D && i < x - D; ++i) {
    ll maxP = min(last_used - 1, (a * b - 1 + i - 1) / i);
    if (maxP == b) {
      maxP--;
    }
    if (maxP > 0) {
      ans++;
    }
    last_used = maxP;
  }
  ans += max(0, (x - D) - (a + D) - 1);
  for (int i = x - D; i <= x; ++i) {
    ll maxP = min(last_used - 1, (a * b - 1 + i - 1) / i);
    if (maxP == b) {
      maxP--;
    }
    if (maxP > 0) {
      ans++;
    }
    last_used = maxP;
  }
*/
  dbg("a %lld b %lld x %lld\n", a, b, x);

  int ans = 2 * (x - 1);
  if (a < x) {
    ans -= 1;
  }
  {
    ll y = (a * b - 1) / b;
    if (y > 0 && y != a) {
      if ((a * b - 1) / y == b && (a * b - 1) / (y + 1) == b - 1) {
        ans -= 1;
      }
    }
  }

  if ((a * b - 1) / x == x) {
    if (x != a && x != b) {
      ans += 1;
    }
  } else {
    if (x != a && (a * b - 1) / x != b) {
      ans += 1;
    }
    ans += 1;
  }

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

  return true;
}
/* 8 * 9 = 72


   1 71
   2 35
   3 23
   4 ??
   5 ??
   6 11
   7 10
   8 8
   

   */

int main() {
  scanf("%*d");
  while (solve());
  return 0;
}

Compiler output:
a.cc: In function 'bool solve()':
a.cc:42:16: error: 'sqrt' was not declared in this scope
   42 |   ll x = (int)(sqrt(a + 0.0) * sqrt(b + 0.0));
      |                ^~~~
Language: C++

q=int(raw_input())
for i in range(q):
	a,b=map(int,raw_input().split())
	p=int((a*b-1)**0.5)
	if p*p>a*b-1:
		p=p-1
	r=p*2-1
	if p*p+p>a*b-1:
		r=r-1
	if a==b:
		r=r+1
	print r

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
 
using namespace std;
typedef unsigned long ul;

int main() {
	ul n,a,b;
	cin>>n;

	while(n--) {
		cin>>a>>b;
		ul score = (a - 1) * (b - 1);
		ul hoge = score > 0 ? sqrt(score) : 0;
		ul count = hoge * 2 + (a <= hoge ? -1 : 0) + (b <= hoge ? -1 : 0);
		score = a * b - 1;
		ul amin = hoge, bmin = hoge;
		ul amax = bmin == 0 ? ULONG_MAX : score / bmin;
		ul bmax = amin == 0 ? ULONG_MAX : score / amin;

		while(true) {
			amin++;
			if(amin == a) amin++;
			if(amin >= amax) break;
			bmax = min(score / amin, bmax - 1);
			if(bmax == b) bmax--;
			if(bmin >= bmax) break;
			count++;

			bmin++;
			if(bmin == b) bmin++;
			if(bmin >= bmax) break;
			amax = min(score / bmin, amax - 1);
			if(amax == a) amax--;
			if(amin >= amax) break;
			count++;
		}

		cout<<count<<endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:39: error: 'ULONG_MAX' was not declared in this scope
   21 |                 ul amax = bmin == 0 ? ULONG_MAX : score / bmin;
      |                                       ^~~~~~~~~
a.cc:6:1: note: 'ULONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <math.h>
  +++ |+#include <climits>
    6 |
Language: C++

#pragma comment(linker, "/STACK:102400000,102400000")
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <map>
#include <set>
#include <queue>

#define LL long long

using namespace std;

int a, b;

int main()
{
	//freopen("test_in.txt", "r", stdin);
	//freopen("test_out.txt", "w", stdout);
	int t;
	cin>>t;
	while(t--)
	{
		cin>>a>>b;
		LL p = 1ll*a*b-1;
		int x = sqrt(p);
		int ans = x*2-(a<=x)-(b<=x)-(1ll*x*x<=p && 1ll*x*(x+1)>p);
		cout<<ans<<endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:25: error: 'sqrt' was not declared in this scope
   28 |                 int x = sqrt(p);
      |                         ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
int n;
int a[200010];
int b[200010];
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i]>>b[i];
		if(a[i]<b[i])   ans+=b[i];
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |                 if(a[i]<b[i])   ans+=b[i];
      |                                 ^~~
      |                                 abs
a.cc:18:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   18 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: C++

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

int binarySearch(int64_t sum) {
	int ok = 1, ng = 1000000000;
	int64_t mid;
	while (ng - ok > 1) {
		mid = ok + ((ng - ok) >> 1);
		if (mid * mid < sum) ok = mid;
		else ng = mid;
	}
	return ok;
}
int main() {
	int Q, A, B;
	cin >> Q;
	int64_t sum;
	for (int i = 0;i < Q;i ++) {
		cin >> A >> B;
		sum = (int64_t)A * B;
		int64_t n = binarySearch(sum);
		int ans = n << 1;
		if (n * (n + 1) >= sum) ans --;
		if (n >= min(A, B)) ans --;
		cout << ans;
		if (i < Q - 1) cout << endl;
	}
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり

まず、10^10^10はバカでかい数なので実質無限人でも変わらない
重要なのは、各クエリに対しA*B以下になるx,yが何通りあるかだけである
ただし、ここで各xに対しyがあるかどうかさえ知れば良い
まず、x=1の時、y=A*B-1まで考えられる
x=2のとき、y=A*B/2-1まで考えられる
また、x<=sqrt(A*B)としておく
これにより、おおよそ2sqrt(A*B)個の答えが持てることが分かる
ただし、n>=min(A, B)なら1個取れないので1引く
また、sqrt(A*B)*(sqrt(A*B)+1)>=A*Bでも1個反対側が無いので1引く
sqrt(A*B)は二分探索で求まる
よってO(Qlog(sqrt(A*B))、あっという間じゃん
*/

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

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

int binarySearch(int64_t sum) {
	int ok = 1, ng = 1000000000;
	int64_t mid;
	while (ng - ok > 1) {
		mid = ok + ((ng - ok) >> 1);
		if (mid * mid < sum) ok = mid;
		else ng = mid;
	}
	return ok;
}
int main() {
	int Q, A, B;
	cin >> Q;
	int64_t sum;
	for (int i = 0;i < Q;i ++) {
		cin >> A >> B;
		int64_t n = binarySearch((int64_t)A * B);
		if (n * (n + 1) >= (int64_t)A * B) cout << ((n - 1) << 1);
		else cout << (n << 1) - 1;
		if (i < Q - 1) cout << endl;
	}
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり

まず、10^10^10はバカでかい数なので実質無限人でも変わらない
重要なのは、各クエリに対しA*B以下になるx,yが何通りあるかだけである
ただし、ここで各xに対しyがあるかどうかさえ知れば良い
まず、x=1の時、y=A*B-1まで考えられる
x=2のとき、y=A*B/2-1まで考えられる
また、x<=sqrt(A*B)としておく
これにより、おおよそ2sqrt(A*B)個の答えが持てることが分かる
ただし、min(A, B)は取れないので1引く
また、sqrt(A*B)*(sqrt(A*B)+1)>=A*Bでも1個反対側が無いので1引く
sqrt(A*B)は二分探索で求まる
よってO(Qlog(sqrt(A*B))、あっという間じゃん
*/

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

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#define Rep(i,a,b) for(register int i=(a),i##end=(b);i<=i##end;++i)
#define Repe(i,a,b) for(register int i=(a),i##end=(b);i>=i##end;--i)
#define For(i,a,b) for(i=(a),i<=(b);++i)
#define Forward(i,a,b) for(i=(a),i>=(b);--i)
#define Chkmax(a,b) a=a>b?a:b
#define Chkmin(a,b) a=a<b?a:b
template<typename T>inline void read(T &x)
{
	T f=1;x=0;char c;
	for(c=getchar();!isdigit(c);c=getchar())if(c=='-')f=-1;
	for(;isdigit(c);c=getchar())x=x*10+(c^48);
	x*=f;
}
using namespace std;
const int MAXN=111;
static int n;
inline void init()
{
	read(n);
}
static int ans=10000;
inline void solve()
{
	static long long a,b,p;
	Rep(i,1,n)
	{
		read(a);read(b);
		p=(long long)floor(sqrt(a*b));
		while((p+1)*(p+1)<a*b)++p;
		while((p*p>a*b)--p;
		if(p*p==a*b)printf("%lld\n",(p-1)*(p-1));
		else printf("%lld\n",2*p-1);
	}
}
int main()
{
	init();
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:27:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   27 |         Rep(i,1,n)
      |             ^
a.cc:3:37: note: in definition of macro 'Rep'
    3 | #define Rep(i,a,b) for(register int i=(a),i##end=(b);i<=i##end;++i)
      |                                     ^
a.cc:27:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   27 |         Rep(i,1,n)
      |             ^
a.cc:3:43: note: in definition of macro 'Rep'
    3 | #define Rep(i,a,b) for(register int i=(a),i##end=(b);i<=i##end;++i)
      |                                           ^
a.cc:32:27: error: lvalue required as decrement operand
   32 |                 while((p*p>a*b)--p;
      |                       ~~~~^~~~~
a.cc:32:34: error: expected ')' before 'p'
   32 |                 while((p*p>a*b)--p;
      |                      ~           ^
      |                                  )
Language: C++


#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;


int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);
	int Q;
	in >> Q;
	while (Q--)
	{
		int64_t A, B;
		in >> A >> B;
		if (B < A) {
			std::swap(A, B);
		}

		int64_t res = 0;
		int64_t max_v = A * B;
		auto sqrt_ = int64_t(sqrt(max_v)+0.5);
		if (max_v <= sqrt_ * sqrt_) {
			--sqrt_;
		}
		if (A <= sqrt_) {
			--res;
		}
		if (sqrt_ * (sqrt_+1) >= max_v) {
			--res;
		}
		out << sqrt_*2+res << endl;
	}

	return 0;
}
#endif


Compiler output:
a.cc: In function 'int main()':
a.cc:50:38: error: 'sqrt' was not declared in this scope; did you mean 'sqrt_'?
   50 |                 auto sqrt_ = int64_t(sqrt(max_v)+0.5);
      |                                      ^~~~
      |                                      sqrt_
Language: C++

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

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

/* Macros reg. ends here */

const ll INF = 1LL << 50;

int main() {
  // ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  ll n;
  cin >> n;

  vll as(n), bs(n);
  ll sum = 0;
  priority_queue<P, vP, greater<P>> pq;
  rep(i, n) {
    cin >> as[i] >> bs[i];
    pq.emplace(as[i] - bs[i], i);
    sum += as[i];
  }

  ll cnt = 0;
  while (!pq.empty()) {
    auto [d, i] = pq.top();
    if (d == 0 && cnt == 0) break;
    pq.pop();
    if (d <= 0) {
      cnt += abs(d);
      as[i] = bs[i] = 0;
      continue;
    }
    if (d < cnt) {
      cnt -= d;
      as[i] = bs[i];
    } else {
      cnt = 0;
      as[i] -= d;
    }
    pq.emplace(as[i] - bs[i], i);
  }

  while (!pq.empty()) {
    auto [d, i] = pq.top();
    pq.pop();
    sum -= as[i];

Compiler output:
a.cc: In function 'int main()':
a.cc:96:18: error: expected '}' at end of input
   96 |     sum -= as[i];
      |                  ^
a.cc:93:23: note: to match this '{'
   93 |   while (!pq.empty()) {
      |                       ^
a.cc:96:18: error: expected '}' at end of input
   96 |     sum -= as[i];
      |                  ^
a.cc:57:12: note: to match this '{'
   57 | int main() {
      |            ^
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[][] array = new int[n][3];
        for (int i = 0; i < n; i++) {
            array[i][0] = sc.nextInt();
            array[i][1] = sc.nextInt();
            array[i][2] = array[i][1] - array[i][0];
        }
        long ans = 0;
        for (int i = 0; i < n; i++) {
            if (array[i][0] < array[i][1]) ans += array[i][1];
        }
        System.out.println(ans);
    }
}


Compiler output:
Main.java:8: error: incompatible types: int[][] cannot be converted to long[][]
        long[][] array = new int[n][3];
                         ^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class gym{
	static void main() throws Exception{
		int n=sc.nextInt();
		int[]a=new int[n],b=new int[n];
		long sum=0;
		for(int i=0;i<n;i++) {
			a[i]=sc.nextInt();b[i]=sc.nextInt();
			sum+=a[i];
		}
//		shuffle(a);
//		shuffle(b);
//		Arrays.sort(a);
//		Arrays.sort(b);
		long min=sum;
		for(int i=0;i<n;i++) {
			if(b[i]<a[i]) {
				min=b[i];
				break;
			}
		}
		pw.println(sum-min);
	}
	public static void main(String[] args) throws Exception{
		sc=new MScanner(System.in);
		pw = new PrintWriter(System.out);
		int tc=1;
//		tc=sc.nextInt();
		while(tc-->0)
			main();
		pw.flush();
	}
	static PrintWriter pw;
	static MScanner  sc;
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] longArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public int[] intSortedArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public long[] longSortedArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] LongArr(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
}

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

import java.io.*;
import java.util.*;

public class gym{
	static void main() throws Exception{
		int n=sc.nextInt();
		int[]a=new int[n],b=new int[n];
		long sum=0;
		for(int i=0;i<n;i++) {
			a[i]=sc.nextInt();b[i]=sc.nextInt();
			sum+=a[i];
		}
		shuffle(a);
		shuffle(b);
		Arrays.sort(a);
		Arrays.sort(b);
		long min=sum;
		for(int i=0;i<n;i++) {
			if(b[i]<a[i]) {
				min=b[i];
				break;
			}
		}
		pw.println(sum-min);
	}
	public static void main(String[] args) throws Exception{
		sc=new MScanner(System.in);
		pw = new PrintWriter(System.out);
		int tc=1;
//		tc=sc.nextInt();
		while(tc-->0)
			main();
		pw.flush();
	}
	static PrintWriter pw;
	static MScanner  sc;
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] longArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public int[] intSortedArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public long[] longSortedArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] LongArr(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
}

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

#include <iostream>
#include <vector>
using namespace std;
int main(){
	int N;
	cin >> N;
	vector<int> A(N), B(N);
	for (int i = 0; i < N; i++){
		cin >> A[i] >> B[i];
	}
	if (A == B){
		cout << 0 << endl;
	} else {
		long long ans = 0;
		for (int i = 0; i < N; i++){
			if (A[i] <= B[i]){
				ans += B[i];
			} else {
				assert(false);
			}
		}
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:33: error: 'assert' was not declared in this scope
   19 |                                 assert(false);
      |                                 ^~~~~~
a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    2 | #include <vector>
  +++ |+#include <cassert>
    3 | using namespace std;
Language: C++

#include <bits/stdc++.h>

#define fi first
#define se second

const int N = 300300;
const long long mod = 998244353;

using namespace std;

int main()
{
        ios_base::sync_with_stdio(false);

        //freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);

        int n;
        cin >> n;
        long long sum = 0, shit = 1e18;
        for(int i = 0; i < n; i++){
                int x, y;
                cin >> x >> y;
                if(x > y){
                        shit = min(shit, y);
                }
                sum += y;
        }
        cout << sum - min(sum, shit) << "\n";

}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:35: error: no matching function for call to 'min(long long int&, int&)'
   25 |                         shit = min(shit, y);
      |                                ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   25 |                         shit = min(shit, y);
      |                                ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:25:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   25 |                         shit = min(shit, y);
      |                                ~~~^~~~~~~~~
Language: C++

#!python3

import numpy as np


# input
N = int(input())
A, B = np.zeros(N, int), np.zeros(N, int)
for i in range(N):
    A[i], B[i] = list(map(int, input().split()))


def main():
    if (A == B).all():
        print(0)
        return
    
    w = B[A >= B]
    ans = B[A < B].sum() + (w.sum() - w.min())
    print(ans)


if __name__ == "__main__":
    main()


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!python3
      |  ^
a.cc:6:3: error: invalid preprocessing directive #input
    6 | # input
      |   ^~~~~
a.cc:3:1: error: 'import' does not name a type
    3 | import numpy as np
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

#define maxn 200010
#define INF 1e9
#define int ll

int N,A[maxn],B[maxn];
int total = 0;

int32_t main(){
	cin>>N;
	
	int ans = INF;
	
	for (int i=0;i<N;i++){
		int a,b;
		
		cin>>a>>b;
		total += a;
		
		if (a > b) ans = min(ans,b);
		
	}
	
	cout<<total - ans;
}


Compiler output:
a.cc:6:13: error: 'll' does not name a type
    6 | #define int ll
      |             ^~
a.cc:8:1: note: in expansion of macro 'int'
    8 | int N,A[maxn],B[maxn];
      | ^~~
a.cc:6:13: error: 'll' does not name a type
    6 | #define int ll
      |             ^~
a.cc:9:1: note: in expansion of macro 'int'
    9 | int total = 0;
      | ^~~
a.cc: In function 'int32_t main()':
a.cc:12:14: error: 'N' was not declared in this scope
   12 |         cin>>N;
      |              ^
a.cc:6:13: error: 'll' was not declared in this scope
    6 | #define int ll
      |             ^~
a.cc:14:9: note: in expansion of macro 'int'
   14 |         int ans = INF;
      |         ^~~
a.cc:16:18: error: expected ';' before 'i'
   16 |         for (int i=0;i<N;i++){
      |                  ^
a.cc:16:22: error: 'i' was not declared in this scope
   16 |         for (int i=0;i<N;i++){
      |                      ^
a.cc:17:21: error: expected ';' before 'a'
   17 |                 int a,b;
      |                     ^
a.cc:19:22: error: 'a' was not declared in this scope
   19 |                 cin>>a>>b;
      |                      ^
a.cc:19:25: error: 'b' was not declared in this scope
   19 |                 cin>>a>>b;
      |                         ^
a.cc:20:17: error: 'total' was not declared in this scope
   20 |                 total += a;
      |                 ^~~~~
a.cc:22:28: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |                 if (a > b) ans = min(ans,b);
      |                            ^~~
      |                            abs
a.cc:26:15: error: 'total' was not declared in this scope
   26 |         cout<<total - ans;
      |               ^~~~~
a.cc:26:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |         cout<<total - ans;
      |                       ^~~
      |                       abs
Language: C++

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

using ll = long long;

ll solve() {
  int N; cin >> N;
  ll res = 0;
  bool f = true;
  for (int i = 0; i < N; i++) {
    int a, b; cin >> a >> b;
    f = f && (a == b);
    if (a <= b) res += b;
  }
  if (A == B) return 0;
  return res;
}

int main() {
  cout << solve() << endl;
}

Compiler output:
a.cc: In function 'll solve()':
a.cc:15:7: error: 'A' was not declared in this scope
   15 |   if (A == B) return 0;
      |       ^
a.cc:15:12: error: 'B' was not declared in this scope
   15 |   if (A == B) return 0;
      |            ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

ll N,M,K,ans=0,mn=INF;cnt=0;
string S,T;
vector<int> P,Q;
vector<pair<int,int>> PP;
bool CAN=false;


int main(){
  cin>>N;
  ll A[N],B[N];
  REP(i,N){
    cin>>A[i]>>B[i];
    ans+=B[i];
    mn=min(mn,B[i]);
  }
  cout<<ans-mn<<endl;
  
}

Compiler output:
a.cc:21:23: error: 'cnt' does not name a type; did you mean 'int'?
   21 | ll N,M,K,ans=0,mn=INF;cnt=0;
      |                       ^~~
      |                       int
Language: C++

	cin >> N;
	ll sum = 0;
	ll mi = inf;
	int ok = 1;
	for (int i = 0; i < N; i++) {
		ll A, B;
		cin >> A >> B;
		if (A != B)ok = 0;
		sum += A;
		if(A > B)mi = min(mi, B);
	}
	if(!ok)puts(sum - mi);
	else puts(0);
	
	
	return 0;
}

Compiler output:
a.cc:1:9: error: 'cin' does not name a type
    1 |         cin >> N;
      |         ^~~
a.cc:2:9: error: 'll' does not name a type
    2 |         ll sum = 0;
      |         ^~
a.cc:3:9: error: 'll' does not name a type
    3 |         ll mi = inf;
      |         ^~
a.cc:5:9: error: expected unqualified-id before 'for'
    5 |         for (int i = 0; i < N; i++) {
      |         ^~~
a.cc:5:25: error: 'i' does not name a type
    5 |         for (int i = 0; i < N; i++) {
      |                         ^
a.cc:5:32: error: 'i' does not name a type
    5 |         for (int i = 0; i < N; i++) {
      |                                ^
a.cc:12:9: error: expected unqualified-id before 'if'
   12 |         if(!ok)puts(sum - mi);
      |         ^~
a.cc:13:9: error: expected unqualified-id before 'else'
   13 |         else puts(0);
      |         ^~~~
a.cc:16:9: error: expected unqualified-id before 'return'
   16 |         return 0;
      |         ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
   17 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
#define df 0

int main(){
  if(df) printf("*debug mode*\n");
  int n; cin >> n;
  bool flag=false;
  long int sum=0,MIN_b=1200000000;
  for(int i=0;i<n;i++){
    long int a,b; cin >> a >> b;
    if(a>b){
      flag=true;
      sum+=a;
      if(b<MIN_b)MIN_b=b;
      if(df)cout << sum <<"\n";
    }else{
      sum+=a;
      if(df)cout << sum <<"\n";
    }
  }
  cout << (flag?sum-b:0);
}

/// confirm df==0 ///


Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: 'b' was not declared in this scope
   22 |   cout << (flag?sum-b:0);
      |                     ^
Language: C++

//code by lynmisakura.wish to be accepted
/****************************/
#include<bits/stdc++.h>
using namespace std;
/***************************/
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<pair<int,int>> vpi;

const long long Mod = 998244353;
const long long mod = 1000000007;
const long long INF = 10000000000000;

#define itn int
#define endl "\n"
#define pb push_back
#define mp make_pair
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define all(x) (x).begin(),(x).end()
#define Rep(n) for(int i = 0;i < n;i++)
#define rep(i,n) for(int i = 0;i < n;i++)
#define ff first
#define ss second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll qp(ll a, ll b) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, int mo) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }

#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
int main(void){
    int n;cin >> n;
    struct arr{ll d,a,b;};
    vector<pair<ll,pair<ll,ll>>> arr(n);
    ll sum = 0LL;
    rep(i,n){
        ll p,q;cin >> p >> q;
        arr[i] = mp(p-q,mp(p,q));
        sum += q;
    }
    sort(all(arr));
    ll ans = 0LL;
    ll d = 0LL;
    rep(i,n){
        //debug(arr[i].ff);
    }
    rep(i,n){
        if(arr[i].ff <= 0){
            d += -1*arr[i].ff;
            ans += arr[i].ss.ss;
        }else{
            if(arr[i].ss.ff > d){
                arr[i].ss.ff -= d; d = 0;
            }else if(d > 0){
                ll k = arr[i].ss.ff;
                arr[i].ss.ff = 0; d-=k;
            }
            
            if(arr[i].ss.ff < arr[i].ss.ss){
                d += arr[i].ss.ss - arr[i].ss.ff;
                ans += arr[i].ss.ss;
            }
        }

    }
    if(ans == q){
        cout << 0 << endl;
        return 0;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:15: error: 'q' was not declared in this scope
   68 |     if(ans == q){
      |               ^
Language: C++

//code by lynmisakura.wish to be accepted
/****************************/
#include<bits/stdc++.h>
using namespace std;
/***************************/
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<pair<int,int>> vpi;

const long long Mod = 998244353;
const long long mod = 1000000007;
const long long INF = 10000000000000;

#define itn int
#define endl "\n"
#define pb push_back
#define mp make_pair
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define all(x) (x).begin(),(x).end()
#define Rep(n) for(int i = 0;i < n;i++)
#define rep(i,n) for(int i = 0;i < n;i++)
#define ff first
#define ss second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll qp(ll a, ll b) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, int mo) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }

#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
int main(void){
    int n;cin >> n;
    struct arr{ll d,a,b;};
    vector<pair<ll,pair<ll,ll>>> arr(n);
    ll sum = 0LL;
    rep(i,n){
        ll p,q;cin >> p >> q;
        arr[i] = mp(p-q,mp(p,q));
        sum += q;
    }
    sort(all(arr));
    ll ans = 0LL;
    ll d = 0LL;
    rep(i,n){
        //debug(arr[i].ff);
    }
    rep(i,n){
        if(arr[i].ff <= 0){
            d += -1*arr[i].ff;
            ans += arr[i].ss.ss;
        }else{
            if(arr[i].ss.ff > d){
                arr[i].ss.ff -= d; d = 0;
            }else{
                ll k = arr[i].ss.ff;
                arr[i].ss.ff = 0; d-=k;
            }

            if(arr[i].ss.ff < arr[i].ss.ss){
                d += arr[i].ss.ss - arr[i].ss.ff;
                ans += arr[i].ss.ss;
            }else break;
        }

    }
    if(ans == q){
        cout << 0 << endl;
        return 0;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:15: error: 'q' was not declared in this scope
   68 |     if(ans == q){
      |               ^
Language: C++

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}


int main(void) {
    int64 N;
    int64 sum = 0, maxi = 0, l = 0;
    cin >> N;
    REP(i, N) {
        int64 a, b;
        cin >> a >> b;
        sum += a;
        if (a >= b) chmin(l, b)
    }
    cout << sum - l << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:32: error: expected ';' before '}' token
   51 |         if (a >= b) chmin(l, b)
      |                                ^
      |                                ;
   52 |     }
      |     ~
Language: C++

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

//template<class T, size_t N> 
//size_t countof(const T (&array)[N]) { return N; }

int main() {
  int N;
  cin >> N;
  int a[N], b[N];

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

  //  sort(a, a+N);
  //  sort(b, b+N);

  //  int ans=0;
  long long int sum=0;
  long long int min_tozan =INT_MAX;
  int flag=0;
  for (int i=0; i < N; i++ ){
    /*    if(a[i] <= b[i]){
      ans += a[i];
    }
    else{*/
    if(a[i] > b[i]){ 
      min_tozan =min(min_tozan, b[i]);
      flag=1;
    }
    sum += a[i];
  }
  
  if(flag==0){
    cout << 0 << endl;
    return 0;
  }
  else{
    cout << (sum - min_tozan) << endl;
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: no matching function for call to 'min(long long int&, int&)'
   32 |       min_tozan =min(min_tozan, b[i]);
      |                  ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:32:21: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   32 |       min_tozan =min(min_tozan, b[i]);
      |                  ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:32:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   32 |       min_tozan =min(min_tozan, b[i]);
      |                  ~~~^~~~~~~~~~~~~~~~~
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 y = 0;
		long min;
		long a[] = new long[n + 1];
		long b[] = new long[n + 1];
		long c[] = new long[n + 1];
		for (int i = 1; i <= n; i++) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
			c[i] = a[i] - b[i];
if(i==1){
min=b[i];
}
			if(c[i]!=0){
				y=1;
			}

			if (c[i] >= 0) {
				if(b[i]<=min)
			min=b[i];
			}
		}
		long ans = 0;
		for (int i = 1; i <= n; i++) {

				ans += b[i];

		}

		if (y == 0) {
			System.out.println(0);
		} else {
			System.out.println(ans-min);
		}
	}

}

Compiler output:
Main.java:24: error: variable min might not have been initialized
				if(b[i]<=min)
				         ^
Main.java:38: error: variable min might not have been initialized
			System.out.println(ans-min);
			                       ^
2 errors
Language: C++

#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <bitset>

#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000000000//10^18
#define INFINT 2000000001//2*10^9+1
#define MOD 1000000007
#define MODANOTHER 998244353
#define PI acos(-1)

using namespace std;

int main(void)
{
	//変数の宣言
	int n;
	static int a[200010];
	static int b[200010];

	//よく使う変数
	int i,j,k,l;
	int flag=0;
	ll int ans=0;
	int count=0;
	int temp=0;
	int temp1=0;
	int temp2=0;
	int max=0;
	int min=INFINT;
	int len=0;
	int sum=0;
	int ok=0;
	int ng=0;



	//データの読み込み


//	scanf("%d",&n);
	scanf_s("%d",&n);

	for(i=0;i<n;i++){
//		scanf("%d %d",&a[i],&b[i]);
		scanf_s("%d %d",&a[i],&b[i]);
	}


	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
	//実際の処理

	for(i=0;i<n;i++){
		if(a[i]>b[i]){
			min=min(min,b[i]);
		}
		ans=ans+b[i];
	}

	if(min==INFINT){
		printf("0");
		return 0;
	}


	//	printf("計算部分終了\n");

	//出力

	printf("%lld",ans-min);

	//	printf("結果の出力終了\n");

	return 0;
}



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

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

int n,k[100005],l[100005],sum,mon;
int main(){
   cin>>n;
  if(n==1){
    cout<<0<<endl;
    return 0;
  }
  for(int i=0;i<n;++i){
    cin>>k[i]>>l[i];
    sum+=k[i];
    if(k[i]>l[i]){mon=max(mon,l[i]);}
  }
  cout<<sum-mon<<endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: expected '}' at end of input
   16 |   cout<<sum-mon<<endl;
      |                       ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int main()
{
	long long t, a, b, sum = 0, mini = INT_MAX;
	cin >> t;
	while (t--)
	{
		cin >> a >> b;
		sum += a;
		if (a > b)
			mini = min(mini, b);
	}
	if (mini == INT_MAX)
		cout << 0 << endl;
	else
	cout << sum - mini << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:44: error: 'INT_MAX' was not declared in this scope
    7 |         long long t, a, b, sum = 0, mini = INT_MAX;
      |                                            ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <algorithm>
  +++ |+#include <climits>
    3 | using namespace std;
Language: C

#include <stdio.h>

int main()
{
    long long a,b,n;
    while(~scanf("%lld",&n))
    {
    bool vis = true;
        long long ans = 0;
        for(int i=0; i<n; i++)
        {
            scanf("%lld%lld",&a,&b);
            if (a != b)
            {
                vis = false;
            }
            if (b > a)
                ans += b;
            else if(b == a)
                ans += b;
        }
        if (vis)
            puts("0");
        else
        printf("%lld\n",ans);
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:5: error: unknown type name 'bool'
    8 |     bool vis = true;
      |     ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:8:16: error: 'true' undeclared (first use in this function)
    8 |     bool vis = true;
      |                ^~~~
main.c:8:16: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:8:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:15:23: error: 'false' undeclared (first use in this function)
   15 |                 vis = false;
      |                       ^~~~~
main.c:15:23: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C++

#include <iostream>
#include <vector>
#include <utility>
#define each(i, n) for (int i = 0; i < n; i++)
#ifdef DEBUG
# define show(expr) cerr << "SHOW : " << #expr << " = " << expr << endl
# define msg(s) cerr << "MSG : " << s << endl
#else
# define show(expr)
# define msg(s)
#endif
using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<pair<int, int>> ab(n);
  for (auto& p : ab)
    cin >> p.first >> p.second;
  sort(begin(ab), end(ab),
      [](auto p, auto q) {
        return p.first - p.second < q.first - q.second;
      });
  long long candy = 0;
  long long task = 0;
  for (auto p : ab) {
    long long a = p.first, b = p.second;
    show(a);
    show(b);
    long long diff = b - a;
    if (a < b) {
      candy += a;
      task += diff;
      show(candy);
      show(task);
    }
    else if (-diff < task) {
      candy += a;
      task += b + diff;
      show(candy);
      show(task);
    }
    else {
      candy += task;
      break;
    }
  }
  cout << candy << endl;
}


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