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

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

#ifdef LOCAL
#define debug(var) cerr << #var << " = " << var << endl;
#else
#define debug(var)
#endif

void init() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
}

const int N = 1e5+34;

pair<int, int> a[N];

void solve() {
	int n, h; scanf("%d%d", &n, &h);
	int m = -1;
	for (int i = 0; i < n; ++i) {
		scanf("%d%d", &a[i].second, &a[i].first);
		m = max(m, a[i].second);
	}
	sort(a, a+n, greater<pair<int, int>>());
	long long tot = 0;
	int ans = 2e9;
	for (int i = 0; i <= n; ++i) {
		int x = max(0, h-tot);
		ans = min(ans, i+(x+m-1)/m);
		if (i == n) break;
		tot += a[i].first;
	}
	printf("%d", ans);
}

int main() {
	init();
	int t = 1; //scanf("%d", &t);
	while (t--) {
		solve();
	}
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:30:28: error: no matching function for call to 'max(int, long long int)'
   30 |                 int x = max(0, h-tot);
      |                         ~~~^~~~~~~~~~
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:30:28: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   30 |                 int x = max(0, h-tot);
      |                         ~~~^~~~~~~~~~
/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:30:28: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   30 |                 int x = max(0, h-tot);
      |                         ~~~^~~~~~~~~~
Language: Java


import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    long h = sc.nextLong();
    long[] a = new long[n];
    long[] b = new long[n];
    int k = 0;
    long ma = 0;
    long mb = Long.MAX_VALUE;
    for(int i = 0; i < n; i++) {
      a[i] = sc.nextLong();
      b[i] = sc.nextLong();
      if(a[i] >= ma) {
        if(b[i] <= mb) {
          k = i;
          ma = a[i];
          mb = b[i];
        }
      }
    }
    ArrayList<Long> list = new ArrayList<Long>();
    for(int i = 0; i < n; i++) {
      if(b[i] > ma) list.add(b[i]);
    }
    Collections.sort(list);
    long ans = 0;
    int p = list.size() - 1;
    while(h > 0) {
      ans++;
      if(p >= 0) {
        h -= list.get(p);
        p--;
      } else {
        h -= ma
      }
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:38: error: ';' expected
        h -= ma
               ^
1 error
Language: C++

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

int main()
{
  int n, h;
  cin >> n >> h;
  int maxa = 0;
  vector<int> bv(n);
  for(int i = 0; i < n; ++i){
    int a;
    cin >> a >> b[i];
    maxa = max(maxa, a);
  }
  sort(bv.rbegin(), bv.rend());
  int ret = 0;
  for(auto& b : bv){
    if(maxa < b){
	  ++ret;
      h -= b;
      if(h <= 0){
        cout << ret << endl;
        return 0;
      }
    }else{
      break;
    }
  }
  
  if(h % maxa == 0){
    cout << ret + h / maxa << endl;
  }else{
    cout << ret + h / maxa + 1 << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'b' was not declared in this scope
   14 |     cin >> a >> b[i];
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
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;
}
//グリッド：（典型）dp,dfs,bfs,最短経路,その他
int n,h;
vl a(110000),b(110000);
int main(){
    cin>>n>>h;
    rep(i,n)cin>>a[i]>>b[i];
    ll mx=0;
    int idx=-1;
    rep(i,n){
        if(chmax(mx,a[i])) idx=i;
    }
    vl thr;
    bool duplicate=false;
    rep(i,n){
        if(b[i]>mx){
            if(i==idx) duplicate=true;
            thr.push_back(b[i]);
    }
    ll sum=0;
    sort(thr.rbegin(),thr.rend());
    rep(i,(int)thr.size()){
        sum+=thr[i];
        if(sum>=h){
            cout<<i+1<<endl;
            return 0;
        }
    }
    ll cnt=0;
    cnt+=(int)thr.size();
    if(duplicate) {
        sum-=b[idx];
        ll need=h-sum;
        cnt+=(need-b[idx]+mx-1)/mx;
        cout<<cnt<<endl;
    }
    else{
        ll need=h-sum;
        cnt+=(need+mx-1)/mx;
        cout<<cnt<<endl;
    }
    return 0;
    //cout << sum <<" "<<mx<< endl;
}

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

#include<bits/stdc++.h>
using namespace std;
int n,h,c;
struct p{
    int l;
    int r;
}a[1000005];
bool cmp(p xx,p yy){
    return xx.l>yy.l;
}
int main(int argc, cahr **argv){
    cin>>n>>h;
    for(int i=1;i<=n;i++){
        scanf("%d",&a[c++].l);
        a[c].r=1;
        scanf("%d",&a[c++].l);
    }
    sort(a,a+c,cmp);
    int sum=0;
    for(int i=0;i<c;i++)
    {
        if(a[i].r==1)
        {
            sum++;
            h-=a[i].l;
            if(h<=0)
            {
                printf("%d",sum);
                return 0;
            }
        }
        else if(a[i].r!=1)
        {
            if(h%a[i].l==0) sum+=h/a[i].l;
            else sum+=h/a[i].l+1;
            printf("%d",sum);
            exit(0);
        }
    }
}

Compiler output:
a.cc:11:20: error: 'cahr' has not been declared
   11 | int main(int argc, cahr **argv){
      |                    ^~~~
a.cc:11:5: warning: second argument of 'int main(int, int**)' should be 'char **' [-Wmain]
   11 | int main(int argc, cahr **argv){
      |     ^~~~
Language: C++

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

typedef long long LL;

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+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];
    }
    LL A = *max_element(ALL(a));
    sort(ALL(b), greater<LL>());
    LL t = 0;
    LL res = (H + A - 1)/A;
    REP(i, N) {
        t += b[i];
        LL c = i + 1 + (H - t + A - 1)/A;
        res = max(min(res, c), 0);
    }
    cout << res << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: no matching function for call to 'max(const long long int&, int)'
   28 |         res = max(min(res, c), 0);
      |               ~~~^~~~~~~~~~~~~~~~
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:28:18: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   28 |         res = max(min(res, c), 0);
      |               ~~~^~~~~~~~~~~~~~~~
/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:28:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   28 |         res = max(min(res, c), 0);
      |               ~~~^~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll	    long long
#define vi      vector <ll>
#define vii     vector <pair<int,int>>
#define ii      pair<int,int>
#define loop(n)	for(int i=0;i<n;i++)
#define pb      push_back
const ll mod=1e9+7;
void fast();
int main()
{
    fast();
    ll n,h,sum=0,mx,res=0;
    cin>>n>>h;
    vii a(n);
    vi v(n);
    loop(n){
        cin>>a[i].first>>a[i].second;
        sum+=a[i].second;
        v[i]=a[i].second;
    }
    sort(a.begin(),a.end());
    sort(v.rbegin(),v.rend());
    if(h<=sum){
        for(int i=0;i<n&&h>0;i++)
            h-=v[i],res++;
    }
    else{
        loop(n-1)
            if(a[i].second>=a[n-1].first)
                res++,h-=a[i].second;
        ll x=h-a[i].second;
        res+=x/a[n-1].first;
        if(x%a[n-1].first!=0)
            res++;
        res++;
    }
    cout<<res;
}
void fast(){
std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);
}
/*

*/


Compiler output:
a.cc: In function 'int main()':
a.cc:33:18: error: 'i' was not declared in this scope
   33 |         ll x=h-a[i].second;
      |                  ^
Language: C++

#include<iostream>
#include <vector>
using namespace std;
int main(){
int n,h;
int ct=0,c,e;
cin>>n>>h;
vector <int> b;
int max=0;
for(int i=0;i<n;i++){
  cin>>c>>e;
  b.push_back(e);
  if(c>max)max=c;
}
sort(b.begin(),b.end(),greater<int>());
int i=0;
while(b[i]>max){
  h-=b[i];
  ct++;
  if(h<=0)break;
  i++;
}
if(h>0){
  ct+=h/max;
  if(h%max!=0)ct++;
}
cout<<ct<<endl;
  return 0;
}


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

#include<iostream>
#include <vector>
using namespace std;
int main(){
int n,h;
int ct=0,c,e;
cin>>n>>h;
vector <int> b;
int d=0;
int max=0;
for(int i=0;i<n;i++){
  cin>>c>>e;
  b.push_back(e);
  if(c>max)max=c;
}
sort(b.begin(),b.end(),greater<int>());
int i=0;
while(b[i]>max){
  h-=b[i];
  ct++;
  if(h<=0)break;
  i++;
}
if(h>0){
  ct+=h/max;
  if(h%max!=0)ct++;
}
cout<<ct<<endl;
  return 0;
}


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

#include<iostream>
#include <vector>
using namespace std;
int main(){
int N,h;
int ct=0,c,e;
cin>>N>>h;
const long int n=N;
vector <int> b;
int d=0;
int max=0;
for(int i=0;i<n;i++){
  cin>>c>>d;
  b.push_back(e);
  if(c>max)max=c;
}
sort(b.begin(),b.end(),greater<int>());
int i=0;
while(b[i]>max){
  h-=b[i];
  ct++;
  if(h<=0)break;
  i++;
}
if(h>0){
  ct+=h/max;
  if(h%max!=0)ct++;
}
cout<<ct<<endl;
  return 0;
}


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

#include<iostream>
using namespace std;

int main(){
  long N,H;
  cin >> N >> H;
  long a[N],b[N];
  for(int i=0;i<N;++i){
    cin >> a[i] >> b[i];
  }
  sort(a,a+N,greater<int>());
  sort(b,b+N,greater<int>());
  long sum=0,cnt=0;
  int i=0;
  while(sum<H){
    if(a[0]<b[i]){
      sum+=b[i];
      ++i;
      ++cnt;
    }
    else if(i==N-1){
      cnt+=(H-sum)/a[0]+1;
      break;
    }
    else{
      sum+=a[0];
      ++i;
    }
  }
  cout << cnt << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(a,a+N,greater<int>());
      |   ^~~~
      |   short
Language: Java

import java.util.Scanner;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int H = sc.nextInt();
   int[] a= new int[N];
   int[] b= new int[N];
   for(int i=0;i<N;i++)
   {
     a[i]= sc.nextInt();
     b[i]= sc.nextInt();
   }

   Arrays.sort(a);
   Arrays.sort(b);
   
   int amax=a[N-1];
   
   int bcount =N-1;
   int sum = 0;
   
   while(b[bcount]>amax&&sum<H&&bcount>=0)
   {
     sum+=b[bcount];
     bcount--;
   }
   int ans = N - bcount - 1 ;
   if(sum<H)
   { 
     if((H-sum)%amax==0) ans+=(H-sum)/amax;
     else ans+=(H-sum)/amax +1;
   }
   
   System.out.println(ans);
 }
}

Compiler output:
Main.java:15: error: cannot find symbol
   Arrays.sort(a);
   ^
  symbol:   variable Arrays
  location: class Main
Main.java:16: error: cannot find symbol
   Arrays.sort(b);
   ^
  symbol:   variable Arrays
  location: class Main
2 errors
Language: Java

import java.util.*;
// i hate myself
public class r{
	public static long cdiv(long a, long b)
	{
		if(a < 0) return 0;
		return (a/b)+(a%b==0 ? 0 : 1);
	}
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        long[] a = new long[n];
        long[] b = new long[n];
        long max_a = -1L;
        for( int i = 0; i < n; i++ ) {
            a[i] = in.nextLong();
            b[i] = in.nextLong();
            max_a = Math.max(max_a, a[i]);
        }
        long ct = 0L;
        Arrays.sort(b);
        for( int i = n-1; i >= 0; i-- ) {
            if(b[i] > max_a) {k -= b[i]; ct += 1L;}
            else break;
        }
        ct += cdiv(k,max_a);
        System.out.println(ct);
    }
}

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

import java.util.*;
// i hate myself
public class ABC085D {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        long[] a = new long[n];
        long[] b = new long[n];
        long max_a = -1L;
        for( int i = 0; i < n; i++ ) {
            a[i] = in.nextLong();
            b[i] = in.nextLong();
            max_a = Math.max(max_a, a[i]);
        }
        long ct = 0L;
        for( int i = 0; i < n; i++ ) {
            if(b[i] > max_a) {k -= b[i]; ct++;}
        }
        if( k>0 ) ct += Math.ceil((double)k/max_a);
        System.out.println(ct);
    }
}

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

import java.math.*;
import java.util.*;
 
public class ABC085D {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        long[] a = new long[n];
        long[] b = new long[n];
        long max_a = -1L;
        for( int i = 0; i < n; i++ ) {
            a[i] = in.nextLong();
            b[i] = in.nextLong();
            max_a = Math.max(max_a, a[i]);
        }
        BigInteger ct = new BigInteger(0+"");
        for( int i = 0; i < n; i++ ) {
            if(b[i] > max_a) {k -= b[i]; ct = ct.add(new BigInteger(1+""));}
        }
        BigDecimal dc = (new BigDecimal(k+"")).divide(new BigDecimal(max_a+""), RoundingMode.DOWN);
        ct = ct.add(dc.toBigInteger());
        System.out.println(ct.toString());
    }
}

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

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

int main() {
  int n, h;
  cin >> n >> h;
  vector<int> a(n), b(n);
  vector<pair<int, int>> s;
  int i;
  for (i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    s.push_back(make_pair(a[i], 1));
    s.push_back(make_pair(b[i], 0));
  }
  sort(s.begin(), s.end());
  int result = 0;
  for (i = s.size() - 1; i >= 0 && h > 0; i--) {
    if (s[i].second) {
      result += (h + s[i].first - 1) / s[i].first;
      h = 0;
    } else {
      result++;
      h -= s[i].first;
    }
  }
  cout << result << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> a(n), b(n);
      |   ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <algorithm>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> a(n), b(n);
      |          ^~~
a.cc:10:23: error: expected primary-expression before '>' token
   10 |   vector<pair<int, int>> s;
      |                       ^~
a.cc:10:26: error: 's' was not declared in this scope
   10 |   vector<pair<int, int>> s;
      |                          ^
a.cc:13:12: error: 'a' was not declared in this scope
   13 |     cin >> a[i] >> b[i];
      |            ^
a.cc:13:20: error: 'b' was not declared in this scope
   13 |     cin >> a[i] >> b[i];
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct p{
    int l;
    int r;
}a[1000000];
bool cmp(p xx,p yy){
    return xx.l>yy.l;
}
int main()
{
    int n,h;
    int c=0;
    cin>>n>>h;
    for(int i=1;i<=n;i++)
    {
        cin>>a[c++].h;
        a[c].r=1;
        cin>>a[c++].h;
    }
    sort(a,a+c,cmp);
    int sum=0;
    for(int i=0;i<c;i++)
    {
        if(a[i].r==1)
        {
            sum++;
            h-=a[i].l;
            if(h<=0)
            {
                cout<<sum<<endl;
                return 0;
            }
        }
        else if(a[i].r!=1)
        {
            if(h%a[i].l==0) 
                sum+=h/a[i].l;
            else 
                sum+=h/a[i].l+1;
            cout<<sum<<endl;
            return 0;

        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:21: error: 'struct p' has no member named 'h'
   17 |         cin>>a[c++].h;
      |                     ^
a.cc:19:21: error: 'struct p' has no member named 'h'
   19 |         cin>>a[c++].h;
      |                     ^
Language: C++

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

int main(){
  long int n, h;
  cint >> n >> h;
  pair<long int, long int> ab, ba;
  for(int i = 0; i < n; i++){
    long int a, b;
    cin >> a >> b;
    ab.at(i) = make_pair(a, b);
    ba.at(i) = make_pair(b, a);
  }
  sort(ab.rbegin(), ab.rend());
  long int a_base = ab.at(0).first();  
  sort(ba.rbegin(), ba.rend());
  int count = 0;
  for(long int i = ba.at(0).first(); i > a_base; i--){
    h -= ba.at(i).first();
    count++;
    if(h <= 0) break;
  }
  if(h > 0){
    count += h / a_base;
    if(h % a_base != 0){
      count++;
    }
  }
  cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cint' was not declared in this scope; did you mean 'uint'?
    6 |   cint >> n >> h;
      |   ^~~~
      |   uint
a.cc:11:8: error: 'struct std::pair<long int, long int>' has no member named 'at'
   11 |     ab.at(i) = make_pair(a, b);
      |        ^~
a.cc:12:8: error: 'struct std::pair<long int, long int>' has no member named 'at'
   12 |     ba.at(i) = make_pair(b, a);
      |        ^~
a.cc:14:11: error: 'struct std::pair<long int, long int>' has no member named 'rbegin'
   14 |   sort(ab.rbegin(), ab.rend());
      |           ^~~~~~
a.cc:14:24: error: 'struct std::pair<long int, long int>' has no member named 'rend'
   14 |   sort(ab.rbegin(), ab.rend());
      |                        ^~~~
a.cc:15:24: error: 'struct std::pair<long int, long int>' has no member named 'at'
   15 |   long int a_base = ab.at(0).first();
      |                        ^~
a.cc:16:11: error: 'struct std::pair<long int, long int>' has no member named 'rbegin'
   16 |   sort(ba.rbegin(), ba.rend());
      |           ^~~~~~
a.cc:16:24: error: 'struct std::pair<long int, long int>' has no member named 'rend'
   16 |   sort(ba.rbegin(), ba.rend());
      |                        ^~~~
a.cc:18:23: error: 'struct std::pair<long int, long int>' has no member named 'at'
   18 |   for(long int i = ba.at(0).first(); i > a_base; i--){
      |                       ^~
a.cc:19:13: error: 'struct std::pair<long int, long int>' has no member named 'at'
   19 |     h -= ba.at(i).first();
      |             ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a[10010],b[10010];
	int n,hp;
	int mx=0;
	int ans=0;
	queue<int>q;
	cin>>n>>hp;
	for(int i=0;i<n;i++)
	{
		cin>>a[i]>>b[i];
		if(a[i]>mx)mx=a[i];
	}
	sort(b,b+n);
	reverse(b,b+n);  
	for(int i=0;i<n;i++)
	{
		if(b[i]>=mx)q.push(b[i]);
	}
	while(hp>0){
		while(!qempty()){
			ans++;
			hp-=q.front();
			q.pop();
			if(hp<=0){
				cout<<ans<<endl;
				return 0;
			}
			}
		ans+=(hp+mx-1)/mx;
		hp=0;
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:24: error: 'qempty' was not declared in this scope
   23 |                 while(!qempty()){
      |                        ^~~~~~
Language: C++

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

int main(){
    long long i;
    long long N,H;
    long long result=0;
    cin>>N>>H;
    vector<long long>A(N);
    vector<long long>B(N);
    for(i=0;i<N;i++)cin>>A[i]>>B[i];

    sort(A.begin(),A.end(),greater<long long>());
    sort(B.begin(),B.end(),greater<long long>());

    for(i=0;i<N;i++){
        if(B[i]>=A[0]){
            H-=B[i];
            result+=1;
        }else{
            break;
        }

        if(H<=0)break;
    }

    if(H%A[0]==0 || H<=0){
        result+=H/A[0];
    }else{
        result+=H/A[0]+1;
    }

    cout<<result<<endl;
}

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

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

struct Sword {
	int a, b;
};

bool sortb(const Sword &s1, const Sword &s2) {
	return s1.b > s2.b;
}

int main() {
	int n, h;
	cim >> n >> h;
	vector<Sword> swords(n);
	int amax = 0;
	long bsum = 0;
	for (int i = 0; i < n; i++) {
		cin >> swords[i].a >> swords[i].b;
		amax = max(amax, swords[i].a);
		bsum += swords[i].b;
	}
	sort(swords.begin(), swords.end(), sortb);
	long ans = 0;
	for (const Sword &s : swords) {
		h -= s.b;
		ans++;
		if (h <= 0) {
			cout << ans << endl;
			return 0;
		}
	}
	cout << ans + (h + amax - 1) / amax << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'cim' was not declared in this scope
   16 |         cim >> n >> h;
      |         ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <iomanip>
#include <cstdlib>
#include <cctype>
#define ll long long
#define PI 3.14159265358979323846
using namespace std;
const int maxn = 1e6+7;

struct Infor{
	ll dam;
	bool iswield;
}infor[200010];

bool cmp(Infor a,Infor b) {
	if(a.dam>b.dam) {
		return true;
	} else {
		return false;
	}
}

int main(){
	ll n,h;
	cin>>n>>h;
//	Infor *infor=new Infor[2*n+1];
	ll a,b;
	for(ll i=0;i<2*n;i+=2){
		cin>>a>>b;
		infor[i].dam=a;
		infor[i+1].dam=b;
		infor[i].iswield=true;
		infor[i+1].iswield=false;
	}
	sort(infor,infor+2*n,cmp);
	
//	for(ll i=0;i<2*n;i++){
//		cout<<infor[i].dam<<endl;
//	}
	
	ll sum=0;
	ll cnt=0;
	for(ll i=0;i<2*n;i++){
		if(infor[i].iswield==true){
			cnt+=ceil((double)(h-sum)/infor[i].dam);
			sum=INT_MAX;
		}
		else{
			sum+=infor[i].dam;
			cnt++;
		}
		if(sum>=h){
			cout<<cnt<<endl;
			break;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:29: error: 'INT_MAX' was not declared in this scope
   51 |                         sum=INT_MAX;
      |                             ^~~~~~~
a.cc:10:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #include <cctype>
  +++ |+#include <climits>
   10 | #define ll long long
Language: C++

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


int main() {
  int N
  ll H;
  cin >> N >> H;
  vector<ll> A(N), B(N);
  for (int i = 0; i < N; ++i) {
    cin >> A.at(i) >> B.at(i);
  }
  sort(A.rbegin(), A.rend());
  sort(B.rbegin(), B.rend());
  ll max_A = A.at(0), result = 0;
  for (int i = 0; i < N; ++i) {
    if (max_A < B.at(i)) {
      ++result;
      H -= B.at(i);
    } else {
      break;
    }
  }
  result += (H + (max_A - 1)) / max_A;
  cout << result << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'll'
    8 |   ll H;
      |   ^~
a.cc:9:10: error: 'N' was not declared in this scope
    9 |   cin >> N >> H;
      |          ^
a.cc:9:15: error: 'H' was not declared in this scope
    9 |   cin >> N >> H;
      |               ^
Language: C++

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

/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y) {
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
int main() {
	int N, H;
	cin >> N >> H;
	vector<pair<int, int>>c;
	long int hp = 0;
	long int ma = 0;
	long int mb = 0;
	long int k = 0;
	for (int i = 0; i < N; i++) {
		int a;
		int b;
		cin >> a >> b;
		c.push_back(make_pair(b, a));
		hp = hp + b;
		if (a > ma) {
			ma = a;
			mb = b;
			k = 0;
		}
		if (a == ma) {
			if (mb > b) {
				mb = b;
				k = 0;
			}
			else if(b == mb){
				k++;
			}
		}
	}
	long int op = 0;
	long int count = 0;
	for (int i = 0; i < N; i++) {
		int a;
		int b;
		pair<int, int>key;
		key = c[i];
		b = key.first;
		a = key.second;
		if (b >= ma) {
			op = op + b;
			count++;
		}
	}

	sort(c.begin(), c.end(),greater<pair<int,int>>());
	if (hp >= H) {
		for (int i = 0; i < N; i++) {
			H = H - c[i].first;
			if (H <= 0) {
				cout << i + 1;
			}
		}
	}
	else {
		H = H + mb;
		H = H - op;
		cout <<long int(H-mb + ma - 1) / ma + count;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:24: error: expected primary-expression before 'long'
   88 |                 cout <<long int(H-mb + ma - 1) / ma + count;
      |                        ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)

int main() {
  int n;
  ll h;cin >> n >> h;
  vector<pair<ll,ll>> vp;
  repi(i,0,n){
    ll a,b;cin >> a>>b;
    vp.push_back(make_pair(a,b));
  }
  sort(all(vp));
  ll max_a = vp[n-1].first;
  ll thresh = max(vp[n-1].first,vp[n-1].second);
  ll cnt = 0LL;
  for(int j=0;j<n-1;++j){
    if(h <= thresh) break;
    if(vp[j].second >= max_a){
      h -= vp[j].second;
      ++cnt;
    }
  }
  if(h>0){
    if (thresh > max_a){
        ++cnt;
        h -= thresh;
        if(h>0){
          cnt += h/max_a;
          if(h%max_a != 0) ++cnt;
        }
      }
    } else {
      cnt += h/max_a;
      if(h%max_a != 0) ++cnt;
    }
  }
  cout << cnt << endl;
  return 0;
}


Compiler output:
a.cc:41:3: error: 'cout' does not name a type
   41 |   cout << cnt << endl;
      |   ^~~~
a.cc:42:3: error: expected unqualified-id before 'return'
   42 |   return 0;
      |   ^~~~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

#include "bits/stdc++.h"

#define REP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const long long mod = 1e9 + 7;

int stoi(const char c) {
  switch (c) {
    case '0':
      return 0;
    case '1':
      return 1;
    case '2':
      return 2;
    case '3':
      return 3;
    case '4':
      return 4;
    case '5':
      return 5;
    case '6':
      return 6;
    case '7':
      return 7;
    case '8':
      return 8;
    case '9':
      return 9;
    default:
      return -1;
  }
}

int main() {
  ll n, h, ans = 0;
  cin >> n >> h;
  vector<ll> a(n), b(n);
  rep(i, n) cin >> a[i] >> b[i];
  sort(all(a), greater);
  sort(all(b), greater);

  rep(i, n) {
    if (b[i] > a[n - 1]) {
      h -= b[i];
      ans++;
      if (h <= 0) {
        cout << ans;
        return 0;
      }
    } else {
      break;
    }
  }
  ans += h / a[n - 1];
  if (h % a[n - 1] != 0) ans++;

  cout << ans;
  return 0;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:23: error: missing template arguments before ')' token
   42 |   sort(all(a), greater);
      |                       ^
a.cc:43:23: error: missing template arguments before ')' token
   43 |   sort(all(b), greater);
      |                       ^
Language: C++

N, H = map(int, input().split())
A, B = [], []
for _ in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

A.sort(reverse=True)
B.sort(reverse=True)

maxa = max(A)

res = 0

for b in B:
    if b < maxa or H <= 0:
        break
    H -= b
    res += 1

res += int((H + maxa - 1) / maxa) if H > 0 else 0

print(res)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, H = map(int, input().split())
      | ^
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main() {
  int n,t;
  int ans = 0;
  vector<int> a[n],b[n];
  for(int i=0;i<n;i++){
    cin >> a[i] >> b[i];
  }
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  int k = n-1;
  while(b[k] >= a[n-1] && k >=0 && t >0){
    t -= b[k];
    ans++;
    k--;
  }
  if(t<=0){
    cout << ans << endl;
  }
  else{ 
  cout << ans + ((t + a[n-1] +1)/a[n-1]) << endl;
  }
      
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> a[n],b[n];
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | #include <string>
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> a[n],b[n];
      |          ^~~
a.cc:11:12: error: 'a' was not declared in this scope
   11 |     cin >> a[i] >> b[i];
      |            ^
a.cc:11:20: error: 'b' was not declared in this scope
   11 |     cin >> a[i] >> b[i];
      |                    ^
a.cc:13:8: error: 'a' was not declared in this scope
   13 |   sort(a.begin(),a.end());
      |        ^
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(a.begin(),a.end());
      |   ^~~~
      |   short
a.cc:14:8: error: 'b' was not declared in this scope
   14 |   sort(b.begin(),b.end());
      |        ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include <numeric>
#include <iomanip>
#include <deque>
#include <tuple>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cstdint>
#include <unordered_map>
#include <sstream>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define pb push_back
#define pf push_front

namespace mp = boost::multiprecision;
using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

ll M = 1000000007;

typedef pair<int, int> P;

bool ps1(const P &element1, const P &element2)
{ //first昇順
	return element1.first < element2.first;
}
bool ps2(const P &element1, const P &element2)
{ //first降順
	return element1.first > element2.first;
}
bool ps3(const P &element1, const P &element2)
{ //second昇順
	return element1.second < element2.second;
}
bool ps4(const P &element1, const P &element2)
{ //second降順
	return element1.second > element2.second;
}
int digits(int n)
{
	int count = 0;
	while (n > 0)
	{
		n /= 10;
		count++;
	}
	return count;
}
ll combination(ll n, ll r)
{
	if (r * 2 > n)
		r = n - r;
	ll dividend = 1;
	ll divisor = 1;
	for (ll i = 1; i <= r; ++i)
	{
		dividend *= (n - i + 1);
		divisor *= i;
	}
	return dividend / divisor;
}
int GCD(int x, int y)
{
	return x ? GCD(y % x, x) : y;
}
vector<int> divisor(int n)
{
	vector<int> value;
	FOR(i, 1, pow(n, 0.5) + 1)
	{
		if (i <= sqrt(n))
		{
			if (n % i == 0)
			{
				value.push_back(i);
				if (i * i != n)
				{
					value.push_back(n / i);
				}
			}
		}
	}
	return value;
}
int main()
{
	int n, h;
	cin >> n >> h;
	vector<pair<int, int>> ab(n);
	ll sum = 0;
	rep(i, n)
	{
		cin >> ab[i].F >> ab[i].S;
	}
	sort(all(ab), ps4);
	/*rep(i,n){
		cout<<ab[i].F<<" S "<<ab[i].S<<endl;
	}*/
	stable_sort(all(ab), ps2);
	/*rep(i,n){
		cout<<ab[i].F<<" S "<<ab[i].S<<endl;
	}*/
	rep(i, n)
	{
		if (ab[i].S < ab[0].F)
		{
			ab[i].S = ab[0].F;
		}
	}

	rep(i, n)
	{
		sum += ab[i].S;
	}
	sum = max(sum, ab[0].F * n);
		//cout << sum << endl;

	if (sum < h)
	{
		int cnt = 1;
		int damage = ab[0].S;
		int tmp = h - sum;
		int c = tmp / ab[0].F;

		if (tmp > c * ab[0].F)
		{
			c++;
		}
		//cout << c << endl;
		cnt += c + n - 1;
		cout << cnt << endl;
	}
	else
	{
		
		int cnt = 0;
		int damage = 0;
		//cout<<damage<<endl;
		/*rep(i,n){
		cout<<ab[i].F<<" S "<<ab[i].S<<endl;
	    }*/
		sort(all(ab),ps4);
		rep(i, n)
		{
			if (damage >= h)
			{
				//cout<<i<<endl;
				break;
			}
			damage += ab[i].S;
			cnt++;
			//cout<<damage<<" "<<cnt<<endl;
		}
		cout << cnt << endl;
	}
}

Compiler output:
a.cc:19:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   19 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>


const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
using lint = long long;

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (int i = 0; i < vec.size(); i++) {
		os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	}
	return os;
}

#ifdef _DEBUG
template <class Head>
void dump(const char* str, Head &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + 1, t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(x) ((void)0)
#endif

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N, H;
	cin >> N >> H;

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

	sort(a.begin(), a.end());
	DMP(a);
	sort(b.begin(), b.end());
	DMP(b);
	int sum = 0;
	auto x = upper_bound(b.begin(), b.end(), a.back());
	DMP(x - b.begin());
	DMP(x - b.end());
	for (auto itr = x; itr != b.end(); itr++) {
		sum += *itr;
		DMP(*itr,sum);
		if (sum >= H) {
			cout << itr - x + 1 << "\n";
			return 0;
		}
	}

	H -= sum;
	cout << (b.end() - x) + (H - 1) / a.back() + 1 << "\n"; 

	return 0;
}

Compiler output:
a.cc:59:29: error: macro "DMP" passed 2 arguments, but takes just 1
   59 |                 DMP(*itr,sum);
      |                             ^
a.cc:35:9: note: macro "DMP" defined here
   35 | #define DMP(x) ((void)0)
      |         ^~~
a.cc: In function 'int main()':
a.cc:59:17: error: 'DMP' was not declared in this scope
   59 |                 DMP(*itr,sum);
      |                 ^~~
Language: C++

#include"bits/stdc++.h"
#define int long long
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define itr(i,x) for(auto i=(x).begin();i!=(x).end();++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
const int mod=1000000007;
int gcd(int x,int y){return y?gcd(y,x%y):x;}
int lcm(int x,int y){return x*y/gcd(x,y);}
int roundup(int a,int b){return	(a-1)/b+1;}
void YN(bool flg){cout<<(flg?"YES":"NO")<<endl;}
void Yn(bool flg){cout<<(flg?"Yes":"No")<<endl;}
void yn(bool flg){cout<<(flg?"yes":"no")<<endl;}
signed main(){
	int n,h;cin>>n>>h;
	vector<int> a(n),b(n);
	rep(i,n){
		cin>>a[i]>>b[i];
	}
	vector<int> orda(n),ordb(n);
	iota(All(orda),0);iota(All(ordb),0);
	sort(All(orda),[&](int x,int y){return a[x]>a[y];});
	sort(All(ordb),[&](int x,int y){return b[x]>b[y];});
	int ans=0,H=h;
	rep(i,){
		int at=b[ordb[i]];
		if(at>=a[orda[0]]&&ordb[i]!=orda[0]){ 
			h-=at;
			ans++;
		}
		if(h<=b[orda[0]]) h-=b[orda[0]],ans++;
		if(h<=0) break;
	}
	if(h>0){
		if(h<=b[orda[0]]) ans++;
		else{
			ans+=roundup(h-b[orda[0]],a[orda[0]])+1;
		}
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:39: error: expected primary-expression before ')' token
    5 | #define repi(i,a,b) for(int i=(a);i<(b);++i)
      |                                       ^
a.cc:4:19: note: in expansion of macro 'repi'
    4 | #define _rep(i,n) repi(i,0,n)
      |                   ^~~~
a.cc:3:39: note: in expansion of macro '_rep'
    3 | #define _overload3(_1,_2,_3,name,...) name
      |                                       ^~~~
a.cc:6:18: note: in expansion of macro '_overload3'
    6 | #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
      |                  ^~~~~~~~~~
a.cc:32:9: note: in expansion of macro 'rep'
   32 |         rep(i,){
      |         ^~~
Language: C++

#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--)
#define FOR(a,b) for(int i=a; i<b+1; i++)
using namespace std;
typedef long long ll;

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}
int main() {
    ll n,h;
    cin >> n >> h;
    ll max=-114514;
    queue<int> q;
    rep(i,n){
        ll nage,huri;
        cin >> huri >> nage;
        if(max<huri){
            max=huri;
        }
        v1[i]=nage;
    }
    rep(i,n){
        if(v[i]>max){
            q.push(v[i]);
        }
    }
    ll ans=0;
    while(h<=0){
        if(!q.empty()){
            h-=q.front();
            ans++;
            q.pop();
        }
        else{
            h-=max;
            ans++;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'v1' was not declared in this scope; did you mean '__pstl::execution::v1'?
   27 |         v1[i]=nage;
      |         ^~
      |         __pstl::execution::v1
In file included from /usr/include/c++/14/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/execution_defs.h:19:18: note: '__pstl::execution::v1' declared here
   19 | inline namespace v1
      |                  ^~
a.cc:30:12: error: 'v' was not declared in this scope
   30 |         if(v[i]>max){
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
//*******************
// Mahmoud Magdy    *
//*******************
#define ll long long
#define endl "\n"

void fast()
{
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}
inline int D()
{
    int m ;
    cin>>m;
    return m ;
}
inline ll lD()
{
    ll m ;
    cin>>m;
    return m ;
}
inline double dD()
{
    double m ;
    cin>>m;
    return m ;
}
int a[100005],b[100005];
int main()
{
 int n=D(),k=D();
   for(int i=0;i<n;++i){
    a[i]=D();
    b[i]=D();
   }
   sort(a,a+n);
   int mx=a[n-1];
   ll sum=0;
   int c=0;
   for(int i=0;i<n;++i){
    if(mx<=b[i]){
        sum+=b[i];
        c++;
        }
   }
   bool f=false ;
   if(sum>=k)
    cout<<c<<endl;
    else if(mx==1){
        cout<<c+(k-sum)<<endl;
    }
    else {
        for(int i=1;i<100001;++i)
        {
            if((sum+(mx*i)>=k){
                cout<<c+i<<endl;
                return 0;
            }
        }
    }
  cout<<((k-sum)/mx)-c<<endl;;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:60:31: error: expected ')' before '{' token
   60 |             if((sum+(mx*i)>=k){
      |               ~               ^
      |                               )
a.cc:64:9: error: expected primary-expression before '}' token
   64 |         }
      |         ^
Language: C

#include <iostream>
#include <cstdio>
#include <queue>
#include <algorithm>
using namespace std;
typedef long long ll;

ll a, b;
ll n, h;
ll a_max = 0;
ll ans = 0;
priority_queue<ll> p_que;

int main()
{
    cin >> n >> h;
    for (int i = 0; i < n; i++) {
        cin >> a >> b;

        a_max = max(a, a_max);
        p_que.push(b);
    }

    while (!p_que.empty() && p_que.top() > a_max && h > 0) {
        h = h - p_que.top();
        p_que.pop();
        ans++;
    }

    ans += (h + a_max - 1) / a_max;

    cout << ans << endl;

    return 0;
}


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

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
bool prime(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};

typedef pair<int,int> P;

int main(){
  int n,h;
  cin>>n>>h;
  int a[n],b[n];
  int ma=0;
  REP(i,n){
    cin>>a[i]>>b[i];
    if(ma<a[i]){
      ma = a[i];
      mai = i;
    }
  }
  
  vector<P> nb;
  REP(i,n){
    if(b[i]>ma){
      nb.push_back(P(b[i],i));
    }
  }
  sort(nb.begin(),nb.end(),greater<P>());
  int cntb=nb.size();
  
  int sumb[cntb];
  REP(i,cntb){
    if(i==0){
      sumb[i]=nb[i].first;
    }else{
      sumb[i]=sumb[i-1]+nb[i].first;
    }
  }
  int l=1;int r=1000000010;
  int m,temp,cnt;
  bool flag;//whileの処理を最後までやるか否か
  while(r-l>1){
    m=(l+r)/2;
    if(m<=cntb){
      if(sumb[m-1]>=h){
        r = m+1;
      }else{
        l = m+1;
      }
    }else{
      if((h-sumb[cntb])+ma-1)/ma<=(m-cntb)){
        r = m+1;
      }else{
        l = m+1;
      }
    }
  }
  
  cout<<l<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:100:7: error: 'mai' was not declared in this scope; did you mean 'ma'?
  100 |       mai = i;
      |       ^~~
      |       ma
a.cc:133:30: error: expected primary-expression before '/' token
  133 |       if((h-sumb[cntb])+ma-1)/ma<=(m-cntb)){
      |                              ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;
typedef pair<long long, long long> P;

bool greaterOrdered(P pre, P post) {
  if(pre.second > post.second) return true;
  else return false;
}

int main() {
  long long N, H; cin >> N >> H;
  long long hp = H;
  long long maxAttackPoint = 0;
  long long cnt = 0LL;
  vector<P> vec;
  for(long long i = 0LL; i < N; ++i) {
    long long A, B; cin >> A >> B;
    vec.push_back(P(A, B));
    maxAttackPoint = max(maxAttackPoint, A);
  }
  sort(vec.begin(), vec.end(), greaterOrdered);
  for(int i = 0; i < vec.size(); ++i) {
    if(hp <= 0) {
      cout << cnt << endl;
      return 0;
    }
    if(maxAttackPoint < vec[i].second) {
      hp -= vec[i].second;
      cnt++;
    } else {
      cnt += (hp % maxAttackPoint == 0) ? hp/maxAttackPoint : hp/maxAttackPoint + 1;
      cout << cnt << endl;
      return 0;
    }
  }
  if(hp <= 0) {
    cout << cnt << endl;
    return 0;
  }
  cnt += (hp % maxAttackPoint == 0) ? hp/maxAttackPoint : hp/maxAttackPoint + 1;
  cout << cnt << endl;

  return 0;
}


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

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

int main(){
  int N,H;
  cin >> N >> H;
  vector<int> a;
  vector<int> b;
  for(int i=0;i<N;i++){
    int c,d;
    cin >> c >> d;
    a.push_back(c);
    b.push_back(d);
  }
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  int sum=0;
  while(H>0){
    if(b.end()>=a.end()){
      H-=b.end();
      b.pop_back();
    }
    else{
      H-=a.end();
      a.pop_back();
    }
    sum++;
  }
  cout << sum;
    
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: no match for 'operator-=' (operand types are 'int' and 'std::vector<int>::iterator')
   20 |       H-=b.end();
      |       ~^~~~~~~~~
a.cc:24:8: error: no match for 'operator-=' (operand types are 'int' and 'std::vector<int>::iterator')
   24 |       H-=a.end();
      |       ~^~~~~~~~~