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

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

#define DEBUG_MSG_off

int N;
vector<pair<int, int> > a_b_pair_list;

// sort B1 ... BN
// A1 ... AN
//             time limit
//             0    
// - A1 2 4 -> 2    4(ok)
// - A3 1 8 -> 3    8(ok)
// - A2 1 9 -> 4    9(ok)
// - A4 4 9 -> 8    9(ok)
// - A5 3 12 -> 12  12(ok)
bool cmp(pair<int,int> a, pair<int,int> b) {
  if (a.second < b.second)
    return true;
  else return false;
}

int main() {
  cin >> N;
  a_b_pair_list.resize(N);
  for(int i=0;i<N;i++) {
    int a,b; cin >> a >> b;
    a_b_pair_list[i] = make_pair(a,b);
  }
  sort(a_b_pair_list.begin(), a_b_pair_list.end(), cmp);
  int cur_time = 0;
  for(auto s: a_b_pair_list) {
    cur_time += s.first;
    if (cur_time>s.second) {
      cout << "No\n";
      return 0;
    }
  }

  cout << "Yes\n";

#ifdef DEBUG_MSG
  cerr << N << "\n";
  for(auto s: a_b_pair_list) {
    cerr << s.first << "," << s.second  << "\n"; 
  }
#endif
  return 0;
}

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

#include <iostream>
#include <vector>
#include <algorithm>_
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int main() {
    int n;
    cin >> n;
    vector<P> p(n);
    rep(i,n) cin >> p[i].second >> p[i].first;
    sort(p.begin(), p.end());
    ll t = 0;
    rep(i, n) {
        t += p[i].second;
        if (t > p[i].first) {
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    return 0;
}


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

#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int main() {
    int n;
    cin >> n;
    vector<P> p(n);
    rep(i,n) cin >> p[i].second >> p[i].first;
    sort(p.begin(), p.end());
    ll t = 0;
    rep(i, n) {
        t += p[i].second;
        if (t > p[i].first) {
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    return 0;
}



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

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

/* 値を入れ替える関数 */
void swap(int *x, int *y) {
	int temp;    // 値を一時保存する変数

	temp = *x;
	*x = *y;
	*y = temp;
}

/***
* pivotを決め、
* 全データをpivotを境目に振り分け、
* pivotの添え字を返す
***/
int partition(int *array, int +array2, int left, int right) {
	int i, j, pivot;
	i = left;
	j = right + 1;
	pivot = left;   // 先頭要素をpivotとする

	do {
		do { i++; } while (array[i] < array[pivot]);
		do { j--; } while (array[pivot] < array[j]);
		// pivotより小さいものを左へ、大きいものを右へ
		if (i < j) { 
		swap(&array[i], &array[j]); 
		swap(&array2[i], &array2[j]);
		}
	} while (i < j);

	swap(&array[pivot], &array[j]);   //pivotを更新
	swap(&array2[pivot], &array2[j]);

	return j;
}

/* クイックソート */
void quick_sort(int *array, int *array2, int left, int right) {
	int pivot;

	if (left < right) {
		pivot = partition(array, array2, left, right);
		quick_sort(array, array2, left, pivot - 1);   // pivotを境に再帰的にクイックソート
		quick_sort(array, array2, pivot + 1, right);
	}
}

int main() {


	int i, j, N, *A, *B, tmp, tmp2, time = 0;


	scanf("%d", &N);

	A = (int*)malloc(N * sizeof(int));
	B = (int*)malloc(N * sizeof(int));

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

	quick_sort(B, A, 0, N - 1);

	for (i = 0; i < N; i++) {
		time += A[i];
		if (time > B[i]) {
			printf("No\n");
			return 0;
		}

	}

	printf("Yes\n");
	return 0;
}

Compiler output:
main.c:18:31: error: expected ';', ',' or ')' before '+' token
   18 | int partition(int *array, int +array2, int left, int right) {
      |                               ^
main.c: In function 'quick_sort':
main.c:45:25: error: implicit declaration of function 'partition' [-Wimplicit-function-declaration]
   45 |                 pivot = partition(array, array2, left, right);
      |                         ^~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#define rep(i, n) for (int i=0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

 // 締め切りが早いのを優先させる
int main() {
    int N;
    vector<P> p(N);
    rep(i, N) cin >> p[i].second >> p[i].first;
    sort(p.begin(), p.end());
    ll t = 0;
    rep(i, N) {
        t += p[i].second;
        if (t > p[i].first) {
            puts("No");
            return 0;
        }
    } 
    puts("Yes");
    return 0;
}


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

#include <iostream>
#include <map>
#include <vector>

using namespace std;

using pll = pair<long long, long long>;
bool cmp(pll a, pll b) {
  return a.second < b.second;
}

int main() {
  int n;
  vector<pll> v;

  cin >> n;

  v.resize(n);

  for (int i = 0; i < n; ++i) {
    cin >> v[i].first >> v[i].second;
  }

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

  bool enable = true;
  long long sum_time = 0;
  for (int i = 0; i < n; ++i) {
    sum_time += v[i].first;
    if (sum_time > v[i].second) {
      enable = false;
    }
  }
  if (enable) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


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

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

bool sortbysec(const pair<int,int> &a,
               const pair<int,int> &b)
{
    return (a.second < b.second);
}

int main()
{
    vector<pair<int,int>> vec;
    int N;
    cin >> N;
    for (int i=0;i<N;i++)
    {
        int a,b;
        cin >> a >> b;
        vec.push_back(make_pair(a, b));
    }
    sort(vec.begin(),vec.end(),sortbysec);
    int sum = 0;
    bool yes = true;
    for (int i=0;i<N;i++)
    {
        sum+=vec[i].first;
        if (sum > vec[i].second)
        {
            yes = false;
            break;
        }
    }
    if (yes)
    {
        cout << "yes" << endl;
    }
    else
        cout << "no" << endl;
}


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

#include <iostream>
#include <utility>
#include <vector>

using namespace std;

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

  int n;
  cin >> n;
  vector<pair<int, int>> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].second >> v[i].first;
  }
  sort(v.begin(), v.end());
  int t = 0;
  for (int i = 0; i < n; i++) {
    t += v[i].second;
    if (t > v[i].first) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > tasks;
  
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    tasks.emplace_back(b, a);
  }
  
  sort(tasks.begin(),tasks.end());
  int sum = 0;
  bool possible = true;
  for (auto v : tasks) {
    sum += v.second;
    
    if (sum > v.first) {
      possible = false;
      break;
    }
  }
  cout << (isyes ? "Yes" : "No") << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:23: error: 'N' was not declared in this scope
    9 |   for (int i = 0; i < N; i++) {
      |                       ^
a.cc:26:12: error: 'isyes' was not declared in this scope
   26 |   cout << (isyes ? "Yes" : "No") << endl;
      |            ^~~~~
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int taskCount = sc.nextInt();
    ArrayList<Task> tasks = new ArrayList<>();
    for (int i = 0; i <= taskCount; i++) {
      tasks.add(new Task(sc.nextInt(), sc.nextInt()));
    }
    Collections.sort(tasks, new TaskComparator());
    int totalTime = 0;
    for (Task task : tasks) {
      totalTime += task.getRequiredTime();
      if (totalTime > task.getDeadline()) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }

class Task {

  public Task(int requiredTime, int deadline) {
    this.requiredTime = requiredTime;
    this.deadline = deadline;
  }

  private int requiredTime;
  private int deadline;

  public int getRequiredTime() {
    return requiredTime;
  }

  public int getDeadline() {
    return deadline;
  }

}

class TaskComparator implements Comparator<Task> {

  @Override
  public int compare(Task t1, Task t2) {
    return t1.getDeadline() <= t2.getDeadline() ? -1: 1;
  }

}
}

Compiler output:
Main.java:13: error: non-static variable this cannot be referenced from a static context
      tasks.add(new Task(sc.nextInt(), sc.nextInt()));
                ^
Main.java:15: error: non-static variable this cannot be referenced from a static context
    Collections.sort(tasks, new TaskComparator());
                            ^
2 errors
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int taskCount = sc.nextInt();
    ArrayList<Task> tasks = new ArrayList<>();
    for (int i = 0; i <= taskCount; ++i) {
      tasks.add(new Task(sc.nextInt(), sc.nextInt()));
    }
    Collections.sort(tasks, new TaskComparator());
    int totalTime = 0;
    for (Task task : tasks) {
      totalTime += task.getRequiredTime();
      if (totalTime > task.getDeadline()) {
        System.out.println("No");
        return;
      }
    }
    System.out.println("Yes");
  }

class Task {

  public Task(int requiredTime, int deadline) {
    this.requiredTime = requiredTime;
    this.deadline = deadline;
  }

  private int requiredTime;
  private int deadline;

  public int getRequiredTime() {
    return requiredTime;
  }

  public int getDeadline() {
    return deadline;
  }

}

class TaskComparator implements Comparator<Task> {

  @Override
  public int compare(Task t1, Task t2) {
    return t1.getDeadline() <= t2.getDeadline() ? -1: 1;
  }

}
}

Compiler output:
Main.java:13: error: non-static variable this cannot be referenced from a static context
      tasks.add(new Task(sc.nextInt(), sc.nextInt()));
                ^
Main.java:15: error: non-static variable this cannot be referenced from a static context
    Collections.sort(tasks, new TaskComparator());
                            ^
2 errors
Language: C++

#include <iostream>
#include <vector>

using namespace std;

class Task{
private:
public:
  int work, time_limit;
  Task(): work(0), time_limit(0){}
  Task(int w, int tl): work(w), time_limit(tl){}
};

bool cmp(const Task &a, const Task &b) {
  return a.time_limit < b.time_limit;
}

int main() {
  int n;
  cin >> n;
  vector<Task> task;
  int work, time_limit;
  for (int i = 0; i < n; i++) {
    cin >> work >> time_limit;
    task.push_back(Task(work, time_limit));
  }


  sort(task.begin(), task.end(), cmp);

  int sum[n];
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      sum[i] = task[i].work;
    } else {
      sum[i] = sum[i-1] + task[i].work;
    }
    if (sum[i] > task[i].time_limit) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}

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

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


class Work implements Comparable<Work> {
	int _a, _b, _idx;
	public Work (int a, int b, int idx) {
		_a = a; _b = b; _idx = idx;
	}

	@Override
	public int compareTo (Work w) {
		int r =  _b-w._b;
		if (r!=0)
			return r;
		r = _a-w._a;
		if (r!=0)
			return r;
		r = _idx-w._idx;
		return r;
	}
}



public class D {

	public static void main (String[] args) {
		int N;
		Scanner sc = new Scanner (System.in);
		TreeSet<Work> set = new TreeSet<Work> ();
		N = sc.nextInt ();
		for (int i=0; i<N; i++) {
			int a = sc.nextInt(), b = sc.nextInt();
			Work w = new Work (a,b,i);
			set.add (w);
		}

		Iterator<Work> iterator = set.iterator ();
		int time = 0;
		while (iterator.hasNext ()) {
			Work w = iterator.next ();
			time += w._a;
			if (time>w._b) {
				System.out.println ("No");
				return;
			}
		}
		System.out.println ("Yes");
	}
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,t=0;
	cin >> n;
	int a[n*2];
	for(int i=0;i<n*2;i++)
		cin >> a[i];
	for(int i=0;i<n;i++)
		for(int j=i;j<n;j++)
		{
			if(t+a[j*2] <= a[j*2+1])
				t += a[j*2];
			if(j==n-1 && t+a[j] <= a[j*2+1])
			{	
				puts("Yes");
				return 0;
			}
		}
	puts("No");
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: expected '}' at end of input
   22 |         return 0;
      |                  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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


int main() {
    int n;
    vector<pair<int, int> > tasks;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        tasks.emplace_back(b, a);
    }

    sort(tasks.begin(), tasks.end());
    bool flag = true;
    int sum = 0;

    for (int j = 0; j < n; j++) {
        sum += j.second;
        for (sum > j.first) {
            flag = false;
            break;
        }
    }
    cout <<  (ans ? "Yes" : "No") << endl; 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: request for member 'second' in 'j', which is of non-class type 'int'
   19 |         sum += j.second;
      |                  ^~~~~~
a.cc:20:22: error: request for member 'first' in 'j', which is of non-class type 'int'
   20 |         for (sum > j.first) {
      |                      ^~~~~
a.cc:24:5: error: expected primary-expression before '}' token
   24 |     }
      |     ^
a.cc:23:10: error: expected ';' before '}' token
   23 |         }
      |          ^
      |          ;
   24 |     }
      |     ~     
a.cc:24:5: error: expected primary-expression before '}' token
   24 |     }
      |     ^
a.cc:23:10: error: expected ')' before '}' token
   23 |         }
      |          ^
      |          )
   24 |     }
      |     ~     
a.cc:20:13: note: to match this '('
   20 |         for (sum > j.first) {
      |             ^
a.cc:24:5: error: expected primary-expression before '}' token
   24 |     }
      |     ^
a.cc:25:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     cout <<  (ans ? "Yes" : "No") << endl;
      |               ^~~
      |               abs
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
using namespace __gnu_pbds;
using namespace std;
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
typedef long long ll;
typedef long double ld;	

ll mod = 1e9+7;

struct job{
	ll time;
	ll dead;
	bool operator <(const job& rhs) const{
		return dead < rhs.dead;
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n;
	cin >> n;
	vector <job> arr(n);
	for (int z=0;z<n;z++){
		cin >> arr[z].time >> arr[z].dead;
	}
	sort(arr.begin(),arr.end());
	ll current = 0;
	bool ok = true;
	for (int z=0;z<n;z++){
		current += arr[z].time;
		if (current > arr[z].dead){
			ok = false; break;
		}
	}
	if (ok) cout << "Yes" << endl;
	else cout << "No" << endl;
	cin >> n;
}

Compiler output:
a.cc:24:2: error: expected ';' after struct definition
   24 | }
      |  ^
      |  ;
Language: C++

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



int main(){
vector<pair<int,int>> tas;
ll n,tmp1,tmp2;
cin>>n;
for(int i=0;i<n;i++){
cin>>tmp1>>tmp2;
tas.emplace_back(make_pair(tmp2,tmp1));
}

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

int t=0;
for(int i=0;i<n;i++){
t+=tas[i].second;
if(tas[i].first<t){

        printf("No\n");
        return 0;
}
}



printf("Yes\n");

}
~
~

Compiler output:
a.cc:34:1: error: expected class-name before '~' token
   34 | ~
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
vector<pair<int,int>> jobs;
comp(pair<int,int> const &a,pair<int,int> const &b){
    return a.second < b.second;
}
int32_t main(){
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        jobs.push_back({a,b});
    }
    sort(jobs.begin(),jobs.end(),comp);
    int s = 0;
    for(pair<int,int> p : jobs){
        s+=p.first;
        if(s>p.second){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
    return 0;
}


Compiler output:
a.cc:5:1: error: ISO C++ forbids declaration of 'comp' with no type [-fpermissive]
    5 | comp(pair<int,int> const &a,pair<int,int> const &b){
      | ^~~~
Language: C++

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (InputReader in = new InputReader(); PrintWriter out = new PrintWriter(System.out)) {
            new Main().solve(in, out);
            out.flush();
        }
    }

    void solve(InputReader in, PrintWriter out) {
        int N = in.nextInt();
        List<Task> taskList = new ArrayList<>(N);
        for (int i = 0; i < N; i++) {
            int a = in.nextInt();
            int b = in.nextInt();
            taskList.add(new Task(a, b));
        }
        taskList.sort((x, y) -> Integer.compare(x.B, y.B));

        long currentTime = 0;
        for (Task task : taskList) {
            currentTime += task.A;

            if (currentTime > task.B) {
                out.println("No");
                return;
            }
        }

        out.println("Yes");
    }
}

class Task {
    int A;
    int B;

    Task(int a, int b) {
        A = a;
        B = b;
    }
}

class InputReader implements AutoCloseable {
    private final Scanner sc = new Scanner(System.in);

    String next() {
        return this.sc.next();
    }

    int nextInt() {
        return Integer.parseInt(this.sc.next());
    }

    long nextLong() {
        return Long.parseLong(this.sc.next());
    }

    double nextDouble() {
        return Double.parseDouble(this.sc.next());
    }

    @Override
    public void close() {
        this.sc.close();
    }
}


Compiler output:
a.cc:67:5: error: stray '@' in program
   67 |     @Override
      |     ^
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.PrintWriter;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.ArrayList;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.List;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.Scanner;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Main {
      | ^~~~~~
a.cc:46:2: error: expected ';' after class definition
   46 | }
      |  ^
      |  ;
a.cc:48:30: error: expected initializer before 'AutoCloseable'
   48 | class InputReader implements AutoCloseable {
      |                              ^~~~~~~~~~~~~
Language: C++

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

int main(){
  long long int a,b,c,d=0,e;
  cin>>a;
  vector<pair<int,int>> ps(a);
  for(int i=0;i<a;i++){
    cin >> b>>c;
    ps[i]=make_pair(c,b);
  }
  sort(ps.begin(),ps.end());
  e=ps[a-1].first;
  for(int i=0;i<a;i++){
    d+= ps[i].second;
    if(d>ps[i].first){
      e=0;
      break;
    }
  }
  if(d>e)cout << "No" << endl;
  else cout<< "Yes"<<endl;
  }
}
  
    


Compiler output:
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

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

int main(){
  long long int a,b,c,d=0,e,g=1;
  cin>>a;
  vector<pair<int,int>> ps(a);
  for(int i=0;i<a;i++){
    cin >> b>>c;
    if(b=>c){
      g=0;
      cout << "No" <<endl;
      break;
    }
    ps[i]=make_pair(c,b);
  }
  if(g){
  sort(ps.begin(),ps.end());
  e=ps[a-1].first;
  for(int i=0;i<a;i++){
    d+= ps[i].second;
  }
  if(d>e)cout << "No" << endl;
  else cout<< "Yes"<<endl;
  }
}
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: expected primary-expression before '>' token
   10 |     if(b=>c){
      |          ^
Language: C++

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

int main(){
  long long int a,b,c,d=0,e,g;
  cin>>a;
  vector<pair<int,int>> ps(a);
  for(int i=0;i<a;i++){
    cin >> b>>c;
    if(b>c){
      cout<<"No"<<endl;
      break;
      g=1;
    }
    ps[i]=make_pair(c,b);
  }
  if(g==1)break;
  sort(ps.begin(),ps.end());
  e=ps[a-1].first;
  for(int i=0;i<a;i++){
    d+= ps[i].second;
  }
  if(d>e||g==1)cout << "No" << endl;
  else cout<< "Yes"<<endl;
}
  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: break statement not within loop or switch
   17 |   if(g==1)break;
      |           ^~~~~
Language: C++

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

int n;
const int maxn = 200000 + 5;

struct P
{
	int a;
	int b;
	int num;
};

P mem[maxn];

bool cmp(const P x, const P y)
{
	return  x.b < y.b;
}

bool solve()
{
	sort(mem, mem+n, cmp);
	for(int day = 0, p = 0; p < n; p++)
	{
		day += mem[p].a;
		if(day > mem[p].b) return false;
	}
	return true;
}

void Print()
{
	cout << "show" << endl;
	for(int i = 0; i < n; i++)
	{
		printf("%d ", mem[i].num);
	}
	printf("\n");
}

int main()
{
	scanf("%d", &n);
	for(int i = 0; i < n; i++)
	{
		cin >> mem[i].a >> mem[i].b;
		mem[i].num = i+1;
	}
	if(solve()) printf("Yes\n");
	else printf("No\n");
	//Print();
}

Compiler output:
a.cc: In function 'bool solve()':
a.cc:24:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |         sort(mem, mem+n, cmp);
      |         ^~~~
      |         short
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		List<AB> ab = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			ab.add(new AB(s.nextInt(), s.nextInt()));
		}

		ab.sort((obja, objb) -> obja.b - objb.b);
		for (AB e : ab) {
			System.out.println(e.b);
		}

		System.out.println((calc(ab) ? "Yes" : "No"));
	}

	public static boolean calc(List<AB> rests) {
		int time = 0;
		for (AB e : rests) {
			time += e.a;
			if (time > e.b) {
				return false;
			}
		}
		return true;
	}

	static class AB {
		final private int a;
		final private int b;

		public AB(int ina, int inb) {
			this.a = ina;
			this.b = inb;
		}
	}
}

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

#include<stdio.h>

//void sort(int n,int *a,int *b);

int main(void){
    int n,a[200000],b[200000],i,j,atmp,btmp,sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d %d",&a[i],&b[i]);
        }
    }
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            if(b[i]>b[j]){
                btmp=b[i];
                b[i]=b[j];
                b[j]=btmp;
                
                atmp=a[i];
                a[i]=a[j];
                a[j]=atmp;
            }
        }
    }
    for(i=0;i<n;i++){
        sum+=a[i];
        if(sum>b[i]){
            printf("No");
            return 0;
        }
    }
    printf("Yes");
    return 0;
}

/*void sort(int n,int *a,int *b){
    int i,j;
    
}*/


Compiler output:
main.c:12:5: error: expected identifier or '(' before 'for'
   12 |     for(i=0;i<n;i++){
      |     ^~~
main.c:12:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   12 |     for(i=0;i<n;i++){
      |              ^
main.c:12:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   12 |     for(i=0;i<n;i++){
      |                  ^~
main.c:25:5: error: expected identifier or '(' before 'for'
   25 |     for(i=0;i<n;i++){
      |     ^~~
main.c:25:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   25 |     for(i=0;i<n;i++){
      |              ^
main.c:25:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   25 |     for(i=0;i<n;i++){
      |                  ^~
main.c:32:12: error: expected declaration specifiers or '...' before string constant
   32 |     printf("Yes");
      |            ^~~~~
main.c:33:5: error: expected identifier or '(' before 'return'
   33 |     return 0;
      |     ^~~~~~
main.c:34:1: error: expected identifier or '(' before '}' token
   34 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
bool cmp(pair a,pair b)
{
  return a.second<b.second;
}
int main()
{
  int n;
  vector<pair<int,int>> jobs;
  for(int i=0;i<n;i++)
  {
    int a,b;
    cin>>a>>b;
    jobs.push_back(make_pair(a,b));
  }
  sort(jobs.begin(),jobs.end(),cmp);
  int cur=0;
  for()int i=0;i<n;i++)
  {
    if(cur+jobs[i].first>jobs[i].second)
    {
      cout<<"No";
      return 0;
    }
    cur+=jobs[i].first;
  }
  cout<<"Yes";
  return 0;
}

Compiler output:
a.cc:3:10: error: missing template argument list after 'std::pair'; template placeholder not permitted in parameter
    3 | bool cmp(pair a,pair b)
      |          ^~~~
      |              <>
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 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_pair.h:89:12: note: 'template<class _T1, class _T2> struct std::pair' declared here
   89 |     struct pair;
      |            ^~~~
a.cc:3:17: error: missing template argument list after 'std::pair'; template placeholder not permitted in parameter
    3 | bool cmp(pair a,pair b)
      |                 ^~~~
      |                     <>
/usr/include/c++/14/bits/stl_pair.h:89:12: note: 'template<class _T1, class _T2> struct std::pair' declared here
   89 |     struct pair;
      |            ^~~~
a.cc: In function 'bool cmp(...)':
a.cc:5:10: error: 'a' was not declared in this scope
    5 |   return a.second<b.second;
      |          ^
a.cc:5:19: error: 'b' was not declared in this scope
    5 |   return a.second<b.second;
      |                   ^
a.cc: In function 'int main()':
a.cc:19:7: error: expected primary-expression before ')' token
   19 |   for()int i=0;i<n;i++)
      |       ^
a.cc:19:16: error: 'i' was not declared in this scope
   19 |   for()int i=0;i<n;i++)
      |                ^
Language: C++

#include "bits/stdc++.h"
#define rep(i,a,b) for(int i=int(a);i<int(b);i++)
using ll = long long;
using namespace std;

ll GCD(ll a, ll b) {
	return b ? GCD(b, a%b) : a;
}

//sort(a, a + N, greater<int>())   // descend
//sort(a, a+N)                    //  ascend

int main() {
	ll n;
	cin >> n;

	ll a[220000];
	ll b[220000];
	ll c[220000];
	pair<ll, ll> p[n];
	for (ll i = 0; i < n; i++) {
		cin >> p[i].second >> p[i].first;
	}
	sort(p, p + n);


	bool y = true;

	rep(i,0,n) {
		if (p[i].second <= p[i].first) {
			p[i+1].first-=p[i].first;
		}
		else {
			y = false;
		.	break;
		}
	}
	if (y) cout << "Yes";
	else cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:17: error: expected primary-expression before '.' token
   35 |                 .       break;
      |                 ^
a.cc:35:25: error: expected unqualified-id before 'break'
   35 |                 .       break;
      |                         ^~~~~
Language: C++

#include "bits/stdc++.h"
#define rep(i,a,b) for(int i=int(a);i<int(b);i++)
using ll = long long;
using namespace std;

ll GCD(ll a, ll b) {
	return b ? GCD(b, a%b) : a;
}

//sort(a, a + N, greater<int>())   // descend
//sort(a, a+N)                    //  ascend

int main() {
	ll n;
	cin >> n;

	ll a[220000];
	ll b[220000];
	ll c[220000];
	pair<ll, ll> p[n];
	for (ll i = 0; i < n; i++) {
		cin >> p[i].second >> p[i].first;
	}
	sort(p, p + n);


	bool y = true;

	rep(i,0,n) {
		if (p[i].second <= p[i].first) {
			p.[i+1]first-=p[i].first;
		}
		else {
			y = false;
			break;
		}
	}
	if (y) cout << "Yes";
	else cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:27: error: expected unqualified-id before '[' token
   31 |                         p.[i+1]first-=p[i].first;
      |                           ^
Language: C++

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

int main(){
int n;
vector<pair<int,int>> a(n);
  for(int i =;i<n;i++)
    cin >> a.at(i).second >> a.at(i).first;

  int ans=0;
  int time =0;
  sort(a.begin(),a.end());
  
  for(pair<int,int> x : a){
  int s,t;
    tie(s,t) = x;
    time += t
    if(time >s){
    ans ++;
      break;
    }
      
  }
    
  if(ans >0) cout <<"No";
  else cout << "Yes";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: expected primary-expression before ';' token
    7 |   for(int i =;i<n;i++)
      |              ^
a.cc:17:14: error: expected ';' before 'if'
   17 |     time += t
      |              ^
      |              ;
   18 |     if(time >s){
      |     ~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <cmath>
#include <map>
#include <fstream>
#include <iterator>
#include "prettyprint.hpp"

using namespace std;
using ll = long long;

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

    vector<pair<ll, ll>> BA(N);
    for (int i = 0; i < N; i++)
    {
        int a, b;
        cin >> a >> b;
        BA[i] = make_pair(b, a);
    }

    sort(BA.begin(), BA.end());
    // cout << BA << endl;

    int now = 0;
    for (int i = 0; i < N; i++)
    {
        now += BA[i].second;
        if (BA[i].first < now)
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

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

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

int main(){
  int a,b,c,d=0;
  cin>>a;
  vector<pair<int,int>> ps(a);
  for(int i=0;i<a;i++){
    cin >> b>>c;
    ps[i]=make_pair(c,b);
  }
  sort(ps.begin(),ps.end());
  e=ps[a-1].first;
  for(int i=0;i<a;i++){
    d+= ps[i].second;
  }
  if(d<e)cout << "Yes" << endl;
  else cout<< "No"<<endl;
}
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: 'e' was not declared in this scope
   13 |   e=ps[a-1].first;
      |   ^
Language: C

#include <iostream>
#include <algorithm>
#include <stdio.h>
using namespace std;
int main(void){
    // Your code here!
    int a[200005],b[200005],n,o=0;
    long int q,p=0;
    
    scanf("%d",&n);
    
    for(int i=0;i<=n-1;i++){
        scanf("%d%d",&a[i],&b[i]);
        p+=a[i];
    }
    
    sort(b,b+n);
    
    for(int i=0;i<=n-1;i++){
        for(int u=0;u<=n-1-i;u++){
            q+=a[u];
        }
        if(p<q){
            o++;
        }
    }
    if(o==0){
        printf("Yes");
    }else{
        printf("No");
    }
}

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

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

using pll = pair<long long, long long>;
bool cmp(pll a, pll b) {
    return a.second < b.second;
}

int N;
vector<pll> v;

int main() {
    cin >> N;
    v.resize(N);
    for (int i = 0; i < N; ++i) cin >> v[i].first >> v[i].second;
    sort(v.begin(), v.end(), cmp);

    bool ok = true;
    long long sum = 0;
    for (int i = 0; i < N; ++i) {
        sum += v[i].first;
        if (sum > v[i].second) ok = false;
    }
    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:30: error: expected ';' before '}' token
   27 |     else cout << "No" << endl
      |                              ^
      |                              ;
   28 | }
      | ~
Language: C++

include<iostream>
using namespace std;
#define MAX 200000
int n;

bool dfs(int laps, int u, string c[], int a[], int b[]){
  c[u] = "black";
  laps = laps + a[u];
  bool h;
  if ( laps > b[u]){
    h = 0;
  } else {
    for ( int i = 1; i <= n; i++){
      if ( c[i] == "white" && dfs(laps, i, c, a, b)){
        h = 1;
        break;
      }
      h = 0;
    }
  }

  return h;
}

int main() {
  int laps = 0;
  int a[MAX+1], b[MAX+1];
  string c[MAX+1];
  cin >> n;
  for ( int i = 1; i <= n; i++){
    cin >> a[i] >> b[i];
  }

  // init
  for ( int i = 1; i <= n; i++){
    c[i] = "white";
  }

  string res;
  for ( int i = 1; i <= n; i++){
    if (dfs(laps, i, c, a, b)){
      res = "Yes";
      break;
    }
    res = "No";
  }

  cout << res << endl;

  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc:6:27: error: 'string' has not been declared
    6 | bool dfs(int laps, int u, string c[], int a[], int b[]){
      |                           ^~~~~~
a.cc: In function 'bool dfs(int, int, int*, int*, int*)':
a.cc:7:10: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    7 |   c[u] = "black";
      |          ^~~~~~~
      |          |
      |          const char*
a.cc:14:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |       if ( c[i] == "white" && dfs(laps, i, c, a, b)){
      |            ~~~~~^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:28:3: error: 'string' was not declared in this scope
   28 |   string c[MAX+1];
      |   ^~~~~~
a.cc:29:3: error: 'cin' was not declared in this scope
   29 |   cin >> n;
      |   ^~~
a.cc:36:5: error: 'c' was not declared in this scope
   36 |     c[i] = "white";
      |     ^
a.cc:39:9: error: expected ';' before 'res'
   39 |   string res;
      |         ^~~~
      |         ;
a.cc:41:22: error: 'c' was not declared in this scope
   41 |     if (dfs(laps, i, c, a, b)){
      |                      ^
a.cc:42:7: error: 'res' was not declared in this scope
   42 |       res = "Yes";
      |       ^~~
a.cc:45:5: error: 'res' was not declared in this scope
   45 |     res = "No";
      |     ^~~
a.cc:48:3: error: 'cout' was not declared in this scope
   48 |   cout << res << endl;
      |   ^~~~
a.cc:48:11: error: 'res' was not declared in this scope
   48 |   cout << res << endl;
      |           ^~~
a.cc:48:18: error: 'endl' was not declared in this scope
   48 |   cout << res << endl;
      |                  ^~~~
Language: C++

#include <iostream>
#include <string>
#include <cmath>
#include <numeric>
using namespace std;
//void inputer();
int A[1000000];
int B[1000000];
bool C[1000000];
int N;
int sum;
int sum2;
int check;
int ii;
int main() {
	cin >> N;
	
	for (int i = 0; i < N; i++) {
		cin >> A[i] >> B[i];
		bool C[i] = false;
	}


	//総和
	sum = 0;
	for (int i = 0; i < N; i++) {
		sum2 += A[i];
		sum += B[i];
	}

	for (int j = 0; j < N; j++) {
		ii = 0;
		for (int i = 1; i <= N; i++) {
			if (A[i] > A[ii] && C[i] == false) {
				ii = i;
			}
		}
		C[ii] = true;
		if (sum2 >= sum) {
			cout << "No";
			return 0;
		}
		sum2 -= A[ii];
		sum -= A[ii];
	}

	cout << "Yes";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:29: error: array must be initialized with a brace-enclosed initializer
   20 |                 bool C[i] = false;
      |                             ^~~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
	int N, time=0;
	cin>>N;
	int A[N], B[N], schedule[N],maximum, maxInd, sumT=0;
	for(int i=0; i<N; i++){
		cin>>A[i]>>B[i];
		schedule[i]=B[i]-A[i]
	}
	for(int run=N; run>0; run--){
	maximum=schedule[0];
	for(int i=1; i<N; i++){
		if(maximum<schedule[i])
		maximum=schedule[i];
		maxInd=i;
		for(int j=0; j<N; j++){
		if(j!=maxInd)
		sumT+=A[j];
	    }
	    if(maximum<sumT){
	    cout<<"No";
	    return 0;
	    }
	    else{
	    	A[i]=0;
	    	B[i]=0;
		}
	}
    }
    cout<<"Yes";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:38: error: expected ';' before '}' token
   10 |                 schedule[i]=B[i]-A[i]
      |                                      ^
      |                                      ;
   11 |         }
      |         ~
Language: C++


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

typedef struct {
    int s, f;
}Interval;
bool compare_f(const Interval &x, const Interval &y) {
    return x.f < y.f;
}

int main(int argc, const char * argv[]) {
    int N;
    int A, B;
    
    vector<Interval> J;
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A;
        cin >> B;
        Interval t;
        t.s = A;
        t.f = B;
        J.push_back(t);
    }
    
    vector<Interval> Ans;
    sort(J.begin(), J.end(), compare_f);
    int f = 0;
    for (int i = 0; i < J.size(); ++i) {
        if (J[i].s >= f) {
            Ans.push_back(J[i]);
            f = J[i].f;
        }
    }
    
    if (J.size() == Ans.size()) {
        cout << "Yes" << endl;
    }else {
        cout << "No" << endl;
    }
    
    
    return 0;
}

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

#include "bits/stdc++.h"
#define rep(i,a,b) for(int i=int(a);i<int(b);i++)
using ll = long long;
using namespace std;

ll GCD(ll a, ll b) {
	return b ? GCD(b, a%b) : a;
}

//sort(a, a + N, greater<int>())   // descend
//sort(a, a+N)                    //  ascend

int main() {
	ll n;
	cin >> n;

	ll a[220000];
	ll b[220000];
	ll c[220000];
	rep(i, 0, n) cin >> a[i] >> b[i];
	rep(i, 0, n) c[i] = b[i] - a[i];

	sort(c,c + n);

	bool y = true;

	rep(i,0,n) {
		if (c[i] >= 0) {
			c[i + 1] -= c[i];
		}
		else y{
			y = false;
		break;
		}
	}
	if (y) cout << "Yes";
	else cout << "No";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:23: error: expected ';' before '{' token
   31 |                 else y{
      |                       ^
      |                       ;
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>
#include<bits/stdc++.h>
#define REP(i, n) for(int i = 0; (i) < (n); (i)++)
using namespace std;
 
  //比較関数（を返す関数）
template<class T>
auto comp_idx(T* ptr){
  return [ptr](int l_idx, int r_idx){
    return ptr[l_idx] < ptr[r_idx];
  };
}

int main(){
  int N, T = 0;
  cin >> N;
  int A[N], B[N], str[N];
  REP(i,N) {
    cin >> A[i] >> B[i];
    str[i] = B[i];
  }

  //インデックスの配列を準備
  int idx[N];
  REP(i,l){
    idx[i] = i;
  }

  //インデックスソート
  sort(idx, idx+N, comp_idx(str));
  sort(B, B+N);
  
  for (int i = 0; i < N; i++) {
    T += A[idx[i]];
    if (T > B[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'l' was not declared in this scope
   31 |   REP(i,l){
      |         ^
a.cc:9:41: note: in definition of macro 'REP'
    9 | #define REP(i, n) for(int i = 0; (i) < (n); (i)++)
      |                                         ^
Language: Java

import java.util.ArrayList;
import java.util.Scanner;
import java.util.Comparator;
import java.util.Collections;

public final class Main {
    public static void main(String[] args){
        Scanner stdIn = new Scanner(System.in);

        long n = stdIn.nextInt();
        Set[] sets = new Set[n];
        for(long i=0; i<sets.length; i++){
            long a = stdIn.nextLong();
            long b = stdIn.nextLong();
            sets[i] = new Set(a, b);
        }
        ArrayList<Set> sets2 = new ArrayList<>();
        for(long i=0; i<sets.length; i++){
            sets2.add(sets[i]);
        }

        Collections.sort(sets2, new Comp());

        long kizaTime = 0;
        for(int i=0; i<sets2.size(); i++){
            kizaTime += sets2.get(i).a;
            if(kizaTime > sets2.get(i).b){
                System.out.println("No");
                return;
            }
        }

        System.out.println("Yes");
    }
}

class Set{
    public long a;
    public long b;
    Set(Long a, Long b){
        this.a = a;
        this.b = b;
    }
}

class Comp implements Comparator<Set> {
    public int compare(Set c1, Set c2) {
        if(c1.b < c2.b) {
            return -1;
        }else{
            return 1;
        }
    }
}


Compiler output:
Main.java:11: error: incompatible types: possible lossy conversion from long to int
        Set[] sets = new Set[n];
                             ^
Main.java:15: error: incompatible types: possible lossy conversion from long to int
            sets[i] = new Set(a, b);
                 ^
Main.java:19: error: incompatible types: possible lossy conversion from long to int
            sets2.add(sets[i]);
                           ^
3 errors
Language: C++

#include<iostream>
#include<cstdio>
#include<queue>
#include<string>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORS(i,a,b) for(int i=(a);i<=(b);i++)
#define FORR(i,a,b) for(int i=(a);i>=(b);i--)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) FORR(i,n,0)
#define si(n) scanf("%d", &n)
#define sc(s) scanf("%s", s)

using namespace std;
//typedef pair<int, int> P;
typedef pair<unsigned long long int, unsigned long long int> P;

int n;
P tasks[200000];
int main(void){
    si(n);
    rep(i,n) scanf("%llu %llu", &tasks[i].second, &tasks[i].first);

    sort(tasks, tasks+n);

    unsigned long long int t = 0;
    rep(i, n){
        t += tasks[i].second;
        if (t > tasks[i].first){
            printf("No\n");
            return 0;
        }
    }

    printf("Yes\n");
    return 0;
}



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

#include <iostream>
#include <vector>
#include <stack>
#include <thread>

using namespace std;
using ll = long long;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
const ll mod = 1e9 + 7;

int main() {
    ll n;
    cin >> n;
    vector<ll> a(n), b(n), ta(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    sort(a.begin(), a.end(), less<>());
    sort(b.begin(), b.end(), less<>());

    for (int i = 0; i < a.size(); i++) {
        if (i == 0) {
            ta[i] += a[i];
        } else {
            ta[i] += a[i] + ta[i - 1];
        }
    }

    auto ans = "Yes";
    for (int i = 0; i < b.size(); i++) {
        if (ta[i] > b[i]) {
            ans = "No";
            break;
        }
    }

    cout << ans << endl;
    return 0;
}


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

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

struct work{
    int time;
    int limit;

    work(int inputted_time, int inputted_limit){
        time = inputted_time;
        limit = inputted_limit;
    }
    bool operator<(const work &another) const{
        return limit < another.limit;
    };
};

int main(){
    int n;
    cin >> n;
    int a[n+1];
    int b[n+1];
    vector<work> worklist;
    for(int i = 1; i <= n; i++){
        cin >> a[i] >> b[i];
        worklist.push_back(work(a[i], b[i]));
    }
    sort(worklist.begin(), worklist.end());
    int now = 0;
    string ans = "Yes";
    for(int i = 0; i < worklist.size(); i++){
        now += worklist[i].time;
        if(now > worklist[i].limit){
            ans = "No";
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

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

#include <iostream>
#include <vector>
#include <stack>
#include <thread>

using namespace std;
using ll = long long;
const ll inf = (1 << 30) - 1;
const ll infll = (1LL << 61) - 1;
const ll mod = 1e9 + 7;

int main() {
    ll n, t = 0;
    cin >> n;
    vector<ll> a(n), b(n), ta(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }
    sort(a.begin(), a.end(), less<ll>());
    sort(b.begin(), b.end(), less<ll>());

    for (int i = 0; i < a.size(); i++) {
        if (i == 0) {
            ta[i] += a[i];
        } else {
            ta[i] += a[i] + ta[i - 1];
        }
    }

    auto ans = "Yes";
    for (int i = 0; i < b.size(); i++) {
        if (ta[i] > b[i]) {
            ans = "No";
            break;
        }
    }

    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |     sort(a.begin(), a.end(), less<ll>());
      |     ^~~~
      |     short