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

#include "bits/stdc++.h"
using namespace std;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	string a, upper = "", lower = "";
	int b, s;
	long long dis = 1000000000000000;
	cin >> a >> b;
	for(int i = a.length(), count; i >= 0 && (upper == "" || lower == ""); i--) 
	{
		bitset<10> num;
		for(int j = i - 1; j >= 0; j--)
		{ 	
			num.set(a[j] - '0');
		}
		count = num.count();
		if(count <= b)
		{
			if(i == a.length())
			{
				upper = a;
				break;
			}
			for(int j = a[i] - '0'; j >= 0 && lower == ""; j--)
			{
				if(count + !num.test(j) <= b)
				{
					for(int k = 9, sat = true; k >= 0; k--)
					{
						for(int l = i + 1, sat2 = false; l < a.length() && j == a[i] - '0'; l++)
						{
							if(a[l] - '0' == k)
							{
							
						if(count + !num.test(j) + !num.test(k) <= b)
						{
							for(int l = 0; l < i; l++)
							{
								lower += a[l];
							}
							lower += j + '0';
							for(int l = i + 1; l < a.length(); l++)
							{
								lower += k + '0';
							}
							break;
						}
					}
				}
			}
			for(int j = a[i] - '0'; j <= 9 && upper == ""; j++)
			{
				if(count + !num.test(j) <= b)
				{
					for(int k = j == a[i] - '0' ? a[i + 1] - '0' : 0; k <= 9; k++)
					{
						if(count + !num.test(j) + !num.test(k) <= b)
						{
							for(int l = 0; l < i; l++)
							{
								upper += a[l];
							}
							upper += j + '0';
							for(int l = i + 1; l < a.length(); l++)
							{
								upper += k + '0';
							}
							break;
						}
					}
				}
			}
		}
	}
	if(upper != "")
	{
		dis = min(dis, stoll(upper) - stoll(a));
	}
	if(lower != "")
	{
		dis = min(dis, stoll(a) - stoll(lower));
	}
	cout << upper << ":" << lower << ":" << dis << "\n";
}

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

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

int n;
int y;
int flag = 0;
int hoge;
int huga;
int piyo;

int main(void) {
	scanf("%d %d", &n, &y);
	for(int i = 0; i <= n; i++) {
		for(int j = 0; j <= n - i; j++) {
			for(int k = 0; k <= n - i - j; k++) {
				if(10000 * i + 5000 * j + 1000 * k aa
					flag = 1;
					hoge = i;
					huga = j;
					piyo = k;
					goto FINISH;
				}
			}
		}
	}
	FINISH:
	if(flag == 0) {
		hoge = -1;
		huga = -1;
		piyo = -1;
	}
	printf("%d %d %d\n", hoge, huga, piyo);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:17:67: error: expected ')' before 'aa'
   17 |                                 if(10000 * i + 5000 * j + 1000 * k aa
      |                                   ~                               ^~~
      |                                                                   )
main.c:23:33: error: expected expression before '}' token
   23 |                                 }
      |                                 ^
main.c: At top level:
main.c:27:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   27 |         FINISH:
      |               ^
main.c:33:16: error: expected declaration specifiers or '...' before string constant
   33 |         printf("%d %d %d\n", hoge, huga, piyo);
      |                ^~~~~~~~~~~~
main.c:33:30: error: expected declaration specifiers or '...' before 'hoge'
   33 |         printf("%d %d %d\n", hoge, huga, piyo);
      |                              ^~~~
main.c:33:36: error: expected declaration specifiers or '...' before 'huga'
   33 |         printf("%d %d %d\n", hoge, huga, piyo);
      |                                    ^~~~
main.c:33:42: error: expected declaration specifiers or '...' before 'piyo'
   33 |         printf("%d %d %d\n", hoge, huga, piyo);
      |                                          ^~~~
main.c:34:9: error: expected identifier or '(' before 'return'
   34 |         return 0;
      |         ^~~~~~
main.c:35:1: error: expected identifier or '(' before '}' token
   35 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int nb,total;
	cin>>nb>>total;
	int prix=0;
	int a=0;
	while (prix+10000<=total && nb>0)
	{
		nb--;
		a++;
		prix+=10000;
	}
	if (nb==0 && prix!=total)
	{
		cout<<-1<<" "<<-1<<" "<<-1;
		exit(0);
	}
	b=0;
	while (prix+5000<=total&&nb>0)
	{
		nb--;
		b++;
		prix+=5000;
	}
	if (nb==0 && prix!=total)
	{
		cout<<-1<<" "<<-1<<" "<<-1;
		exit(0);
	}
	int c=0;
	while (prix+1000<=total&&nb>0)
	{
		nb--;
		c++;
		prix+=1000;
	}
	if (prix==total)
	{
		cout<<a<<" "<<b<<" "<<c;
		exit(0);
	}
	cout<<-1<<" "<<-1<<" "<<-1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'b' was not declared in this scope
   20 |         b=0;
      |         ^
Language: C

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

int n;
int y;
int flag = 0;
int hoge;
int huge;
int piyo;

int main(void) {
	scanf("%d %d", &n, &y);
	for(int i = 0; i <= n; i++) {
		for(int j = 0; j <= n - i; j++) {
			for(int k = 0; k <= n - i -j; k++) {
				if(10000 * i + 5000 * j + 1000 * k == n) {
					flag = 1;
					hoge = i;
					huga = j;
					piyo = k;
					goto FINISH;
				}
			}
		}
	}
	FINISH:
	if(flag == 0) {
		hoge = -1;
		huga = -1;
		piyo = -1;
	}
	printf("%d %d %d", hoge, huga, piyo);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:20:41: error: 'huga' undeclared (first use in this function); did you mean 'huge'?
   20 |                                         huga = j;
      |                                         ^~~~
      |                                         huge
main.c:20:41: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
int main(){
  int N,M;cin>>N>>M;
  int count=0;
  int a=0;
  vector<int>A(N);
  vector<int>B(N);
  for(int i=0;i<N;i++){
    cin>>A[i]>>B[i];
    count+=B[i];
    a=max(a,A[i]);
  }
  if(count>M){
    cout<<(M-count+a-1)/a<<endl;
  }
  else{
    sort(B.rbegin(),B.rend());
    int ans=0;
    for(int i=0;i<N;i++){
      ans+=B[i];
      if(ans>=M){
        cout<<i+1<<endl;
      }
    }
  }
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
//using namespace __gnu_pbds;

#define ll  long long
#define PR  pair<int, int>

const int N = 3e5 + 10;
const int MOD = 1e9 + 7;
const long long INF = 5e18;
const double PI = 2 * acos(0.0);
//template<typename T> using ordered_set = tree<T, nulong long_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

ll a[N], b[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n, h;
    cin >> n >> h;
    for (int i = 1; i <= n; i++) {
        cin >> a[i] >> b[i];
    }
    sort(a + 1, a + n + 1, greater<ll>());
    sort(b + 1, b + n + 1, greater<ll>());
    ll ans = INF, L = 0, R = 1e9;
    while (L <= R) {
        ll mid = L + R >> 1;
        ll red = mid * a[1];
        ll now = h - red;
        if (now <= 0) {
            R = mid - 1;
            ans = tmp;
            continue;
        }
        ll tmp = mid;
        for (int i = 1; i <= n; i++) {
            if (now <= 0) {
                break;
            }
            now -= b[i];
            tmp++;
        }
        if (now <= 0) {
            R = mid - 1;
            ans = tmp;
        } else {
            L = mid + 1;
        }
    }
    cout << ans << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:19: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   36 |             ans = tmp;
      |                   ^~~
      |                   tm
Language: C++

#include <iostream>
using namespace std;
typedef long long ll;
const ll N=1e5;
#define loop(i,n) for(int i=0;i<(n);i++)
#define loopj(i,n) for(int j=1;j<=(n);j++)
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    fast;
    long long n,h,ar[a],arr[a],cnt=0,x,j;
    cin>>n>>h;
    for(int i=0; i<n; i++)
    {
        cin>>ar[i]>>arr[i];
    }
    sort(arr,arr+n);
    sort(ar,ar+n);
    x=ar[n-1];
    j=n-1;
    while(arr[j]>x)
    {
        cnt++;
        h-=arr[j];
        j--;
    }
    while(h>0)
    {
        h-=x;
        cnt++;
    }
    cout<<cnt<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: 'a' was not declared in this scope
   11 |     long long n,h,ar[a],arr[a],cnt=0,x,j;
      |                      ^
a.cc:15:14: error: 'ar' was not declared in this scope
   15 |         cin>>ar[i]>>arr[i];
      |              ^~
a.cc:15:21: error: 'arr' was not declared in this scope
   15 |         cin>>ar[i]>>arr[i];
      |                     ^~~
a.cc:17:10: error: 'arr' was not declared in this scope
   17 |     sort(arr,arr+n);
      |          ^~~
a.cc:17:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |     sort(arr,arr+n);
      |     ^~~~
      |     short
a.cc:18:10: error: 'ar' was not declared in this scope
   18 |     sort(ar,ar+n);
      |          ^~
Language: C++

# include <iostream>
# include <deque>
# include <math.h>
using namespace std;

int N;
int H;
int a[100005];
int b[100005];
deque< pair<int, char> > katanas;
int counter=0;
int throws=0;

bool sortkatanas(pair <int, char> a, pair <int, char> b)
{
    if (a.first>b.first)
    {
        return true;
    }

    return false;
}

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

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

    for (int i=1; i<=N; i++)
    {
        katanas.push_back(make_pair(a[i], 'a'));
        katanas.push_back(make_pair(b[i], 'b'));
    }

    sort(katanas.begin(), katanas.end(), sortkatanas);

    for (int i=0; i<katanas.size(); i++)
    {
        if (katanas[i].second=='b')
        {
            counter=counter+katanas[i].first;
            throws=throws+1;
        }

        if (katanas[i].second=='a')
        {
            cout<<ceil((double)(H-counter)/katanas[i].first)<<endl;
            throws=throws+ceil((double)(H-counter)/katanas[i].first);
            break;
        }
    }

    cout<<throws<<endl;
}

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

#include<stdio.h>
void quicksort(int a[],int s,int t){
  if(s<t){
    int i=s,j=t,p=a[(s+t)/2];
    while(1){
      while(a[i]>p)i++;
      while(p>a[j])j--;
      if(i>=j)break;
      a[i]^=a[j]^=a[i]^=a[j];
      i++;j--;
    }
    quicksort(a,s,i-1);quicksort(a,j+1,t);
  }
}
int main(){
  int n,h,a[100000],b[100000]i;
  scanf("%d%d",&n,&h);
  for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);
  quicksort(a,0,n-1);quicksort(b,0,n-1);
  i=0;while(b[i]>a[0]&&h>0&&i<n){h-=b[i];i++;}
  if(h>0)i+=(h+a[0]-1)/a[0];
  printf("%d",i);
}


Compiler output:
main.c: In function 'main':
main.c:16:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'i'
   16 |   int n,h,a[100000],b[100000]i;
      |                              ^
main.c:18:7: error: 'i' undeclared (first use in this function)
   18 |   for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);
      |       ^
main.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:39: error: 'b' undeclared (first use in this function)
   18 |   for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);
      |                                       ^
Language: C

#include<stdio.h>
void quicksort(int a[],int s,int t){
  if(s<t){
    int i=s,j=t,p=a[(s+t)/2];
    while(1){
      while(a[i]>p)i++;
      while(p>a[j])j--;
      if(i>=j)break;
      a[i]^=a[j]^=a[i]^=a[j];
      i++;j--;
    }
    quicksort(a,s,i-1);quicksort(a,j+1,t);
  }
}
int main(){
  int n,h,a[100000],b[100000];
  scanf("%d%d",&n,&h);
  for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);
  quicksort(a,0,n-1);quicksort(b,0,n-1);
  i=0;while(b[i]>a[0]&&h>0&&i<n){h-=b[i];i++;}
  if(h>0)i+=(h+a[0]-1)/a[0];
  printf("%d",i);
}


Compiler output:
main.c: In function 'main':
main.c:18:7: error: 'i' undeclared (first use in this function)
   18 |   for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);
      |       ^
main.c:18:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
void quicksort(int a[],int s,int t){
  if(s<t){
    int i=s,j=t,p=a[(s+t)/2];
    while(1){
      while(a[i]>p)i++;
      while(p>a[j])j--;
      if(i>=j)break;
      a[i]^=a[j]^=a[i]^=a[j];
      i++;j--;
    }
    quicksort(a,s,i-1);quicksort(a,j+1,t);
  }
}
int main(){
  int n,h,a[100000],b[100000],i=0;
  scanf("%d%d",&n,&h);
  for(i=0;i<n;i++)scanf("%d%d",&a[i],&b[i]);
  quicksort(a,0,n-1);quicksort(b,0,n-1);
  while(b[i]>a[0]&&h>0&&i<n){h-=b[i];i++;}
  if(h>0)i+=(h-c)/a[0]+();
  printf("%d",i);
}


Compiler output:
main.c: In function 'main':
main.c:21:16: error: 'c' undeclared (first use in this function)
   21 |   if(h>0)i+=(h-c)/a[0]+();
      |                ^
main.c:21:16: note: each undeclared identifier is reported only once for each function it appears in
main.c:21:25: error: expected expression before ')' token
   21 |   if(h>0)i+=(h-c)/a[0]+();
      |                         ^
Language: C++

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

int main() {
    long long N, M; cin >> N >> M;
    vector<long long>A(N), B(N);
    for (long long i = 0; i < N; i++) {
        cin >> A.at(i) >> B.at(i);
    }
    sort(A.begin(), A.end(), greater<long long>());
    sort(B.begin(), B.end(), greater<long long>());
    long long ans = 0;
    for (long long i = 0; i < N; i++) {
        if (B.at(i) > A.at(0)) {
            M -= B.at(i);
            ans++;
        }
        if (M <= 0) {
            cout << ans << endl;
            return 0;
        }
    }
    long long ans = M / A.at(0);
    if (M % A.at(0) != 0) ans++;
    cout << N + ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: redeclaration of 'long long int ans'
   25 |     long long ans = M / A.at(0);
      |               ^~~
a.cc:14:15: note: 'long long int ans' previously declared here
   14 |     long long ans = 0;
      |               ^~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end()     //昇順
#define RALL(x) (x).rbegin(), (x).rend()  // 降順
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
const long long mod = 1e9 + 7;
typedef long long ll;
typedef priority_queue<int> PQ;
typedef vector<long long> VL; // VL a(n);
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<VS> VSS;
typedef vector<VC> VCC;
typedef vector<VL> VLL; // VII a(n,VI(m)) n * m
typedef pair<ll, ll> PL;
typedef map<ll, ll> MP; // MP a;
typedef vector<pair<ll, ll>> PS; // PS a(n);

template <class T, class U>
bool chmax(T &a, U b) {
  if (a <= b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>
bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
  os << "}";
  return os;
}

// g++ -std=c++11 prac.cpp
// operator << (cout,a);
// chmin(min,a)

int main() {
  ll n,k,m,x=0,y=0,z = 0,h=0,w=0,ans=0,sum = 0, Max = -1, Min = 3e9+1;
  string t;
  bool ok=true; 
  cin >> n >> h;
  VL a(n),b(n);
  rep(i,n){
    cin >> a[i] >> b[i];
  }

  sort(ALL(a));
  sort(RALL(b));
  Max = a[n-1];


  rep(i,n){
    if(Max < b[i]){
      h -= b;
      ans++;
    }
    if(h<=0){
      pri(ans);
      return 0; 
    }
  }

  while(h>0){
    h -= Max; 
    ans++;
  } 
  pri(ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:9: error: no match for 'operator-=' (operand types are 'll' {aka 'long long int'} and 'VL' {aka 'std::vector<long long int>'})
   70 |       h -= b;
      |       ~~^~~~
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const long long mod = 1000000007;
const long long inf = 1e18;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n,h;
    cin>>n>>h;
    int a[n],b[n];
    int ma=0;
    int mat=-1;
    for(int i=0;i<n;i++){
        cin>>a[i]>>b[i];
        if(a[i]>ma){
            ma=a[i];
            mat=i;
        }
    }
    vector<int> v;
    for(int i=0;i<n;i++){
        if(i==mat)  continue;
        if(b[i]>ma)
            v.pb(b[i]);
    }
    sort(v.rbegin(),v.rend());
    int ans=0;
    
    if(v.size()>0){
        if(b[mat]>v[0]){
            h-=b[mat];
            b[mat]=0;
            ans=1;
        }
        for(int i=0;i<v.size();i++){
            h-=v[i].fi;
            ans+=1;
            if(h<=0) break;
        }
    }
    if(h>0){
        if(b[mat]>ma){
            ans+=1;
            h-=b[mat];
        }
        if(h>0){
            ans+=(h/ma);
            if(h%ma!=0)
                ans+=1;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: request for member 'first' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
    8 | #define fi first
      |            ^~~~~
a.cc:54:21: note: in expansion of macro 'fi'
   54 |             h-=v[i].fi;
      |                     ^~
Language: C++

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const long long mod = 1000000007;
const long long inf = 1e18;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n,h;
    cin>>n>>h;
    int a[n],b[n];
    int ma=0;
    int mat=-1;
    for(int i=0;i<n;i++){
        cin>>a[i]>>b[i];
        if(a[i]>ma){
            ma=a[i];
            mat=i;
        }
    }
    vector<int> v;
    for(int i=0;i<n;i++){
        if(i==mat)  continue;
        if(b[i]>ma)
            v.pb(b[i]);
    }
    sort(v.rbegin(),v.rend());
    int ans=0;
    
    if(v.size()>0){
        if(b[mat]>v[0].fi){
            h-=b[mat];
            b[mat]=0;
            ans=1;
        }
        for(int i=0;i<v.size();i++){
            h-=v[i].fi;
            ans+=1;
            if(h<=0) break;
        }
    }
    if(h>0){
        if(b[mat]>ma){
            ans+=1;
            h-=b[mat];
        }
        if(h>0){
            ans+=(h/ma);
            if(h%ma!=0)
                ans+=1;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: request for member 'first' in 'v.std::vector<int>::operator[](0)', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
    8 | #define fi first
      |            ^~~~~
a.cc:48:24: note: in expansion of macro 'fi'
   48 |         if(b[mat]>v[0].fi){
      |                        ^~
a.cc:8:12: error: request for member 'first' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
    8 | #define fi first
      |            ^~~~~
a.cc:54:21: note: in expansion of macro 'fi'
   54 |             h-=v[i].fi;
      |                     ^~
Language: C++

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
const int mod= 1e+9+7;

int main(){
    ll n,h; cin>>n>>h;
    vector<ll>a(n);
    vector<ll>b(n);
    rep(i,n){
        cin>>a[i]>>b[i];
    }
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    sort(b.begin(),b.end());
    reverse(b.begin(),b.end());
    ll A=a[0];
    ll cnt=0;
    ll ans=0;
    rep(i,n){
        if(A<b[i]){
            cnt++;
            ans+=b[i];
            if(ans=>h){
                cout<<cnt<<endl;
                return 0;
            }
    }
    else break;
}
ll remain=h-ans;
cnt+=(h-ans+A-1)/A;
cout<<cnt<<endl;
}



















































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

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Pl = pair<long long, long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

int main() {
    int N;
    ll H;
    cin >> N >> H;
    vecl A(N),B(N);
    ll ans = 0;
    REP(i,N) cin >> A[i] >> B[i];
    sort(B.begin(),B.end(),greater<ll>());
    sort(A.begin(),A.end(),greater<ll>());
    REP(i,N) {
        H -= B[i];
        ans++;
        if(H <= 0) {
            cout << ans << endl;
            return 0;
        }
    }
    if(H > 0) ans += H/A[0] + (H%A[i] == 0 ? 0 : 1);
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:36: error: 'i' was not declared in this scope
   49 |     if(H > 0) ans += H/A[0] + (H%A[i] == 0 ? 0 : 1);
      |                                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e16;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}
bool is_prime(ll n) {
  for (ll i = 2; i*i <= n; i++) {
    if (n%i == 0) return false;
  }
  return n != 1;
}
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow(x*x%mod, n/2, mod);
  if (n & 1) res = res * x % mod;
  return res;
}

int main() {
  ll n, h;
  cin >> n >> h;
  vector <pair <ll, ll>> a(n, pair <ll, ll> ());
  vector <pair <ll, ll>> b(n, pair <ll, ll> ());
  map <ll, ll> score;
  rep(i, n) {
    cin >> a.at(i).first >> b.at(i).first;
    a.at(i).second = i;
    b.at(i).second = -i;
    score[i] = b.at(i);
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  ll res = 1;
  ll ap = a.at(n-1).first, loc = a.at(n-1).second;
  h -= score.at(loc);
  for (ll i = n-1; b.at(i).second != -loc; i--) {
    if (h <= 0) break;
    h -= b.at(i).first;
    res++;
  }
  if (h > 0) {
    if (h%ap) res += h/ap + 1;
    else res += h/ap;
  }
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:20: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type' {aka 'std::pair<long long int, long long int>'} to 'std::map<long long int, long long int>::mapped_type' {aka 'long long int'} in assignment
   65 |     score[i] = b.at(i);
      |                ~~~~^~~
      |                    |
      |                    __gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type {aka std::pair<long long int, long long int>}
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
  ll N,H;
  cin >> N >> H;
  ll a[N],b[N];
  ll max_a = -1;
  for (int i = 0; i < N; i++) {
    cin >> a[i] >> b[i];
    max_a = max(a[i],max_a);
  }
  sort(b,b+N);
  reverse(b,b+N);
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    H -= B[i];
    ans++;
    if (H <= 0) {
      cout << ans << endl;
      return 0;
    }
  }
  ans += (H + max_a - 1) / max_a;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: 'B' was not declared in this scope
   19 |     H -= B[i];
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
  ll N,H;
  cin >> N >> H;
  ll a[N],b[N];
  ll max_a = -1;
  for (int i = 0; i < N; i++) {
    cin >> a[i] >> b[i];
    max_a = max(a[i],max_a);
  }
  sort(B,B+N);
  reverse(B,B+N);
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    H -= B[i];
    ans++;
    if (H <= 0) {
      cout << ans << endl;
      return 0;
    }
  }
  ans += (H + max_a - 1) / max_a;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: 'B' was not declared in this scope
   15 |   sort(B,B+N);
      |        ^
Language: C++

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

int main() {
    int N,H;
    cin >> N >> H;
    vector<int>a(N);
    vector<int>b(N);
    for(int i = 0; i < N; i++) { 
        cin >> a[i] >> b[i];
    }
    sort(a.begin(),a.end());
    sort(b,begin(),b.end());
    reverse(b.begin(),b.end());
    int MAX = a[N-1];
    int ans = 0;
    for(int i = 0; i < N; i++) {
        if(H < 0) {
            cout << ans << endl;
            return 0;
        }
        if(b[i] >= MAX) {
            ans++;
            H-=b[i];
        }
    }
    cout << ans+(H+MAX-1)/MAX << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: no matching function for call to 'begin()'
   13 |     sort(b,begin(),b.end());
      |            ~~~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:95:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1227:5: note: candidate: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1238:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1238:5: note:   candidate expects 1 argument, 0 provided
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,a,n) for(ll i = a;i < n;i++)
#define rrep(i,a,n) for(ll i = n; i >= a;i--)
#define index_check(i,n) if(i > n-1 || i < 0) continue; 
#define LINF 1e18
#define INF 1e9
using namespace std;

#define fs first
#define sc second

using P = pair<ll,ll>;
using PQ = priority_queue<P,vector<P>,greater<P>>;

int main(){
    ll n,h;
    cin >> n >> h;
    P a[n],b[n];

    rep(i,0,n){
        cin >> a[i].fs >> b[i].fs;
        a[i].sc = i;
        b[i].sc = i;
    }

    sort(a,a+n,greater<P>());
    sort(b,b+n,greater<P>());

    ll cnt = 0;

    rep(i,0,n){
        if(a[0].sc != b[i].sc && a[0].fs <= b[i].fs){
            h -= b[i].fs;
            cnt++;
        }

        if(h <= 0){
            break;
        }
    }

    cnt += max(ceil((double)(h-b[0].fs)/(double)a[0].fs),0LL) + 1;
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:15: error: no matching function for call to 'max(double, long long int)'
   43 |     cnt += max(ceil((double)(h-b[0].fs)/(double)a[0].fs),0LL) + 1;
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:43:15: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'long long int')
   43 |     cnt += max(ceil((double)(h-b[0].fs)/(double)a[0].fs),0LL) + 1;
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:43:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   43 |     cnt += max(ceil((double)(h-b[0].fs)/(double)a[0].fs),0LL) + 1;
      |            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main() {
	int64_t n, h;
	cin >> n >> h;
	vector<vector<int64_t>> ad(2 * n,vector<int64_t>(2));
	for (int i = 0; i < n; i++) {
		int64_t x = 0;
		int64_t y = 0;
		cin >> x >> y;
		ad.at(i*2) = { x,0 };
		ad.at(i*2 + 1) ={y,1};
	}
	sort(ad.begin(), ad.end());
	reverse(ad.begin(), ad.end());
	int64_t ans = 0;
	int64_t pos = 0;
	while (h > 0) {
		if (ad.at(pos).at(1) == 1) {
			ans++;
			h -= ad.at(pos).at(0);
			pos++;
		}
		else break;
	}
	ans += 1 + ((h-1) / ad.at(pos).at(0)));
	cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:46: error: expected ';' before ')' token
   27 |         ans += 1 + ((h-1) / ad.at(pos).at(0)));
      |                                              ^
      |                                              ;
Language: C

#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,n) for(int i = s;i < (int)(n);i++)
typedef long long ll;

pair<int,int> itv[100006];

int main(){
  int n;
  int h;
  int i,t;
  ll cnt = 0;
  ll sum = 0;
  int max = -100100100;

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

  for(i = 0;i < n;i++){
    scanf("%d %d", &itv[i].second, &itv[i].first);
  }

  sort(itv,itv + n);

  for(i = 0;i < n;i++){
    if(max < itv[i].second){
      max = itv[i].second;
      t = i;
    }
  }

  i = n - 1;
  while(i >= 0 && h > 0 && itv[i].first > max){
    if(i == t){
      i--;
      continue;
    }

    h -= itv[i].first;
    cnt++;
    i--;
  }

  h -= itv[t].first;
  cnt++;

  if(h > 0){
    if(h % max == 0) cnt += h/max;

    else cnt += h/max + 1;
  }

  printf("%lld\n", cnt);

  return 0;
}


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

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

#define INF 1001001001
#define LINF 1001001001001001001
#define MOD 1000000007
#define MOD2 998244353

template<class T,class U>bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U>bool chmin(T &a, const U &b){if(b<a){a=b;return 1;}return 0;}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

typedef long long ll;

typedef pair<int,int> P;
typedef pair<int,P> iP;
typedef pair<P,P> PP;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){

    bool flag=false;
    ll ans=0,sum=0;

    int n,h;
    cin>>n>>h;
    vector<int> a(n),b(n);

    rep(i,n){
        cin>>a[i]>>b[i];
    }

    sort(all(a),greater<int>());
    sort(all(b),greater<int>());

    for(int bi:b){
        if(bi < a[0])break;
        h -= bi;
        ++ans;
    }

    ans += (h+a[i]-1)/a[i];

    cout<<ans<<endl;

    //cout <<fixed<<setprecision(16)<< << endl;

    //if(flag)cout << "Yes" <<endl;
    //else cout << "No" <<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:64:17: error: 'i' was not declared in this scope
   64 |     ans += (h+a[i]-1)/a[i];
      |                 ^
Language: C++

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

#define INF 1001001001
#define LINF 1001001001001001001
#define MOD 1000000007
#define MOD2 998244353

template<class T,class U>bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U>bool chmin(T &a, const U &b){if(b<a){a=b;return 1;}return 0;}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

typedef long long ll;

typedef pair<int,int> P;
typedef pair<int,P> iP;
typedef pair<P,P> PP;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){

    bool flag=false;
    ll ans=0,sum=0;

    int n,h;
    cin>>n>>h;
    vector<int> a(n),b(n);

    rep(i,n){
        cin>>a[i]>>b[i];
    }

    sort(all(a),greater<int>());
    sort(all(b),greater<int>());

    for(int bi:b){
        if(bi < a[i])break;
        h -= bi;
        ++ans;
    }

    ans += (h+a[i]-1)/a[i];

    cout<<ans<<endl;

    //cout <<fixed<<setprecision(16)<< << endl;

    //if(flag)cout << "Yes" <<endl;
    //else cout << "No" <<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:19: error: 'i' was not declared in this scope; did you mean 'bi'?
   59 |         if(bi < a[i])break;
      |                   ^
      |                   bi
a.cc:64:17: error: 'i' was not declared in this scope
   64 |     ans += (h+a[i]-1)/a[i];
      |                 ^
Language: C++

#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
int Max(long long(a), long long(b), long long(c)) {
	return max(max(a,b), c);
}
int Min(long long(a), long long(b), long long(c)) {
	return min(min(a, b), c);
}





int main() {

	long long N, H, m;
	cin >> N >> H;
	vector<long long> A(N);
	vector<long long> B(N);
	rep(i, N) {
		cin >> A.at(i) >> B.at(i);
		m = max(m, A.at(i));
	}
	sort(B.begin(), B.end());
	reverse(B.begin(), B.end());
	long long i = 0;
	while (H > 0  && i < N && B.at(i) > m) {
		H -= B.at(i);
		i++;
	}
	if (H > 0) {
		i += (1 + (max(long long(-1), H - 1) / m));
	}
	
	cout << i << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:32: error: expected primary-expression before 'long'
   52 |                 i += (1 + (max(long long(-1), H - 1) / m));
      |                                ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const int inf = 1e9;
const ll INF = 1e18;
const double pi = 3.14159265358979323846;
#define rep(i,n) for(ll i=0;i<n;i++)

int main(){
	int n;ll h;cin>>n>>h;
	ll a[n],b[n],mx=0;
	rep(i,n){
		cin>>a[i]>>b[i];
		mx=max(mx,a[i]);
	}
	sort(b,b+n,greater<ll>);
	ll ans=0;
	rep(i,n){
		if(mx>b[i]) continue;
		else{
			h-=b[i];
			ans++;
			if(h<=0) break;
		}
	}
	if(h>0) ans+=(ceil)((double)h/mx);

	cout<<ans<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:31: error: expected primary-expression before ')' token
   17 |         sort(b,b+n,greater<ll>);
      |                               ^
Language: C++

#include <iostream>
#include<sstream>
#include<string>
#include<vector>
#include <cmath>
#include <limits>
#include <queue>
#include<algorithm>
#include<cstring>
#include <cstdlib>
#include <cstdio>
#include <set>
#include <iomanip>
#include <map>
#include <stack>
#include <memory>
#include <numeric>
#include <type_traits>
 
using namespace std;
 
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
typedef long long ll;

 
int main() {
    int n; ll h;
    cin >> n >> h;
    vector<ll> a(n), b(n);
    rep(i,n){
        cin >> a[i] >> b[i];
    }
    sort(a.begin(), a.end(), greater<ll>()); sort(b.begin(), b.end(), greater<ll>() );
    
    ll bmax = 1e9;
    ll count = 0;
    int j = 0;
    while(a[0] <= bmax || h <= 0){
        bmax = b[j];
        if (a[0] <= bmax){
            h -= bmax; ++count;
        }
        ++j;
    }
    if (h <= 0) continue;
    else if (h%a[0] == 0) {
        count += h/a[0];
    }
    else{
        count += h/a[0]+1;
    }

    cout << count << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:17: error: continue statement not within a loop
   45 |     if (h <= 0) continue;
      |                 ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include<utility>
#include<algorithm>

#define pan(i,n) for(ll i=0;i<n;i++)
#define pans(i,n,a) for(ll i=a;i<n;i++)
#define ll long long int
#define vi vector<ll>
#define vl vector<ll>
#define pb push_back
#define INF 1e9+7
#define PI 3.141592653
#define inf 200007
#define P pair<ll,ll>
#define mp make_pair

using namespace std; 

int main(){
    ll n,h,slash=0,count=0,ans=0;
    cin>>n>>h;
    vector<P> v,q;
    pan(i,n){
        ll x,y;
        cin>>x>>y; 
        v.pb(mp(x,y));
        q.pb(mp(y,x));
    }
    sort(v.begin(),v.end());
    sort(q.begin(),q.end());
    
    slash=v[n-1].first;

    for(int i=n-1;i>=0;i--){
        if(ans<h)
            if(q[i].first>slash) ans+=q[i].first,count++;
        else 
            break;
    }
    if(ans<h){
        if((h-ans)%slash==0) count+=(h-ans)/slash;
        else if((h-ans)%slash>0) count+=((h-ans)/slash)+1;
    }
    cout<<count;
}#include <bits/stdc++.h>
#include<utility>
#include<algorithm>

#define pan(i,n) for(ll i=0;i<n;i++)
#define pans(i,n,a) for(ll i=a;i<n;i++)
#define ll long long int
#define vi vector<ll>
#define vl vector<ll>
#define pb push_back
#define INF 1e9+7
#define PI 3.141592653
#define inf 200007
#define P pair<ll,ll>
#define mp make_pair

using namespace std; 

int main(){
    ll n,h,slash=0,count=0,ans=0;
    cin>>n>>h;
    vector<P> v,q;
    pan(i,n){
        ll x,y;
        cin>>x>>y; 
        v.pb(mp(x,y));
        q.pb(mp(y,x));
    }
    sort(v.begin(),v.end());
    sort(q.begin(),q.end());
    
    slash=v[n-1].first;

    for(int i=n-1;i>=0;i--){
        if(ans<h)
            if(q[i].first>slash) ans+=q[i].first,count++;
        else 
            break;
    }
    if(ans<h){
        if((h-ans)%slash==0) count+=(h-ans)/slash;
        else if((h-ans)%slash>0) count+=((h-ans)/slash)+1;
    }
    cout<<count;
}

Compiler output:
a.cc:45:2: error: stray '#' in program
   45 | }#include <bits/stdc++.h>
      |  ^
a.cc:45:3: error: 'include' does not name a type
   45 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:63:5: error: redefinition of 'int main()'
   63 | int main(){
      |     ^~~~
a.cc:19:5: note: 'int main()' previously defined here
   19 | int main(){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp> //required
#include <ext/pb_ds/tree_policy.hpp> //required

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 vector<ll> VL;
typedef vector<int> VI;
typedef pair<ll,ll> PLL;
typedef pair<int,int> PII;
#define pb push_back

#define F first
#define S second
#define ALL(a) a.begin(),a.end()
#define fr(i,x,y) for(ll i=x;i<y;i++)
#define frr(i,x,y) for(ll i=x-1;i>=y;i--)
#define inf 10000000000000000
const ll mod=1000000007;
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll power(ll a,ll b)
{
    ll ans=1;
    while(b!=0)
    {
        if(b&1)
        {
            ans*=a;
            ans%=mod;
        }
        a=(a*a);
        a%=mod;
        b>>=1;
    }
    return ans%mod;
}
void solve()
{
    ll n,h;
    cin>>n>>h;
    vector<PLL> arr(n);
    fr(i,0,n)
    {
        cin>>arr[i].F>>arr[i].S;
    }
    sort(ALL(arr));
    PLL tmp=arr[n-1];
    ll ct=0;
    fr(i,0,n-1)
    {
        if(arr[i].S>=tmp.F&&h>0)
        {
            ct++;
            h-=arr[i].S;
        }
    }
    while(h>0)
    {
        if(tmp.S>tmp.f)
        {
            if(h>tmp.S)
            {
                //ct++;
                ll x=(h-tmp.S);
                if(x%tmp.F==0)
                {
                    x=x/tmp.F;
                }
                else
                {
                    x=x/tmp.F;
                    x++;
                }
                h-=x*tmp.F;
                ct+=x;
            }
            else
            {
                ct++;
                h-=tmp.S;
            }
        }
        else
        {
            ll x=(h);
            if(x%tmp.F==0)
            {
                x=x/tmp.F;
            }
            else
            {
                x=x/tmp.F;
                x++;
            }
            h-=x*tmp.F;
            ct+=x;
        }   
    }
    cout<<ct<<endl;
	return;
}
int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ll t=1;
    //cin>>t;
    while(t--)
    {
    	solve();
    }
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:63:22: error: 'PLL' {aka 'struct std::pair<long long int, long long int>'} has no member named 'f'
   63 |         if(tmp.S>tmp.f)
      |                      ^