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

import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.AbstractMap.SimpleEntry;

public class Megalomania {

    static final int modnum = 1000000000 + 7;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        ArrayList<AbstractMap.SimpleEntry<Integer, Integer>> list = new ArrayList<AbstractMap.SimpleEntry<Integer, Integer>>();
        for (int i = 0; i < N; i++) {
            int work = sc.nextInt();
            int limit = sc.nextInt();
            list.add(new AbstractMap.SimpleEntry<Integer, Integer>(limit, work));
        }
        Collections.sort(list, Comparator.comparing(AbstractMap.SimpleEntry<Integer, Integer>::getKey));
        long time = 0;
        for (int i = 0; i < N; i++) {
            AbstractMap.SimpleEntry<Integer, Integer> working = list.get(i);
            if (time + working.getValue() <= working.getKey()) {

                // System.out.println(time + "   " + working.getKey() + "   " + working.getValue() + "   "
                //         + (working.getKey() + working.getValue()));
                time += working.getValue();
            }else{
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
        // long time = list.get(list.size() - 1).getKey() + list.get(list.size() -
        // 1).getValue();
        // while (!list.isEmpty()) {
        // int i;

        // for (i = list.size() - 1; i >= 0; i--) {
        // AbstractMap.SimpleEntry<Integer, Integer> working = list.get(i);
        // if (working.getKey() + working.getValue() <= time) {

        // System.out.println(time + " " + working.getKey() + " " + working.getValue() +
        // " "
        // + (working.getKey() + working.getValue()));
        // time -= working.getValue();
        // list.remove(i);
        // break;
        // }
        // }
        // if (i < 0) {
        // System.out.println("aaa");

        // AbstractMap.SimpleEntry<Integer, Integer> working = list.get(list.size() -
        // 1);
        // time = working.getKey() + working.getValue();
        // }
        // }

        // if (time < 0) {
        // System.out.println("No");
        // } else {
        // System.out.println("Yes");
        // }
    }
}

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

#a, b, c, d = (int(i) for i in input().split())  
#W = [int(i) for i in input().split()] 

N= (int(input()))
flag = 0
A_list = []
B_list = []
AB_list = []
for i in range(N):
    a,b= (int(j) for j in input().split())  
    A_list.append(a)
    B_list.append(b)
    AB_list.append([a,b])
    pass
AB_list = sorted(AB_list, key=lambda x: x[1])
#print(AB_list)
now = 0
for ab in AB_list:
   now += ab[0]
   if ab[1] < now:
       flag = 1
       break
   pass
if flag == 1:
    print("No")
else:
    print("Yes")

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #a
    1 | #a, b, c, d = (int(i) for i in input().split())
      |  ^
a.cc:2:2: error: invalid preprocessing directive #W
    2 | #W = [int(i) for i in input().split()]
      |  ^
a.cc:16:2: error: invalid preprocessing directive #print
   16 | #print(AB_list)
      |  ^~~~~
a.cc:4:1: error: 'N' does not name a type
    4 | N= (int(input()))
      | ^
Language: C++

#include <iostream>
 using namespace std;

int main()
{
  int n;
  cin>>n;
  int a[n],b[n],c[n],d[n],s=0,f=0;
  for(int i=0;i<n;i++){
     cin>>a[i]>>b[i];
    }
  for(int i=0;i<n;i++){
    int k=0;
    for(int j=0;j<n;i++){
      c[i]=a[0];
      d[i]=b[0];
      if(a[j]!=0 && a[j]>c[i]){
        c[i]=a[j];
        d[i]=b[j];
        k=j;
      }
      a[k]=0;
      b[k]=0;  
    }
  }
  for(int i=0;i<n;i++){
    s+=c[i];
    if (s>d[i] && f=0){
      
      cout<<"No";
      f=1;
    }
  }
  if(f==0){
    cout<<"Yes";
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: lvalue required as left operand of assignment
   28 |     if (s>d[i] && f=0){
      |         ~~~~~~~^~~~
Language: C++

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

#define MAX_N 200000
int main()
{
	static int c[MAX_N]={};
	int tmp1,tmp2;
	int i = 0;
	int datanum;
	int flag = 0;
	int cnt = 0;
	int ftcheck = 1;
	int totalnum = 0;

	scanf("%d", &datanum);

	for (i = 0; i < datanum; i++) {
		scanf_s("%d %d", &tmp1, &tmp2);
		c[tmp2 - 1] += tmp1;
	}

	for (i = 0; i < MAX_N; i++) {
		if (c[i] != 0) {
			totalnum += c[i];
			c[i] = totalnum;
		}
	}

	for (i = 0; i < MAX_N; i++) {
		if (i + 1 < c[i]) {
			ftcheck = 0;
		}
		else {
		}
	}

	if (ftcheck == 1) {
		printf("Yes\n");
	}
	else {
		printf("No\n");
	}

	return 0;
}

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

#include <iostream>
 using namespace std;

int main()
{
  int n;
  cin>>n;
  int a[n],b[n],c[n],d[n],s=0,f=0;
  for(int i=0;i<n;i++){
     cin>>a[i]>>b[i];
    }
  for(int i=0;i<n;i++){
    int k=0;
    for(int j=0;j<n;i++){
      c[i]=a[0];
      d[i]=b[0];
      if(a[j]!=0 && a[j]>c[i]){
        c[i]=a[j];
        d[i]=b[j];
        k=j;
      }
      a[k]=0;
      b[k]=0;  
    }
  }
  for(int i=0;i<n;i++){
    s+=c[i];
    if (s>d[i] && f=0){
      
      cout<<"No";
      f=1;
    }
  }
  if(f=0){
    cout<<"Yes";
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: lvalue required as left operand of assignment
   28 |     if (s>d[i] && f=0){
      |         ~~~~~~~^~~~
Language: C++

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

int main(){
  int n,t1,t2;
  vector<int> a(n);
  vector<int> b(n);
  for(int i=0;i<n;i++){
    cin >> a[i] >> b[i];
  }
  
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
	if(b[i]>b[j]){
      t1=a[i];
      t2=b[i];
      a[i]=a[j];
      b[i]=b[j];
      a[j]=t1;
      b[j]=t2;
    }
   }
  }
  int sum=0,j=0;
  for(int i=0;i<n;i++){
	sum+=a[i];
    if(sum>b[i]) j=1;
  }
  
  if(j=1) cout << No << endl;
  else cout << Yes << end;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:19: error: 'No' was not declared in this scope
   30 |   if(j=1) cout << No << endl;
      |                   ^~
a.cc:31:16: error: 'Yes' was not declared in this scope
   31 |   else cout << Yes << end;
      |                ^~~
Language: C

//#include "pch.h"
#include "stdio.h"
#include "stdlib.h"

int main()
{
	int N;
	int *A, *B;
	scanf_s("%d", &N);
	A = (int *)malloc(sizeof(int) * 200000);
	B = (int *)malloc(sizeof(int) * 200000);
	for (int i = 0; i < N; i++)
	{
		scanf_s("%d %d", &A[i], &B[i]);
	}

	// sort
	for (int i = 0; i < N - 1; i++)
	{
		for (int j = i + 1; j < N; j++)
		{
			// swap
			int temp;
			if (B[i] > B[j])
			{
				temp = A[i];
				A[i] = A[j];
				A[j] = temp;
				temp = B[i];
				B[i] = B[j];
				B[j] = temp;
			}
		}
	}

	// judge
	int left = B[0] - A[0];
	if (left < 0)
	{
		printf("No");
		free(A);
		free(B);
		return 0;
	}
	for (int i = 1; i < N; i++)
	{
		left += B[i] - B[i - 1];
		if (left < A[i])
		{
			printf("No");
			free(A);
			free(B);
			return 0;
		}
		left -= A[i];
	}

	printf("Yes");
	free(A);
	free(B);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    9 |         scanf_s("%d", &N);
      |         ^~~~~~~
      |         scanf
Language: C++

//#include <bits/stdc++.h>
//using namespace std;
//
//int main() {
//	long long A,B,C,D;
//	cin >> A>>B>>C>>D;
//
//
//	int count=0;
//	for (int i = A; i <= B; i++) {
//		long long temp1=i, temp2 = i;
//		while (temp1 >= C) {
//			temp1 -= C;
//		}
//		while (temp2 >= D) {
//			temp2 -= D;
//		}
//		if (temp1 != 0 && temp2 != 0) count++;
//	}
//
//	cout << count << endl;
//	return 0;
//}

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

int main() {
	long long A, B, C, D;
	cin >> A >> B >> C >> D;

	int count = 0;
	for (int i = A; i <= B; i++) {
		if (float(i/C)= 0 && temp2 != 0) count++;
	}

	cout << count << endl;
	return 0;
}


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

#define ll long long


ll gcd_euclid(ll u, ll v) {
	ll r;
	while (0 != v) {
		r = u % v; u = v; v = r; /* swap */
	}
	return u;
}


int main() {
	ll A,B,C,D;
	cin >> A>>B>>C>>D;

	ll count=0;
	for (ll i = A; i <= B; i++) {

		int gcd_C = gcd_euclid(i, C);
		int gcd_D = gcd_euclid(i, D);

		if (((i / gcd_C) % (C/gcd_C)) != 0 &&
			((i / gcd_D) % (D/ gcd_D)) != 0) count++;
	}

	cout << count << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:38: error: 'temp2' was not declared in this scope
   34 |                 if (float(i/C)= 0 && temp2 != 0) count++;
      |                                      ^~~~~
a.cc: At global scope:
a.cc:57:5: error: redefinition of 'int main()'
   57 | int main() {
      |     ^~~~
a.cc:28:5: note: 'int main()' previously defined here
   28 | int main() {
      |     ^~~~
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    int[] a = new int[n];
    int[] b = new int[b];
    
    for(int i=0; i<n; i++){
      a[i] = sc.nextInt();
      b[i] = sc.nextInt();
    }
    
    for(int i=0; i<n; i++){
      for(int i=1; i<n; i++){
        if(b[i-1]>b[i]){
          int tmp = b[i-1];
          b[i-1] = b[i];
          b[i] = tmp;
          tmp = a[i-1];
          a[i-1] = a[i];
          a[i] = tmp;
        }
      }
    }
    
    int time = 0;
    boolean flag = true;
    for(int i=0; i<n; i++){
      if(time+a[i]>b[i]){
        flag = false;
        break;
      }
      else{
        time += a[i];
      }
    }
    
    if(falg == true){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}

Compiler output:
Main.java:9: error: incompatible types: int[] cannot be converted to int
    int[] b = new int[b];
                      ^
Main.java:17: error: variable i is already defined in method main(String[])
      for(int i=1; i<n; i++){
              ^
Main.java:41: error: cannot find symbol
    if(falg == true){
       ^
  symbol:   variable falg
  location: class Main
3 errors
Language: C++

#include <iostream>
 using namespace std;

int main()
{
  int n;
  cin>>n;
  int a[n],b[n],c[n],d[n],s=0,f=0;
  for(int i=0;i<n;i++){
     cin>>a[i]>>b[i];
    }
  for(int i=0;i<n;i++){
    int k=0;
    for(int j=0;j<n;i++){
      c[i]=a[0];
      d[i]=b[0];
      if(a[j]!=0 && a[j]>c[i]){
        c[i]=a[j];
        d[i]=b[j];
        k=j;
      }
      a[k]=0;
      b[k]=0;  
    }
  }
  for(int i=0;i<n;i++){
    s+=c[i];
    if (s>b[i]){
      
      cout<<"No";
      f=1;
    }
  }
  if(f=0){
    cout<<"Yes";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C

#include <stdio.h>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
using namespace std;

int main() {
  long long n, i, A[200005], B[200005], t, S, p;
  scanf("%lld", &n);
  for (i=0; i<n; i++) {
      scanf("%lld %lld", &B[i], &A[i]);
  }
  vector<pair<long long, long long> > pairs(n);
  
  for (int i = 0; i < n; i++) {
    pairs[i] = make_pair(A[i], B[i]);
  }

  // firstが小さい順、secondが小さい順にソート
  sort(pairs.begin(), pairs.end());
  
  for (int i = 0; i < n; i++) {
    t=pairs[i].first;
    pairs[i].first=pairs[i].second;
    pairs[i].second=t;
  }
  
  S=0; p=1;
  for (int i = 0; i < n; i++) {
    S+=pairs[i].first;
    if (S>pairs[i].second) p=0;
    // printf("%lld, %lld\n", S, pairs[i].second);
  }
  /*
  for (int i = 0; i < n; i++) {
    printf("(%lld,%lld) ", pairs[i].first, pairs[i].second);
  }
  puts(""); // => (0,0) (1,1) (1,9) (4,2) (4,8) (5,5) (6,4) (6,6) (9,3) (9,7)
  */
  if (p==0) printf("No");
  else printf("Yes");
  
  return 0;
}

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

#include <iostream>
 using namespace std;

int main()
{
  int n;
  cin>>n;
  int a[n],b[n],c[n],d[n],s=0,f=0;
  for(int i=0;i<n;i++){
     cin>>a[i]>>b[i];
    }
  for(int i=0;i<n;i++){
    int k=0;
    for(int j=0;j<n;i++){
      c[i]=a[0];
      d[i]=b[0];
      if(a[j]!=0 && a[j]>c[i]){
        c[i]=a[j];
        d[i]=b[j];
        k=j;
      }
      a[k]=0;
      b[k]=0;  
    }
  }
  for(int i=0;i<n;i++){
    s+=c[i];
    if (s>b[i]){
      
      cout<<"No";
      f=1
    }
  }
  if(f=0){
    cout<<"Yes"
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:10: error: expected ';' before '}' token
   31 |       f=1
      |          ^
      |          ;
   32 |     }
      |     ~     
a.cc:35:16: error: expected ';' before '}' token
   35 |     cout<<"Yes"
      |                ^
      |                ;
   36 | }
      | ~               
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdint.h>
#include<malloc.h>
#include<x86intrin.h>
#include<math.h>

int my_gets(char *buf,int nBuf,FILE *fp){
    int ch;

    while(--nBuf >0){
        ch=getc(fp);
        if(ch==EOF || ch=='\n')
            break;
        *(buf++)=(char)ch;
    }
    *(buf)='\0';

    return nBuf;
}

void InputIntAry(int *a,int nBuf,int N){
    char *buf,*ptr;

    buf=(char*)malloc(nBuf*sizeof(char));
    my_gets(buf,nBuf,stdin);

    ptr=strtok(buf," ");
    while(ptr!=NULL && N-->0){
        *(a++)=atoi(ptr);
        ptr=strtok(NULL," ");
    }
    free(buf);
}

void InputInt64Ary(int64_t *a,int nBuf,int N){
    char *buf,*ptr;

    buf=(char*)malloc(nBuf*sizeof(char));
    my_gets(buf,nBuf,stdin);

    ptr=strtok(buf," ");
    while(ptr!=NULL && N-->0){
        *(a++)=_atoi64(ptr);
        ptr=strtok(NULL," ");
    }
    free(buf);
}

#define MIN(a,b)  ( ((a)<(b))?(a):(b) )

typedef struct{
    int64_t A,B;
} TaskPair_t;

TaskPair_t Task[200000];

int CompareTask(const void* pTask1, const void *pTask2){
    TaskPair_t Task1=*((TaskPair_t*)pTask1),Task2=*((TaskPair_t*)pTask2);

    if(Task1.B > Task2.B)
        return 1;
    else if(Task1.B == Task2.B)
        return 0;
    else
        return -1;
}

int main(){
    int N;
    int64_t StTime,EdTime;

    scanf("%d%*c",&N);
    for(int i=0;i<N;i++){
        scanf("%lld %lld%*c", &(Task[i].A), &(Task[i].B));
    }
    qsort(Task, N, sizeof(TaskPair_t), CompareTask);
    
    EdTime=Task[N-1].B;                      //ギリギリに終わる時間設定
    for(int i=N-1;i>=0;i--){
        StTime = EdTime - Task[i].A;         //間に合う一番遅い時間
        //printf("%lld - %lld\n",StTime,EdTime);
        if(i>0){
            EdTime = MIN(StTime,Task[i-1].B);
        }
    }
    if(StTime >= 0){
        puts("Yes");
    }
    else
    {
        puts("No");
    }
    return 0;
}

Compiler output:
a.cc: In function 'void InputInt64Ary(int64_t*, int, int)':
a.cc:45:16: error: '_atoi64' was not declared in this scope; did you mean 'atoi'?
   45 |         *(a++)=_atoi64(ptr);
      |                ^~~~~~~
      |                atoi
Language: C++

#include <iostream>
 using namespace std;

int main()
{
  int n
  cin>>n;
  int a[n],b[n],c[n],d[n],s=0,f=0;
  for(int i=0;i<n;i++){
     cin>>a[i]>>b[i];
    }
  for(int i=0;i<n;i++){
    int k=0;
    for(int j=0;j<n;i++){
      c[i]=a[0];
      d[i]=b[0];
      if(a[j]!=0 && a[j]>c[i]){
        c[i]=a[j];
        d[i]=b[j];
        k=j;
      }
      a[k]=0;
      b[k]=0;  
    }
  }
  for(int i=0;i<n;i++){
    s+=c[i];
    if (s>b[i]){
      
      cout<<"No";
      f=1
    }
  }
  if(f=0){
    cout<<"Yes"
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'cin'
    7 |   cin>>n;
      |   ^~~
a.cc:8:9: error: 'n' was not declared in this scope
    8 |   int a[n],b[n],c[n],d[n],s=0,f=0;
      |         ^
a.cc:10:11: error: 'a' was not declared in this scope
   10 |      cin>>a[i]>>b[i];
      |           ^
a.cc:10:17: error: 'b' was not declared in this scope
   10 |      cin>>a[i]>>b[i];
      |                 ^
a.cc:15:7: error: 'c' was not declared in this scope
   15 |       c[i]=a[0];
      |       ^
a.cc:15:12: error: 'a' was not declared in this scope
   15 |       c[i]=a[0];
      |            ^
a.cc:16:7: error: 'd' was not declared in this scope
   16 |       d[i]=b[0];
      |       ^
a.cc:16:12: error: 'b' was not declared in this scope
   16 |       d[i]=b[0];
      |            ^
a.cc:27:8: error: 'c' was not declared in this scope
   27 |     s+=c[i];
      |        ^
a.cc:28:11: error: 'b' was not declared in this scope
   28 |     if (s>b[i]){
      |           ^
a.cc:31:10: error: expected ';' before '}' token
   31 |       f=1
      |          ^
      |          ;
   32 |     }
      |     ~     
a.cc:35:16: error: expected ';' before '}' token
   35 |     cout<<"Yes"
      |                ^
      |                ;
   36 | }
      | ~               
a.cc:36:2: error: expected '}' at end of input
   36 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <iostream>
 using namespace std;

int main()
{
  int cin >> n;
  int a[n],b[n],c[n],d[n],s=0,f=0;
  for(int i=0;i<n;i++){
     cin >> a[i] >> b[i];
    }
  for(int i=0;i<n;i++){
    int k=0
    for(int j=0;j<n;i++){
      c[i]=a[0];
      d[i]=b[0];
      if(a[j]!=0 && a[j]>c[i]){
        c[i]=a[j];
        d[i]=b[j];
        k=j
      }
      a[k]=0;
      b[k]=0;  
    }
  }
  for(int i=0;i<n;i++){
    s+=c[i];
    if (s>b[i]){
      
      cout << "No";
      f=1
    }
  }
  if(f=0){
    cout << "Yes"
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected initializer before '>>' token
    6 |   int cin >> n;
      |           ^~
a.cc:7:9: error: 'n' was not declared in this scope
    7 |   int a[n],b[n],c[n],d[n],s=0,f=0;
      |         ^
a.cc:9:13: error: 'a' was not declared in this scope
    9 |      cin >> a[i] >> b[i];
      |             ^
a.cc:9:21: error: 'b' was not declared in this scope
    9 |      cin >> a[i] >> b[i];
      |                     ^
a.cc:13:5: error: expected ',' or ';' before 'for'
   13 |     for(int j=0;j<n;i++){
      |     ^~~
a.cc:13:17: error: 'j' was not declared in this scope
   13 |     for(int j=0;j<n;i++){
      |                 ^
a.cc:13:24: error: expected ';' before ')' token
   13 |     for(int j=0;j<n;i++){
      |                        ^
      |                        ;
a.cc:26:8: error: 'c' was not declared in this scope
   26 |     s+=c[i];
      |        ^
a.cc:27:11: error: 'b' was not declared in this scope
   27 |     if (s>b[i]){
      |           ^
a.cc:30:10: error: expected ';' before '}' token
   30 |       f=1
      |          ^
      |          ;
   31 |     }
      |     ~     
a.cc:34:18: error: expected ';' before '}' token
   34 |     cout << "Yes"
      |                  ^
      |                  ;
   35 | }
      | ~                 
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include <iostream>
 using namespace std;

int main()
{
  int cin>>n;
  int a[n],b[n],c[n],d[n],s=0,f=0;
  for(int i=0;i<n;i++){
     cin>>a[i]>>b[i];
    }
  for(int i=0;i<n;i++){
    int k=0
    for(int j=0;j<n;i++){
      c[i]=a[0];
      d[i]=b[0];
      if(a[j]!=0 && a[j]>c[i]){
        c[i]=a[j];
        d[i]=b[j];
        k=j
      }
      a[k]=0;
      b[k]=0;  
    }
  }
  for(int i=0;i<n;i++){
    s+=c[i];
    if (s>b[i]){
      
      cout<<"No";
      f=1
    }
  }
  if(f=0){
    cout<<"Yes"
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: expected initializer before '>>' token
    6 |   int cin>>n;
      |          ^~
a.cc:7:9: error: 'n' was not declared in this scope
    7 |   int a[n],b[n],c[n],d[n],s=0,f=0;
      |         ^
a.cc:9:11: error: 'a' was not declared in this scope
    9 |      cin>>a[i]>>b[i];
      |           ^
a.cc:9:17: error: 'b' was not declared in this scope
    9 |      cin>>a[i]>>b[i];
      |                 ^
a.cc:13:5: error: expected ',' or ';' before 'for'
   13 |     for(int j=0;j<n;i++){
      |     ^~~
a.cc:13:17: error: 'j' was not declared in this scope
   13 |     for(int j=0;j<n;i++){
      |                 ^
a.cc:13:24: error: expected ';' before ')' token
   13 |     for(int j=0;j<n;i++){
      |                        ^
      |                        ;
a.cc:26:8: error: 'c' was not declared in this scope
   26 |     s+=c[i];
      |        ^
a.cc:27:11: error: 'b' was not declared in this scope
   27 |     if (s>b[i]){
      |           ^
a.cc:30:10: error: expected ';' before '}' token
   30 |       f=1
      |          ^
      |          ;
   31 |     }
      |     ~     
a.cc:34:16: error: expected ';' before '}' token
   34 |     cout<<"Yes"
      |                ^
      |                ;
   35 | }
      | ~               
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^
Language: C++

#include<iostream>
#include<stdlib>
using namespace std;
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}
int main()
{
  // 1 <= N <= 2 * 10^5
  // 1 <= A[i],B[i] <= 10^9
  int N;
  cin >> N;
  long A[N], B[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
  }
  qsort(A, N, sizeof(long), compare_int);
  qsort(B, N, sizeof(long), compare_int);
  for (int i = 0; i < N; i++) {
    if (A[i] > B[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


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

#include<iostream>
using namespace std;
int main()
{
  // 1 <= N <= 2 * 10^5
  // 1 <= A[i],B[i] <= 10^9
  int N;
  cin >> N;
  long A[N], B[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
  }
  for (int i = 0; i < N; i++) {
    if (A[i] > B[i]) {
      cout << "No" << endl;
      return;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


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

n = int(input())
l = []
for i in range(n):
    s = input().split()
    l.append([int(s[1]),int(s[0])])
    
l.sort()
a = 0
for i in range(n):
    a+=l[i][1]
    if a>l[i][0]:
        print("No")
        exit(0)
        
print("Yes")

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

#include<iostream>
#include<stdlib>
using namespace std;
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}
int main()
{
  // 1 <= N <= 2 * 10^5
  // 1 <= A[i],B[i] <= 10^9
  int N;
  cin >> N;
  long A[N], B[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
  }
  for (int i = 0; i < N; i++) {
    if (A[i] > B[i]) {
      cout << "No" << endl;
      return;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


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

#include<iostream>
#include<stdlib>
using namespace std;
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}
int main()
{
  // 1 <= N <= 2 * 10^5
  // 1 <= A[i],B[i] <= 10^9
  int N;
  cin >> N;
  long A[N], B[N];
  for (int i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
  }
  qsort(A, N, sizeof(long), compare_int);
  qsort(B, N, sizeof(long), compare_int);
  for (int i = 0; i < N; i++) {
    if (A[i] > B[i]) {
      cout << "No" << endl;
      return;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


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

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

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


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

#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;

int main() {
  int n,a,b,time=0;
  bool flag = true;
  cin >> n;
  vector<pair<int, int> > pairs(n);
  for(int i=0;i<n;i++){
      cin >> a>>b;
      if(b>time){
          time = b;
      }
      pairs[i] = make_pair(a,b);

  }
  sort(pairs.begin(),pairs.end());
  for(int i=n-1;i>=0;i--){
      time = time - pairs[i].first;
      if(time<0){
          flag = false;
          break;
      }
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;

  //cout << pairs << endl;

}


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

'use strict'

const INF = 900719925474099;
function mapint(temp){
    return temp.split(' ').map((v)=>parseInt(v));
}

function lower_bound(d,a,b,e){
    for(var c;1<b-a;)
        d[c=0|(a+b)/2]<e ? a=c : b=c;
    return d[a]<e?b:a
};

const MOD = 1000000007;

function Main(input){
    let temp = input.trim().split('\n');
    let n = parseInt(temp[0]);
    
    let ab = new Array(n);
    let tt;
    for(let i=0;i<n;i++){
      tt = mapint(temp[i+1]);
      ab[i] = {a:tt[0],b:tt[1]};
    }
    ab.sort((c,d)=>c.b-d.b);
    let sum = 0;
    let f = true;
    for(let i=0;i<n;i++){
      sum += ab[i].a;
      if(sum > ab[i].b){
        f=false;
        break;
      }
    }
    //console.log(ab.map((v)=>v.a + ' ' + v.b));
    if(f) console.log('Yes');
    else console.log('No');

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));



Compiler output:
a.cc:1:1: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
    1 | 'use strict'
      | ^~~~~~~~~~~~
a.cc:37:23: warning: multi-character character constant [-Wmultichar]
   37 |     if(f) console.log('Yes');
      |                       ^~~~~
a.cc:38:22: warning: multi-character character constant [-Wmultichar]
   38 |     else console.log('No');
      |                      ^~~~
a.cc:1:1: error: expected unqualified-id before '\x72696374'
    1 | 'use strict'
      | ^~~~~~~~~~~~
a.cc:4:1: error: 'function' does not name a type; did you mean 'union'?
    4 | function mapint(temp){
      | ^~~~~~~~
      | union
a.cc:8:1: error: 'function' does not name a type; did you mean 'union'?
    8 | function lower_bound(d,a,b,e){
      | ^~~~~~~~
      | union
a.cc:14:7: error: 'MOD' does not name a type
   14 | const MOD = 1000000007;
      |       ^~~
a.cc:16:1: error: 'function' does not name a type; did you mean 'union'?
   16 | function Main(input){
      | ^~~~~~~~
      | union
a.cc:42:5: error: expected constructor, destructor, or type conversion before '(' token
   42 | Main(require("fs").readFileSync("/dev/stdin", "utf8"));
      |     ^
Language: C

#include <stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:30:1: error: expected declaration or statement at end of input
   30 | }
      | ^
Language: C

#include <stdio.h>

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

Compiler output:
main.c: In function 'main':
main.c:10:7: error: 'i' undeclared (first use in this function)
   10 |   for(i=1;i<=n;i++){
      |       ^
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:1: error: expected declaration or statement at end of input
   30 | }
      | ^
Language: C

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

void bubbleSort(int* N, int*M, int len){
  int i,j;
  int temp, temp2;

  for(i=0; i<len; i++){
    for(j=len-1; j>i; j--){
      if(N[j] < N[j-1]){
        temp = N[j];
		temp2 = M[j];
        N[j] = N[j-1];
		M[j] = M[j-1];
        N[j-1] = temp;
		M[j-1] = temp2;
      }
    }
  }
}

int main(void)
{
	int N, i;
	int* A;
	int* B;
	int k;
	int time = 0;

	scanf("%d", &N);

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

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

	bubbleSort(B, A, N);

	for(i = 0; i < N; i++){
		if(time > B[i]){
			printf("No");
			k = 0;
			break;
		}else{
			time += A[i];
			if(time > B[i]){
				printf("No");
				k = 0:
				break;
			}
			k = 1;
		}
	}

	if(k == 1) printf("Yes");


	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:53:38: error: expected ';' before ':' token
   53 |                                 k = 0:
      |                                      ^
      |                                      ;
Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>

using namespace std;

typedef pair<long, long> P;

int N;
P work[300000];
bool ans=true;
long now=0;

int main() {
  cin >> N;

  //締め切り順でそーと
  for (int i=0;i<N;i++){
    cin >> work[i].second;
    cin >> work[i].first;
  }
  sort(work,work+N);

  for (int i=0;i<N;i++) {
    if (now+work[i].second <= work[i].first) {
      now += work[i].second;
    } else {
      ans = false;
      break;
    }
  }


  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   23 |   sort(work,work+N);
      |   ^~~~
      |   sqrt
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
	int n;
	cin>>n;
	vector<pair<ll, ll> > mp;
	ll x, y, sum = 0;
	for(int i = 0; i<n; i++){
		cin>>x>>y;
		mp.push_back(make_pair<ll, ll> (y,x));
	}
	sort(mp.begin(), mp.end());
	vector<pair<ll, ll> >::iterator it;
	for(it = mp.begin(); it != mp.end(); it++){
		sum += it->second;
		if(sum > it->first){
			cout<<"No\n";
			return 0;
		}
	}
	cout<<"Yes\n";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:49: error: cannot bind rvalue reference of type 'long long int&&' to lvalue of type 'long long int'
   11 |                 mp.push_back(make_pair<ll, ll> (y,x));
      |                                                 ^
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:1132:21: note:   initializing argument 1 of 'constexpr std::pair<typename std::__strip_reference_wrapper<typename std::decay<_Tp>::type>::__type, typename std::__strip_reference_wrapper<typename std::decay<_Tp2>::type>::__type> std::make_pair(_T1&&, _T2&&) [with _T1 = long long int; _T2 = long long int; typename __strip_reference_wrapper<typename decay<_Tp>::type>::__type = long long int; typename decay<_Tp>::type = long long int; typename __strip_reference_wrapper<typename decay<_Tp2>::type>::__type = long long int; typename decay<_Tp2>::type = long long int]'
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |               ~~~~~~^~~
Language: C++

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

using namespace std;

typedef pair<long, long> P;

int N;
P work[300000];
bool ans=true;
long now=0;

int main() {
  cin >> N;

  //締め切り順でそーと
  for (int i=0;i<N;i++){
    cin >> work[i].second;
    cin >> work[i].first;
  }
  sort(work,work+N);

  for (int i=0;i<N;i++) {
    if (now+work[i].second <= work[i].first) {
      now += work[i].second;
    } else {
      ans = false;
      break;
    }
  }


  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   23 |   sort(work,work+N);
      |   ^~~~
      |   sqrt
Language: C++

v#include <bits/stdc++.h>
#define itn int
#define rep(i, n) for(int i = 0; i < n; i++)
#define irep(i,n) for(int i = n-1; i>=0; i--)
using namespace std;
typedef long long ll;


int main() {
  ll n;
  cin >> n;
  vector<pair<ll,ll>> v(n);
  rep(i,n){
    pair<int,int> p;
    cin >> p.first >> p.second;
    v[i]=p;
  }
  while(1){
    bool a=false;
    for(int i=0;i!=n-1;i++){
      if(v[i].second>v[i+1].second){
        pair<int,int> p;
        v[i]=p;
        v[i]=v[i+1];
        v[i+1]=p;
        a=true;
      }
      else if(v[i].second<v[i+1].second){
        continue;
      }
      else{
        if(v[i].first>v[i+1].first){
          pair<int,int> p;
          v[i]=p;
          v[i]=v[i+1];
          v[i+1]=p;
          a=true;
        }
      }
    }
    if(a==false){
      break;
    }
  }
  ll time=0;
  rep(i,n){
    int f=v[i].first;
    int s=v[i].second;
    time+=f;
    if(time>s){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin >> n;
      |   ^~~
a.cc:12:3: error: 'vector' was not declared in this scope
   12 |   vector<pair<ll,ll>> v(n);
      |   ^~~~~~
a.cc:12:10: error: 'pair' was not declared in this scope
   12 |   vector<pair<ll,ll>> v(n);
      |          ^~~~
a.cc:12:17: error: expected primary-expression before ',' token
   12 |   vector<pair<ll,ll>> v(n);
      |                 ^
a.cc:12:20: error: expected primary-expression before '>>' token
   12 |   vector<pair<ll,ll>> v(n);
      |                    ^~
a.cc:12:23: error: 'v' was not declared in this scope
   12 |   vector<pair<ll,ll>> v(n);
      |                       ^
a.cc:14:10: error: expected primary-expression before 'int'
   14 |     pair<int,int> p;
      |          ^~~
a.cc:15:12: error: 'p' was not declared in this scope
   15 |     cin >> p.first >> p.second;
      |            ^
a.cc:22:14: error: expected primary-expression before 'int'
   22 |         pair<int,int> p;
      |              ^~~
a.cc:23:14: error: 'p' was not declared in this scope
   23 |         v[i]=p;
      |              ^
a.cc:33:16: error: expected primary-expression before 'int'
   33 |           pair<int,int> p;
      |                ^~~
a.cc:34:16: error: 'p' was not declared in this scope
   34 |           v[i]=p;
      |                ^
a.cc:51:7: error: 'cout' was not declared in this scope
   51 |       cout << "No" << endl;
      |       ^~~~
a.cc:51:23: error: 'endl' was not declared in this scope
   51 |       cout << "No" << endl;
      |                       ^~~~
a.cc:55:3: error: 'cout' was not declared in this scope
   55 |   cout << "No" << endl;
      |   ^~~~
a.cc:55:19: error: 'endl' was not declared in this scope
   55 |   cout << "No" << endl;
      |                   ^~~~
Language: C++

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

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

 
int main() {
  int N;
  LL T=0;
  bool ans = true;
  cin >> N;
  vector<PII> P;
  REP(i,N) {
    int A,B;
    cin >> A >> B;
    PII C;
    C = MP(B,A);
    P.PB(C);
  }
  SORT(P);
  REP(i,N) {
    int D=P.at(i).second, E=P.at(i).first;
    if(T+D <= E) {
      T += D;
    }
    else {
      ans = false;
    }
  }
  if(ans) {
    cout << "Yes" << endl;
  }
  else {
    << "No" << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:56:5: error: expected primary-expression before '<<' token
   56 |     << "No" << endl;
      |     ^~
Language: C++

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

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

 
int main() {
  int N;
  LL T=0;
  bool ans = true;
  cin >> N;
  vector<PII> P;
  REP(i,N) {
    int A,B;
    cin >> A >> B;
    PII C;
    C = MP(B,A);
    P.PB(C);
  }
  SORT(P);
  REP(i,N) {
    int D=P.at(i).second, E=P.at(i).first;
    if(T+D <= E) {
      T += D;
    }
    else {
      ans = false;
    }
  }
  if(ans) {
    cout << "Yes" << endl;
  }
  else {
    <<< "No" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:5: error: expected primary-expression before '<<' token
   56 |     <<< "No" << endl;
      |     ^~
a.cc:56:7: error: expected primary-expression before '<' token
   56 |     <<< "No" << endl;
      |       ^
a.cc:56:14: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   56 |     <<< "No" << endl;
      |         ~~~~~^~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int N;
	cin>>N;
	vector<long long>a(N);
	vector<long long>b(N);
	vector< pair<int,int> >p(N);
	for(int i=0;i<N;i++){
		cin>>a[i]>>b[i];
		p[i]=make_pair(b[i],a[i]);
	}
	sort(p.begin(),p.end());
	
	long long sum=0;
	bool ans=true;
	for(int i=0;i<N;i++){
		sum+=p[i].second;
		if(p[i].first<sum){
			ans=false;
		}
	}
	
	if(ans)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<long long>a(N);
      |         ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<algorithm>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:7:16: error: expected primary-expression before 'long'
    7 |         vector<long long>a(N);
      |                ^~~~
a.cc:8:16: error: expected primary-expression before 'long'
    8 |         vector<long long>b(N);
      |                ^~~~
a.cc:9:31: error: expected primary-expression before '>' token
    9 |         vector< pair<int,int> >p(N);
      |                               ^
a.cc:9:32: error: 'p' was not declared in this scope
    9 |         vector< pair<int,int> >p(N);
      |                                ^
a.cc:11:22: error: 'a' was not declared in this scope
   11 |                 cin>>a[i]>>b[i];
      |                      ^
a.cc:11:28: error: 'b' was not declared in this scope
   11 |                 cin>>a[i]>>b[i];
      |                            ^
Language: C++

#include<iostream>
#include<vector>
#include<utility>
#include<string>
#include<map> // pair
#include<algorithm>
using namespace std;
using ll = long long;
ll func(ll a,ll b){
  ll r = a % b;
  if(r==0)return b;
  return func(b,r);
}
int main(){
  ll n,x,y;
  cin >> n;
  pair<ll,ll> p[n];
  for(ll i=0;i<n;i++){
    cin >> x >> y;
    p[i] = make_pair(x,y);
  }
  sort(p,p+n);
  ll sum=0;
  bool can = true;
  for(ll i=0;i<n;i++){
    sum += p.second;
    if(sum > p.first){
      can = false;
      break;
    }
  }
  if(can){
    cout << "Yes";
  }else{
    cout << "No";
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: request for member 'second' in 'p', which is of non-class type 'std::pair<long long int, long long int> [n]'
   26 |     sum += p.second;
      |              ^~~~~~
a.cc:27:16: error: request for member 'first' in 'p', which is of non-class type 'std::pair<long long int, long long int> [n]'
   27 |     if(sum > p.first){
      |                ^~~~~
Language: C

//
// Created by yuu on 2019-06-22.
//
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <math.h>
#include <stack>
#include <queue>
#include <cstdio>

using namespace std;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}



int main(void){
    int N;
    cin>>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(), compare_by_b);

    int now_time = 0;
    int now_job = 0;

//    for (int i = 0; i < N; ++i) {
//        cout<<jobs[i].first<<" "<<jobs[i].second<<endl;
//    }

    while(1){
        if(now_job >= N){
            break;
        }

        if(jobs[now_job].second < now_time){
            cout<<"No"<<endl;
            return 0;
        }

        if(jobs[now_job].first == 0){
            now_job ++;
            continue;
        }

        jobs[now_job].first -= 1;
        now_time ++;
    }

    cout<<"Yes"<<endl;
    return 0;
}


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

#include<bits/stdc++.h>
#include <math.h>
#include<iostream>
#include <string>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int N;
    int task=0;
	cin >> N;
    vector<pair<long, long>> pairs(N);
    int B[N];
    int A[N];
    for(int i=0;i<N;i++){
    cin >> B[i];
    cin >> A[i];
    pairs[i] = make_pair(A[i], B[i]);
  }
  sort(pairs.begin(), pairs.end());
  string ans = "Yes"
  for(int i=0;i<N;i++){
    task+=pairs[i].first;
    if(task>pairs[i].second){
      ans = "No"
      break;
    }
  }
   cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:3: error: expected ',' or ';' before 'for'
   26 |   for(int i=0;i<N;i++){
      |   ^~~
a.cc:26:15: error: 'i' was not declared in this scope
   26 |   for(int i=0;i<N;i++){
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+50;
struct node{
	int a,b;
}c[maxn];
bool cmp(node x,node y)
{
	return x.b<y.b;
}
int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>c[i].a>>c[i].b;
	}
	sort(c,c+n,cmp);
	int tim=0;
	for(int i=0;i<n;i++)
	{
		if(t+c[i].a<=c[i].b)
		{
			t+=c[i].a;
		}
		else
		{
			cout<<"No";
			return 0;
		}
	}
	cout<<"Yes";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: 't' was not declared in this scope
   23 |                 if(t+c[i].a<=c[i].b)
      |                    ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<iomanip>
#include<set>

using namespace std;

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

	bool flag=true;
	long long count=0;
	for(int i=0;i<n;i++)
	{
		count+=ab[i].second;
		if(count>ab[i].first)
			flag=false;
	}

	cout << (flag ? "yes" : "no") << endl;






}

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