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

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {

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

    vector<int> throw_dmg;
    int max_at = 0, at_throw = 0;
    int at, th;
    for (int i = 0; i < N; i++) {
        cin >> at >> th;
        if (at > max_at) {
            max_at = at;
            throw_dmg.push_back(at_throw);
            at_throw = th;
        }
        else if (at == max_at) {
            if (at_throw > th) {
                throw_dmg.push_back(at_throw);
                at_throw = th;
            }
            else {
                throw_dmg.push_back(th);
            }
        }
        else {
            throw_dmg.push_back(th);
        }
    }

    sort(throw_dmg.begin(), throw_dmg.end(), greater<int>());
    /*
    cout << max_at << ' ' << at_throw << '\n';
    for (int i = 0; i < N; i++) {
        cout << throw_dmg[i] << '\n';
    }
    */

    ll ans = 0;
    for (int i = 0; i < throw_dmg.size(); i++) {
        if (throw_dmg[i] > at_throw) {
            H -= throw_dmg[i];
            ans++;
        }
        else break;
        if (H <= 0) {
            break;
        }
    }

    if (H <= 0) {
        cout << ans << '\n';
        return 0;
    }
    
    H -= at_throw;
    ans++;
    if (H <= 0) {
        cout << ans << '\n';
        return 0;
    }
    
    ans += (H / max_at);
    if (H % max_at != 0) ans++;
    cout << ans << '\n';


}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:5: error: 'll' was not declared in this scope
   44 |     ll ans = 0;
      |     ^~
a.cc:48:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |             ans++;
      |             ^~~
      |             abs
a.cc:57:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   57 |         cout << ans << '\n';
      |                 ^~~
      |                 abs
a.cc:62:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   62 |     ans++;
      |     ^~~
      |     abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
    int n,h,a[200000],b[200000],ans=0;
    cin>>n>>h;
    rep(i,n) cin>>a[i]>>b[i];
    sort(a,a+n,greater<int>());
    sort(b,b+n,greater<int>());
    for(int i=0;a[0]<=b[i]&&h>0;i++) h-=b[i],ans++;
    if(h<=0) cout<<ans;
    else cout<<ans+ceil(h/a[i]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: 'i' was not declared in this scope
   12 |     else cout<<ans+ceil(h/a[i]);
      |                             ^
Language: C++

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

int main(){
  int N; cin >> N;
  long long H; cin >> H;
  long long A[100010],B[100010];
  
  for(int i=0;i<N;i++)
    cin >> A[i] >> B[i];
  sort(A,A+N,greater<long long>());
  sort(B,B+N,greater<long long>());
  long long sum = 0;
  long long cnt = 0;
  for(int i=0;i<N;i++){
    if(A[0]>B[i]) continue;
    sum += B[i]; count++;  
    if(sum >= H){cout << i+1 << endl; break;}
  }
  if(sum >= H);
  else if((H-sum)%A[0] == 0)cout << (H-sum)/A[0]+cnt << endl;
  else{cout << (H-sum)/A[0]+1+cnt << endl;
      }
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: no post-increment operator for type
   17 |     sum += B[i]; count++;
      |                       ^~
Language: Java

import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class tr1 {
	static PrintWriter out;
	static StringBuilder sb;
	static int inf = (int) 1e9;
	static long mod = 998244353;
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n=sc.nextInt();
		long h=sc.nextLong();
		long [] a=new long[n];
		long [] b=new long[n];
		long maxa=0;
		for(int i=0;i<n;i++) {
			maxa=Math.max(a[i]=sc.nextInt(),maxa);
			b[i]=sc.nextInt();
		}
		Arrays.sort(a);
		Arrays.sort(b);
		long ans=0;
		long sum=0;
	    for(int i=n-1;i>=0;i--) {
	    	if(sum>=h) {
	    		System.out.println(ans);
	    		return;
	    	}
	    	sum+=Math.max(b[i], maxa);
	    	ans++;
	    }
	    if(sum>=h) {
    		System.out.println(ans);
    		return;
    	}
	    ans+=(h-sum)/maxa;
	    if((h-sum)%maxa!=0)
	    	ans++;
		out.println(ans);
		out.close();
	}
	static int gcd(int a, int b) {

		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	static class unionfind {
		int[] p;
		int[] size;

		unionfind(int n) {
			p = new int[n];
			size = new int[n];

			for (int i = 0; i < n; i++) {
				p[i] = i;
			}
			Arrays.fill(size, 1);
		}

		int findSet(int v) {
			if (v == p[v])
				return v;
			return p[v] = findSet(p[v]);
		}

		boolean sameSet(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return true;
			return false;
		}

		int max() {
			int max = 0;
			for (int i = 0; i < size.length; i++)
				if (size[i] > max)
					max = size[i];
			return max;
		}

		void combine(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return;
			if (size[a] > size[b]) {
				p[b] = a;
				size[a] += size[b];

			} else {
				p[a] = b;
				size[b] += size[a];
			}
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}

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

#include <bits/stdc++.h>
using namespace std;
const long long mod = pow(10, 9) + 7;
const long long mod2 = 998244353;
const long long INF = 1LL << 60;
const int inf = pow(10, 9) + 7;
const string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const string abc = "abcdefghijklmnopqrstuvwxyz";
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, int B) {return (A + (B - 1)) / B;}
long long divCeil(int A, long long B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;}

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

  vector<long long> b(N);
  long long amax = -INF;
  for (int i = 0; i < N; i++)
  {
    long long a;
    cin >> a >> b.at(i);
    chmax(amax, a);
  }

  b.push_back(amax);
  sort(b.begin(), b.end(), greater<long long>);

  long long ans = 0;
  long long dam = 0;
  for (int i = 0; i < N + 1; i++)
  {
    if (dam >= H) break;
    if (b.at(i) == amax)
    {
      ans += divCeil((H - dam), amax);
      break;
    }
    dam += b.at(i);
    ans++;
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:46: error: expected primary-expression before ')' token
   32 |   sort(b.begin(), b.end(), greater<long long>);
      |                                              ^
Language: C++

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

int main(){
  int n,h;
  cin >> n >> h;
  int a[n],b[n];
  for(int i=0;i<n;i++){
    cin >> a[i] >> b[i];
  }
  int ans=0;
  sort(b,b+n);
  for(int i=n-1;i>=0;i--){
    h-=b[i];
    ans++;
    if(h<0){
      break;
    }
  }
  if(h<0){
    cout << ans << endl;
  }
  int x;
  else{
    sort(a,a+n);
    x=(h-1)/a[n-1]+1;
  }
  cout << n+x << endl;
}

  

Compiler output:
a.cc: In function 'int main()':
a.cc:25:3: error: 'else' without a previous 'if'
   25 |   else{
      |   ^~~~
Language: C++

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

signed main() {
  int n,h; cin>>n>>h;

  vector<int> b(n);
  int _max=0;
  for(int i=0;i<n;++i) {
    int p,q; cin>>p>>q;
    mx = max(mx,p);
    b[i] = q;
  }
 
  sort(b.begin(), b.end(), greater<int>());
  
  int ans=0, sm=0;
  for(int i=0;i<n;++i) {
    // 降るよりも効率の良いKATANAがあれば, 投げる
    if(b[i] > _max){
      sm += b[i];
      ++ans;
    }
    if(sm >= h) break;
  }
 
  // 投げた後に, ひたすら効率の良いKATANAで降り続ける
  if(sm < h) ans += (h-sm + _max-1)/_max;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'mx' was not declared in this scope
   13 |     mx = max(mx,p);
      |     ^~
Language: C++

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

signed main() {
  int n,h; cin>>n>>h;

  vector<int> b(n);
  int _max=0;
  for(int i=0;i<n;++i) {
    int p,q; cin>>p>>q;
    mx=max(mx,p);
    b[i] = q;
  }
 
  sort(b.begin(), b.end(), greater<int>());
  
  int ans=0, sm=0;
  for(int i=0;i<n;++i) {
    // 降るよりも効率の良いKATANAがあれば, 投げる
    if(b[i]>_max){
      sm += b[i];
      ++ans;
    }
    if(sm>=h) break;
  }
 
  // 投げた後に, ひたすら効率の良いKATANAで降り続ける
  if(sm<h) ans += (h-sm+_max-1)/mx;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'mx' was not declared in this scope
   13 |     mx=max(mx,p);
      |     ^~
a.cc:30:33: error: 'mx' was not declared in this scope
   30 |   if(sm<h) ans += (h-sm+_max-1)/mx;
      |                                 ^~
Language: C++

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

signed main() {
  int n,h; cin>>n>>h;

  vector<int> b(n);
  int _max=0;
  REP(i,n){
    int p,q; cin>>p>>q;
    mx=max(mx,p);
    b[i] = q;
  }
 
  sort(b.begin(), b.end(), greater<int>());
  
  int ans=0, sm=0;
  REP(i,n){
    // 降るよりも効率の良いKATANAがあれば, 投げる
    if(b[i]>_max){
      sm += b[i];
      ++ans;
    }
    if(sm>=h) break;
  }
 
  // 投げた後に, ひたすら効率の良いKATANAで降り続ける
  if(sm<h) ans += (h-sm+mx-1)/mx;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   REP(i,n){
      |       ^
a.cc:11:3: error: 'REP' was not declared in this scope
   11 |   REP(i,n){
      |   ^~~
a.cc:30:25: error: 'mx' was not declared in this scope
   30 |   if(sm<h) ans += (h-sm+mx-1)/mx;
      |                         ^~
Language: C++

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

signed main() {
  VAR(int,n,h);
  int n,h; cin>>n>>h;

  vector<int> b(n);
  int _max=0;
  REP(i,n){
    int p,q; cin>>p>>q;
    mx=max(mx,p);
    b[i] = q;
  }
 
  sort(b.begin(), b.end(), greater<int>());
  
  int ans=0, sm=0;
  REP(i,n){
    // 降るよりも効率の良いKATANAがあれば, 投げる
    if(b[i]>_max){
      sm += b[i];
      ++ans;
    }
    if(sm>=h) break;
  }
 
  // 投げた後に, ひたすら効率の良いKATANAで降り続ける
  if(sm<h) ans += (h-sm+mx-1)/mx;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: expected primary-expression before ',' token
    7 |   VAR(int,n,h);
      |          ^
a.cc:7:11: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |   VAR(int,n,h);
      |           ^
      |           yn
a.cc:7:13: error: 'h' was not declared in this scope
    7 |   VAR(int,n,h);
      |             ^
a.cc:7:3: error: 'VAR' was not declared in this scope
    7 |   VAR(int,n,h);
      |   ^~~
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   REP(i,n){
      |       ^
a.cc:12:3: error: 'REP' was not declared in this scope
   12 |   REP(i,n){
      |   ^~~
a.cc:31:25: error: 'mx' was not declared in this scope
   31 |   if(sm<h) ans += (h-sm+mx-1)/mx;
      |                         ^~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
//int result()
int main(void)
{
    int n,h,b,d;
    vector<int> a,b;
    cin>>n>>h;
    for(int i=0;i<n;i++){
        cin >> c;
        cin >> d;
        a.push_back(c);
        b.push_back(d);
    }
    sort(a.begin(),a.end(),greater<int>());
    sort(b.begin(),b.end(),greater<int>());
    int e[n]={};
    int ecount = 0;
    for(int i=0;i<n;i++)
    {
        if(b[i]>=a[0])
        e[i]=b[i]
        ecount+=1;
    }
    int esum = 0;
    for(int i=0;i<ecount;i++)
    {
        esum+=e[i];
    }
    int count = 0;
    while(h<=esum)
    {
        h-=a[0];
        count+=1;
    }
    while(1)
    {
        h-=e[i];
        count+=1;
        if(h<=0)
        break;
    }
    cout<<count;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: conflicting declaration 'std::vector<int> b'
    9 |     vector<int> a,b;
      |                   ^
a.cc:8:13: note: previous declaration as 'int b'
    8 |     int n,h,b,d;
      |             ^
a.cc:12:16: error: 'c' was not declared in this scope
   12 |         cin >> c;
      |                ^
a.cc:15:11: error: request for member 'push_back' in 'b', which is of non-class type 'int'
   15 |         b.push_back(d);
      |           ^~~~~~~~~
a.cc:18:12: error: request for member 'begin' in 'b', which is of non-class type 'int'
   18 |     sort(b.begin(),b.end(),greater<int>());
      |            ^~~~~
a.cc:18:22: error: request for member 'end' in 'b', which is of non-class type 'int'
   18 |     sort(b.begin(),b.end(),greater<int>());
      |                      ^~~
a.cc:23:13: error: invalid types 'int[int]' for array subscript
   23 |         if(b[i]>=a[0])
      |             ^
a.cc:24:15: error: invalid types 'int[int]' for array subscript
   24 |         e[i]=b[i]
      |               ^
a.cc:40:14: error: 'i' was not declared in this scope
   40 |         h-=e[i];
      |              ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(void)
{
    int n,h,b,d;
    vector<int> a,b;
    cin>>n>>h;
    for(int i=0;i<n;i++){
        cin >> c;
        cin >> d;
        a.push_back(c);
        b.push_back(d);
    }
    sort(a.begin(),a.end(),greater<int>());
    sort(b.begin(),b.end(),greater<int>());
    int e[n]={};
    int ecount = 0;
    for(int i=0;i<n;i++)
    {
        if(b[i]>=a[0])
        e[i]=b[i]
        ecount+=1;
    }
    int esum = 0;
    for(int i=0;i<ecount;i++)
    {
        esum+=e[i;]
    }
    int count = 0;
    while(h<=esum)
    {
        h-=a[0];
        count+=1;
    }
    while(1)
    {
        h-=e[i];
        count+=1;
        if(h<=0)
        break;
    }
    cout<<count;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: conflicting declaration 'std::vector<int> b'
    8 |     vector<int> a,b;
      |                   ^
a.cc:7:13: note: previous declaration as 'int b'
    7 |     int n,h,b,d;
      |             ^
a.cc:11:16: error: 'c' was not declared in this scope
   11 |         cin >> c;
      |                ^
a.cc:14:11: error: request for member 'push_back' in 'b', which is of non-class type 'int'
   14 |         b.push_back(d);
      |           ^~~~~~~~~
a.cc:17:12: error: request for member 'begin' in 'b', which is of non-class type 'int'
   17 |     sort(b.begin(),b.end(),greater<int>());
      |            ^~~~~
a.cc:17:22: error: request for member 'end' in 'b', which is of non-class type 'int'
   17 |     sort(b.begin(),b.end(),greater<int>());
      |                      ^~~
a.cc:22:13: error: invalid types 'int[int]' for array subscript
   22 |         if(b[i]>=a[0])
      |             ^
a.cc:23:15: error: invalid types 'int[int]' for array subscript
   23 |         e[i]=b[i]
      |               ^
a.cc:29:18: error: expected ']' before ';' token
   29 |         esum+=e[i;]
      |                  ^
      |                  ]
a.cc:29:19: error: expected primary-expression before ']' token
   29 |         esum+=e[i;]
      |                   ^
a.cc:39:14: error: 'i' was not declared in this scope
   39 |         h-=e[i];
      |              ^
Language: C++

#include<bits/stdc++.h>
#include<utility>
using namespace std;
int main () {
  int N, H;
  cin >> N >> H;
  vector<pair<int, int>>da(N);
  for (int i = 0; i < N; i ++) cin >> da[i].second >> da[i].first;
  sort(da.begin(), da.end());
  for (int i = N - 1; i >= 0; i --) {
    H -= da[i].first;
    if (H <= 0) {
      cout << i + 1 << endl;
      return 0;
    }
  }
  int ma = 0;
  for (int i = 0; i < N; i ++) {
    if (ma < da[i].second) ma = da.second;
  }
  int ans = H / ma;
  if (H % ma) ans ++;
  cout << N + ans << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:36: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   19 |     if (ma < da[i].second) ma = da.second;
      |                                    ^~~~~~
Language: C++

#include "bits/stdc++.h"

using namespace std;

void solve()
{
	int N, H;
	cin >> N >> H;
	vector<pair<int, int>> as(N), bs(N);
	vector<int> mp(N);
	for (int i = 0; i < N; i++)
	{
		cin >> as[i].first >> bs[i].first;
		as[i].second = i;
		bs[i].second = i;
		mp[i] = bs[i].first;
	}
	sort(as.rbegin(), as.rend());
	sort(bs.rbegin(), bs.rend());
	int a = as[0].first, i = as[0].second, ans = 1, H2 = H;
	H -= mp[i];
	for (auto p : bs)
	{
		if (p.second == i) continue;
		if (H <= 0 || a >= p.first) break;
		H -= p.first;
		ans++;
	}
	ans += max(0, ceil(H / a));
	int ans2 = 0;
	for (auto p : bs)
	{
		if (H2 <= 0) break;
		H2 -= p.first;
		ans2++;
	}
	if (H2 <= 0) ans = min(ans, ans2);
	cout << ans << endl;
}

int main(void)
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:29:19: error: no matching function for call to 'max(int, __gnu_cxx::__enable_if<true, double>::__type)'
   29 |         ans += max(0, ceil(H / a));
      |                ~~~^~~~~~~~~~~~~~~~
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:29:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__enable_if<true, double>::__type' {aka 'double'})
   29 |         ans += max(0, ceil(H / a));
      |                ~~~^~~~~~~~~~~~~~~~
/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:29:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |         ans += max(0, ceil(H / a));
      |                ~~~^~~~~~~~~~~~~~~~
Language: C++

#include "bits/stdc++.h"

using namespace std;

void solve()
{
	int N, H;
	cin >> N >> H;
	vector<pair<int, int>> as(N), bs(N);
	vector<int> mp(N);
	for (int i = 0; i < N; i++)
	{
		cin >> as[i].first >> bs[i].first;
		as[i].second = i;
		bs[i].second = i;
		mp[i] = bs[i].first;
	}
	sort(as.rbegin(), as.rend());
	sort(bs.rbegin(), bs.rend());
	int a = as[0].first, i = as[0].second, ans = 0;
	H -= mp[i];
	for (auto p : bs)
	{
		if (p.second == i) continue;
		if (H <= 0 || a >= b) break;
		H -= b;
		ans++;
	}
	if (H > 0) ans += ceil(H / a);
	cout << ans << endl;
}

int main(void)
{
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:25:36: error: 'b' was not declared in this scope
   25 |                 if (H <= 0 || a >= b) break;
      |                                    ^
a.cc:26:22: error: 'b' was not declared in this scope
   26 |                 H -= b;
      |                      ^
Language: Java

import java.util.*;
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 count = 0;
    for(int i = b.length - 1; i >= 0; i--){
      if(b[i] < a[a.lenght - 1]) break;
      h -= b[i];
      count++;
    }
    
    System.out.println(count + (int)Math.ceil(h / (double)a[0]));
  }
}

Compiler output:
Main.java:18: error: cannot find symbol
      if(b[i] < a[a.lenght - 1]) break;
                   ^
  symbol:   variable lenght
  location: variable a of type int[]
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    using ll = long long;
    ll n, h;
    cin >> n >> h;
    using P = pair<ll, ll>;
    vector<P> s(n);
    ll cu = 0;
    for(int i = 0; i < n; i++)
    {
        ll a, b;
        cin >> a >> b;
        s[i].first = b;
        s[i].second = a;
        cu = max(cu, a);
    }
    sort(s.begin(), s.end(), greater<P>());
   
    ll ans = 0;
    for(int i = 0; i < cupos; i++)
    {
        if(cu <= s[i].first)
        {
            h -= s[i].first;
            ans++;
        }
        else
        {
            break;
        }
        if(h <= 0)
        {
            cout << ans << endl;
            return 0;
        }
    }
    while(true)
    {
        if(h <= cu)
        {
            ans++;
            cout << ans << endl;
            return 0;
        }
        else
        {
            h -= cu;
            ans++;
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: 'cupos' was not declared in this scope; did you mean 'cos'?
   22 |     for(int i = 0; i < cupos; i++)
      |                        ^~~~~
      |                        cos
Language: C++

#include <bits/stdc++.h>

using namespace std;


int main(){
  
   int n,hp;
  cin>>n>>hp;
  int a[n];
  int b[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
    cin>>b[i];}
  sort(a,a+n,greater<int>());
  sort(b,b+n,greater<int>());

      
       int abig=0;
       bool owari=true;
       if(a[0]>=b[0]){
         cout<<(hp+a[0]-1)/a[0]<<endl;}
       else {
       while(a[0]<b[abig]) abig++;
        
         
    
         for(int k=0;k<abig;k++){
           hp-=b[k]
             if(hp<=0) {cout<<k+1<<endl;
           owari=false;
           break;}
         }
         
         if(owari){
           cout<<abig+(hp+a[0]-1)/a[0]<<endl;}
         
       }
 
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: expected ';' before 'if'
   29 |            hp-=b[k]
      |                    ^
      |                    ;
   30 |              if(hp<=0) {cout<<k+1<<endl;
      |              ~~
Language: C++

#include <bits/stdc++.h>

using namespace std;


int main(){
  
   int n,hp;
  cin>>n>>hp;
  int a[n];
  int b[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
    cin>>b[i];}
  sort(a,a+n,greater<int>()};
  sort(b,b+n,greater<int>()};

      
       int abig=0;
       bool owari=true;
       if(a[0]>=b[0]){
         cout<<(hp+a[0]-1)/a[0]<<endl;}
       else {
       while(a[0]<b[abig]) abig++;
        
         
    
         for(int k=0;k<abig;k++){
           hp-=b[k]
             if(hp<=0) {cout<<k+1<<endl;
           owari=false;
           break;}
         }
         
         if(owari){
           cout<<abig+(hp+a[0]-1)/a[0]<<endl;}
         
       }
 
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: expected ')' before '}' token
   15 |   sort(a,a+n,greater<int>()};
      |       ~                    ^
      |                            )
a.cc: At global scope:
a.cc:16:7: error: expected constructor, destructor, or type conversion before '(' token
   16 |   sort(b,b+n,greater<int>()};
      |       ^
a.cc:16:28: error: expected declaration before '}' token
   16 |   sort(b,b+n,greater<int>()};
      |                            ^
a.cc:21:8: error: expected unqualified-id before 'if'
   21 |        if(a[0]>=b[0]){
      |        ^~
a.cc:23:8: error: expected unqualified-id before 'else'
   23 |        else {
      |        ^~~~
a.cc:41:1: error: expected declaration before '}' token
   41 | }
      | ^
Language: C++

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

typedef long long int;

int main(){
  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());
  sort(b.begin(),b.end());
  int m = a[n-1];
  int sum = 0,t=0;
  for(int i=0;i < n && b[n-i-1] > m;i++){t++;sum += b[n-i-1];}
  t += (h - sum) / m  + ((h-sum)%m == 0 ? 0 : 1);
  cout << t << endl;
  return 0;
}
  

  

Compiler output:
a.cc:4:19: error: declaration does not declare anything [-fpermissive]
    4 | typedef long long int;
      |                   ^~~
Language: C++

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

typedef int long long;

int main(){
  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());
  sort(b.begin(),b.end());
  int m = a[n-1];
  int sum = 0,t=0;
  for(int i=0;i < n && b[n-i-1] > m;i++){t++;sum += b[n-i-1];}
  t += (h - sum) / m  + ((h-sum)%m == 0 ? 0 : 1);
  cout << t << endl;
  return 0;
}
  

Compiler output:
a.cc:4:18: error: declaration does not declare anything [-fpermissive]
    4 | typedef int long long;
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  ll n,k,m=0,c=0,a;
  cin>>n>>k;
  vector<ll> b(n);
  for(int i=0;i<n;i++){
    cin>>a>>b[i];
    m=max(a,m);
  }
  sort(b.begin(),b.end(),greater<ll>());
  for(int i=0;i<n;i++){
    k-=b;
    c++;
    if(k<=0){
      cout<<c;
      return 0;
    }
  }
  cout<<c+(k%m==0?k/m:k/m+1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:6: error: no match for 'operator-=' (operand types are 'long long int' and 'std::vector<long long int>')
   14 |     k-=b;
      |     ~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define REP(i, n) for(int i=0;i<(n);++i)

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

	ll N, H, a[100000], b[100000];
	cin >> N >> H;
	ll amax = -1, sum = 0;
	REP(i, N) {
		cin >> a[i] >> b[i];
		amax = max(amax, a[i]);
	}
	ll ans = 0;
	REP(i, N) {
		if(b[i] > amax) {
			sum += b[i]; ans++;
		}
	}
	H -= sum;
	ans += (H+amax-1) / amax;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'll' was not declared in this scope
   10 |         ll N, H, a[100000], b[100000];
      |         ^~
a.cc:11:16: error: 'N' was not declared in this scope
   11 |         cin >> N >> H;
      |                ^
a.cc:11:21: error: 'H' was not declared in this scope
   11 |         cin >> N >> H;
      |                     ^
a.cc:12:11: error: expected ';' before 'amax'
   12 |         ll amax = -1, sum = 0;
      |           ^~~~~
      |           ;
a.cc:14:24: error: 'a' was not declared in this scope
   14 |                 cin >> a[i] >> b[i];
      |                        ^
a.cc:14:32: error: 'b' was not declared in this scope
   14 |                 cin >> a[i] >> b[i];
      |                                ^
a.cc:15:17: error: 'amax' was not declared in this scope; did you mean 'fmax'?
   15 |                 amax = max(amax, a[i]);
      |                 ^~~~
      |                 fmax
a.cc:17:11: error: expected ';' before 'ans'
   17 |         ll ans = 0;
      |           ^~~~
      |           ;
a.cc:19:20: error: 'b' was not declared in this scope
   19 |                 if(b[i] > amax) {
      |                    ^
a.cc:19:27: error: 'amax' was not declared in this scope; did you mean 'fmax'?
   19 |                 if(b[i] > amax) {
      |                           ^~~~
      |                           fmax
a.cc:20:25: error: 'sum' was not declared in this scope
   20 |                         sum += b[i]; ans++;
      |                         ^~~
a.cc:20:38: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |                         sum += b[i]; ans++;
      |                                      ^~~
      |                                      abs
a.cc:23:14: error: 'sum' was not declared in this scope
   23 |         H -= sum;
      |              ^~~
a.cc:24:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |         ans += (H+amax-1) / amax;
      |         ^~~
      |         abs
a.cc:24:19: error: 'amax' was not declared in this scope; did you mean 'fmax'?
   24 |         ans += (H+amax-1) / amax;
      |                   ^~~~
      |                   fmax
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <set>
#include <vector>
#include <string>
#include <map>
#include <cstdlib>
#include <basetsd.h>
#include <exception>
#include <bits/stdc++.h>
using namespace std;
struct Node{
    int l;
    int r;
}a[1000000];
int n,h,c;
bool cmp(Node p,Node q){
    return p.l>q.l;
}
int main(){
    scanf("%d%d",&n,&h);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[c++].l);
        a[c].r=1;
        scanf("%d",&a[c++].l);
    }
    stable_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);
            return 0;
        }
    }
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  ll n,h,m=0,s=0,c=0;
  cin>>n>>h;
  vector<ll> a(n),b(n);
  for(int i=0;i<n;i++){
    cin>>a[i]>>b[i];
    if(m<a[i]) m=a[i];
  }
  for(int i=0;i<n;i++){
    if(b[i]>=m){
      s+=b[i];
    }else{
      b.erase(b.begin(),b.end(),i);
    }
  }
  if(s>=h){
    sort(b.begin(),b.end(),greater<ll>());
    for(int i=0;i<b.size();i++){
      h-=b[i];
      c++;
      if(h<=0){
        cout<<c;
        return 0;
      }
    }
  }else{
    h-=s;
    c+=n;
    if(h%m!=0) c++;
    c+=h/m;
    cout<<c;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: no matching function for call to 'std::vector<long long int>::erase(std::vector<long long int>::iterator, std::vector<long long int>::iterator, int&)'
   16 |       b.erase(b.begin(),b.end(),i);
      |       ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = long long int; _Alloc = std::allocator<long long int>; iterator = std::vector<long long int>::iterator; const_iterator = std::vector<long long int>::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:7: note:   candidate expects 1 argument, 3 provided
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = long long int; _Alloc = std::allocator<long long int>; iterator = std::vector<long long int>::iterator; const_iterator = std::vector<long long int>::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 3 provided
Language: C++

#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;




int main(){
    ll n,h;

    cin>>n>>h;
    vector<ll> a(n);
    vector<ll> b(n);
    for(int i=0;i<n;i++){
        ll x,y;
        cin>>x>>y;
        a.push_back(x);
        b.push_back(y);
    }
    
    sort(a.rbegin(),a.rend());
    sort(b.rbegin(),b.rend());
    
    ll nage=0;
    ll nokori=0;
    ll ans=0;
    
    
    ll mi=h/a[0];
    
    if(h%a[0]!=0)mi++;
    
    
    for(ll i=0;i<n;i++){
        nage+=b[i];
        nokori=h-nage;
        if(nokori>=0){
        ans=nokori/a[0];
        if(nokori%a[0]!=0)ans++;
        ans+=i+1;
            
        /*}else{
            ans=i+1;
         }*/
        mi=min(ans,mi);
    }
    
    cout<<mi<<endl;
    

return 0;
}


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:27:31: error: expected ';' before 'cout'
   27 |             else s+=h%k[i].a+1
      |                               ^
      |                               ;
   28 |             cout<<s<<endl;
      |             ~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:26: error: expected ';' before 'if'
   21 |             h-=k[i].a;s++
      |                          ^
      |                          ;
   22 |             if(h<=0){cout<<s<endl;return 0;}
      |             ~~            
a.cc:26:31: error: expected ';' before 'cout'
   26 |             else s+=h%k[i].a+1
      |                               ^
      |                               ;
   27 |             cout<<s<<endl;
      |             ~~~~
Language: C++

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

Compiler output:
a.cc: In function 'bool cmp(p, p)':
a.cc:7:15: error: 'struct p' has no member named 'l'
    7 |     return xx.l>yy.l;
      |               ^
a.cc:7:20: error: 'struct p' has no member named 'l'
    7 |     return xx.l>yy.l;
      |                    ^
a.cc: In function 'int main()':
a.cc:21:26: error: expected ';' before 'if'
   21 |             h-=k[i].a;s++
      |                          ^
      |                          ;
   22 |             if(h<=0){cout<<s<endl;return 0;}
      |             ~~            
a.cc:26:31: error: expected ';' before 'cout'
   26 |             else s+=h%k[i].a+1
      |                               ^
      |                               ;
   27 |             cout<<s<<endl;
      |             ~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
  int n,h;
  cin >> n >> h;
  vector<int> a(n);
  vector<int> b(n);
  int int i;
  for(i = 0;i < n;++i){
    cin >> a.at(i) >> b.at(i);
  }
  sort(a.begin(),a.end());  sort(b.begin(),b.end());
  reverse(a.begin(),a.end()); reverse(b.begin(),b.end());
  int maxa = a.at(0);
  int ans = 0;
  int modeb = 0;
  while(h > 0){
    if(modeb < n && b.at(modeb) > maxa){
      h -= b.at(modeb);
      ++ans;
      ++modeb;
    }else{
      h -= maxa;
      ++ans;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: two or more data types in declaration of 'i'
   15 |   int int i;
      |   ^~~
a.cc:16:7: error: 'i' was not declared in this scope
   16 |   for(i = 0;i < n;++i){
      |       ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
struct knife
{
	int kill;
	int fly;
}diediedie[1000010];
bool cmp(knife x,knife y)
{
	if(x.kill>y.kill)
		return true;
	else
		return false;
}
int main()
{
	int kni,health,ans=0;
	cin>>kni>>health;
	int k=0;
	for(int i=1;i<=n;i++)
	{
		cin>>diediedie[k++].kill;
		diediedie[k].fly=1;
		cin>>diediedie[k++].kill;
	}
	sort(diediedie,diediedie+k,cmp);
	for(int i=0;i<k;i++)
	{
		if(diediedie[i].fly==1)
		{
			health=health-diediedie[i].kill;
			ans++;
			if(h<=0)
			{
				cout<<ans<<endl;
				return 0;
			}
		}
		else
		{
			if(health%diediedie[i].kill==0)
			{
				ans=ans+(health/diediedie[i].kill);
			}
			else
			{
				ans=ans+1+(health/diediedie[i].kill);
            	printf("%d",sum);
            	return 0;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: 'n' was not declared in this scope
   24 |         for(int i=1;i<=n;i++)
      |                        ^
a.cc:37:28: error: 'h' was not declared in this scope
   37 |                         if(h<=0)
      |                            ^
a.cc:52:29: error: 'sum' was not declared in this scope
   52 |                 printf("%d",sum);
      |                             ^~~
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define gs(v) sort(v.begin(),v.end(),greater<int>())
main(){int n,h,s=0,i=0;cin>>n>>h;
 vector<int>a(n),b(n);for(;i<n;++i)cin>>a[i]>>b[i];
 gs(a),gs(b);for(i=0;i<n&&b[i]>a[0]&&s<h;++i)s+=b[i];
 cout<<i+(s<h)*(h-s+a[0]-1)/a[0]}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){int n,h,s=0,i=0;cin>>n>>h;
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:33: error: expected ';' before '}' token
    7 |  cout<<i+(s<h)*(h-s+a[0]-1)/a[0]}
      |                                 ^
      |                                 ;
Language: C++

#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>



using namespace std;
typedef long long ll;
int gcd( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd
int lcm( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int input(){
  int x;
  cin>>x;
  return x;
}
int abs(int x){
  if(x>=0){
    return x;
  }else{
    return -x;
  }
}

int moji(char in)
{
    int ans = (int)in-(int)'a'+1;
    if((in < 1) || (in > 26)){
        ans = 100;
    }
    return ans;
}
const int VV=10;//場合に応じてVVの値のみ変更する必要あり
//dijkstra(s)sがスタート地点でそこからの最短距離を配列dで表す。正の重みのみ使用可能
int cost[VV][VV];
int d[VV];
bool used[VV];
void dijkstra(int s){
  fill(d,d+VV,100000);
  fill(used,used+VV,false);
  d[s]=0;
  while(true){
    int v=-1;
    for(int u=0;u<VV;u++){
      if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
    }
    if(v==-1)break;
    used[v]=true;
    for(int u=0;u<VV;u++){
      d[u]=min(d[u],d[v]+cost[v][u]);
    }
  }

}

int compare_int(const void *a, const void *b)//qsort(quick sort利用時に使用)
{
    return *(int*)a - *(int*)b;
}









int main() {
  int N,H;
  cin>>N>>H;
  int a[N];
  int b[N];
  int max=-100;
  int maxidx=0;
  int sum=0;
  for(int i=0;i<N;i++){
    a[i]=-o;
    b[i]=0;
  }
  for(int i=0;i<N;i++){
    cin>>a[i]>>b[i];
    if(a[i]>max){
      max=a[i];
      maxidx=i;
    }
    if(a[i]==max){
      if(b[maxidx]<b[i]){
        maxidx=i;
      }
    }
  }
  bool ok=true;
  for(int i=0;i<N;i++){
    
    if(b[i]>max&&i!=maxidx){
      H-=b[i];
      a[i]=0;
      b[i]=0;
      sum++;
    }
    
    
    

    
    }
  while(true){
    if(H-b[maxidx]<=0){
      sum++;
      break;
    }
    H-=max;
    sum++;
  }
  
  
  cout<<sum<<endl;



  





  

  


  

    


  

  
  
  
  
}


  
  

  

  


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,h;cin>>n>>h;
  vector<pair<int,int> >pa,pb;
  for(int i=0;i<n;i++){
    int a,b;cin>>a>>b;
    pa.push_back(make_pair(a,i));
    pb.push_back(make_pair(b,i));
  }
  sort(pa.begin(),pa.end());
  sort(pb.begin(),pb.end());
  int af=pa[n-1].first;
  int as=pa[n-1].second;
  int sum=0;
  int hor=0;
  int th;
  for(int i=n-1;i>=0;i--){
    if(pb[i].second==as){
      th=i;
      continue;
    }
    if(pb[i].first>=af){
      hor++;
      sum+=pb[i].first;
    }
    if(sum>=h){
      cout<<hor<<endl;
      return 0;
    }
    if(pb[i].first<af){
      break;
    }
  }
  int bf=pb[th].first;
  for(;;){
    hor++;
    if(sum+bf>=h){
      cout<<hor<<endl;
      return 0;
    }
    sum+=af
  }
}
    
      


Compiler output:
a.cc: In function 'int main()':
a.cc:42:12: error: expected ';' before '}' token
   42 |     sum+=af
      |            ^
      |            ;
   43 |   }
      |   ~
Language: C++

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

int main()
{
  int n, h;
  cin >> n >> h;
  vector<int> a(n), b(n);
  for (auto i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  int max_swing = *max_element(begin(a), end(a));
  sort(begin(b), end(b), greater());
  int count = 0;
  for (auto&& e : b) {
    if (e > max_swing) {
      count++;
      h -= e;
      if (h <= 0) break;
    }
  }
  if (h > 0) {
    count += h / max_swing;
    if (h % max_swing != 0) count++;
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 'max_element' was not declared in this scope
   13 |   int max_swing = *max_element(begin(a), end(a));
      |                    ^~~~~~~~~~~
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(begin(b), end(b), greater());
      |   ^~~~
      |   short
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
const int Maxn=1e6+300;
int a[Maxn],b[Maxn];
int n,h,cnt=0;
int main()
{
	cin>>n>>h;
	for(int i=0;i<n;i++)
	  cin>>a[i]>>b[i];
	sort(a,a+n);reverse(a,a+n);
	sort(b,b+n);reverse(b,b+n);
	for(int i=0;i<n;i++)
	  if(b[i]>a[0]&&H>0)
	  {
	  	cnt++;
	  	H-=b[i];
	  }
	while(H>0)
	{
		cnt++;
		H-=a[0];
	}
	cout<<cnt<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:25: error: 'H' was not declared in this scope
   15 |           if(b[i]>a[0]&&H>0)
      |                         ^
a.cc:20:15: error: 'H' was not declared in this scope
   20 |         while(H>0)
      |               ^
Language: C++

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

pair<int, int> P[100000];

int main()
{
  long long n,h;
  cin >> n >> h;
  for(int i=0;i < n;i++){
    cin >> P[i].first >> P[i].second;
  }
  sort(P,P+n);
  maxi = P[n-1].first;
  
  for(int i=0;i < n-1;i++){
    maxi = max(P[i].second,maxi);
  }
  long long rest = h;
  long long cnt=0;

  if(P[n-1].second >= h){
    cout << 1 << endl;
  }
  else if(maxi == P[n-1].first){
    while(rest > P[n-1].second){
      rest -= P[n-1].first;
      cnt++;
    }
    cout << cnt+1 << endl;
  }
  else{
    long long k=0;
    vector<int> store(n,0);
    
    for(int i=0;i < n-1;i++){
      if(P[i].second > P[n-1].first){
	store[k++] = P[i].second;
      }
    }
    long long cc=0;
    k=0;
    while(rest > P[n-1].second && store[k] != 0){
      rest -= store[k++];
      cnt++;
    }
    while(rest > P[n-1].second){
      rest -= P[n-1].first;
      cc++;
    }
    cout << cnt+cc+1 << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'maxi' was not declared in this scope
   14 |   maxi = P[n-1].first;
      |   ^~~~
Language: C++

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

#define REP(i, n) for(int i = 0; i < n; i++)

int main(){
  int n, h;
  cin >> n >> h;
  vector<int> a(n), b(n);
  REP(i, n) cin >> a[i] >> b[i];
  
  sort(a.begin(), a.end(), greater<int>());
  sort(b.begin(), b.end(), greater<int>());
  
  int ans = 0;
  REP(i, n){
  	if(h <= 0){
      cout << ans << endl;
      return 0;
    }
    
    h -= b[i];
    ans++;
  }
  
  cout << ans + floor((double)h / a[0])) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:40: error: expected ';' before ')' token
   29 |   cout << ans + floor((double)h / a[0])) << endl;
      |                                        ^
      |                                        ;
Language: C++

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

#define REP(i, n) for(int i = 0; i < n; i++)

int main(){
  int n, h;
  cin >> n >> h;
  vector<int> a(n), b(n);
  REP(i, n) cin >> a[i] >> b[i];
  
  sort(a.begin(), a.end(), greater<int>());
  sort(b.begin(), b.end(), greater<int>());
  
  int ans = 0;
  REP(i, n){
  	if(h <= 0){
      cout << ans << endl;
      return 0;
    }
    
    h -= b[i];
    ans++;
  }
  
  cout << ans + floor((double)h / a[0])) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'floor' was not declared in this scope
   28 |   cout << ans + floor((double)h / a[0])) << endl;
      |                 ^~~~~
Language: C++

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

#define REP(i, n) for(int i = 0; i < n; i++)

int main(){
  int n, h;
  cin >> n >> h;
  vector<int> a(n), b(n);
  REP(i, n) cin >> a[i] >> b[i];
  
  sort(a.begin(), a.end(), greater<int>());
  sort(b.begin(), b.end(), greater<int>());
  
  int ans = 0;
  REP(i, n){
  	if(h <= 0){
      cout << ans << endl;
      return 0;
    }
    
    h -= b[i];
    ans++;
  }
  
  cout << ans + floor((double)h / a[0]) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'floor' was not declared in this scope
   28 |   cout << ans + floor((double)h / a[0]) << endl;
      |                 ^~~~~