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

#include <cmath>
#include <iostream>
#include <string>
#include <vector> 
#include <algorithm>
#include <numeric>

#define FOR(i,a,b) for(i=(a);i<(b);++i) 
#define FORR(i,a,b) for(i=(a);i>(b);--i)
#define REP(i,n) for(i=0;i<(n);++i)
#define REPR(i,n) for(i=(n);i>0;--i)
#define ll long long
#define INT_MAX 2147483647
#define LL_MAX 9223372036854775807

using namespace std;

long long GCD(long long a, long long b) {
	if (a < b)
		swap(a, b);
	if (b == 0) return a;
	else return GCD(b, a % b);
}

bool sosuu_check(int num) {
	int i;
	for (i = 2; i <= sqrt(num); ++i) {
		if (num%i==0)
			return false;
	}
	return (num < 2) ? false : true;
}

int main() {
	int N, H, i, MA, ans=0;
	cin >> N >> H;
	vector<int> a(100000),b(100000);
	REP(i, N) 
		cin >> a[i] >> b[i];
	MA = *max_element(a.begin(), a.begin() + N);
	sort(b.begin(), b.begin() + N);
	FORR(i, N - 1, -1)
		if (H <= 0)
			cout << ans << endl;
		if (b[i] > MA) {
			++ans;
			H -= b[i];
		}
		else
			break;
	if (H <= 0)
		cout << ans << endl;
	ans += (H + MA - 1) / MA;
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:25: error: break statement not within loop or switch
   50 |                         break;
      |                         ^~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define MAX 100000007
using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int N,H;
  cin >> N >> H;
  int a[N],b[N];
  for(int i=0;i<N;i++){
    cin >> a[i] >> b[i];
  }
  ll cnt=0;
  sort(a,a+N);
  reverse(a,a+N);
  sort(b,b+N);
  reverse(b,b+N);
  while(H>0){
    for(int i=0;i<N;i++){
      if(b[i]>a[0]){
        H-=b[i];
        cnt++;
      }else{
        cnt=cnt+floor(H/a[0]);
        cout << cnt << endl;
        return 0;
      }
  }
}

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

#include<cstdio>
#include<algorithm>
#define int long long int
using namespace std;

int a[200000], b[200000];
 main(void) {
    int n,h;
    scanf("%lld%lld",&n,&h);
    for(int i=0; i<n; i++)
        scanf("%lld%lld",&a[i],&b[i]);
    int m = 0;
    for(int i=0; i<n; i++)
        if(m < a[i]) m = a[i];
    sort(b, b+n);

    int res = (h+m-1)/m;
    long long int t = 0;
    for(int i=0; i<n; i++) {
        t += b[n-1-i];
        int k = (h-t+m-1)/m + (i+1);
        if(k < res) res = k;
    }
    printf("%lld\n", res);
}


Compiler output:
a.cc:7:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 |  main(void) {
      |  ^~~~
a.cc: In function 'int main()':
a.cc:3:13: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |             ^~~~
a.cc:18:15: note: in expansion of macro 'int'
   18 |     long long int t = 0;
      |               ^~~
a.cc:3:18: error: 'long long long' is too long for GCC
    3 | #define int long long int
      |                  ^~~~
a.cc:18:15: note: in expansion of macro 'int'
   18 |     long long int t = 0;
      |               ^~~
Language: C++

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

int n,h,a,b,b_max,c=0;
set<int> x,y;

int main(){
	cin>>n>>h;
	for(int i=0;i<n;i++){
		cin>>a>>b;
		x.insert(a);
		y.insert(b);
		if(a==*(x.end())) {b_max=b; y.erase(b);}
	}

	for(set<int>::iterator it=y.end();*it>=*(x.end());it--){
		if(h<=b_max||(h<=*(x.end()))){ break;}
		h-=*it;
		c++;
	}

	do{
		if(h<=b_max||(h<=*(x.end()))){c++; break;}
		h-=*(x.end());
		c++;
	}while();

	cout<<c<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:16: error: expected primary-expression before ')' token
   27 |         }while();
      |                ^
Language: C++

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

int n,h,a,b,b_max,c=0;
set<int> x,y;

int main(){
	cin>>n>>h;
	for(int i=0;i<n;i++){
		cin>>a>>b;
		x.insert(a);
		y.insert(b);
		if(a==*(x.end())) {b_max=b; y.erase(b);}
	}

	for(set<int>::iterator it=y.end();*it>=*(x.end());it--){
		if(h<=b_max||(h<=*(x.end()))){ break;}
		h-=*it;
		c++;
	}

	do{
		if(h<=b_max||(h<=*(x.end()))){c++; break;}
		h-=*(x.end());
		c++;
	}

	cout<<c<<endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: expected 'while' before 'cout'
   29 |         cout<<c<<endl;
      |         ^~~~
a.cc:29:9: error: expected '(' before 'cout'
   29 |         cout<<c<<endl;
      |         ^~~~
      |         (
a.cc:29:22: error: expected ')' before ';' token
   29 |         cout<<c<<endl;
      |         ~~~~         ^
      |                      )
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
using ll = long long;

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

		}
		cout << ans << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: redeclaration of 'std::vector<long long int> a'
   11 |         vector<ll>a(n+100);
      |                   ^
a.cc:10:19: note: 'std::vector<long long int> a' previously declared here
   10 |         vector<ll>a(n+100);
      |                   ^
a.cc:14:32: error: 'b' was not declared in this scope
   14 |                 cin >> a[i] >> b[i];
      |                                ^
a.cc:21:14: error: 'b' was not declared in this scope
   21 |         sort(b.begin(), b.end());
      |              ^
Language: C++

from math import ceil
a,b=[int(x) for x in str(input()).split()]
ab=[[0,0]]

ma=0  #max weild
ms=[]  #number of max weild
for j in range(1,a+1):
  A=[int(x) for x in str(input()).split()]
  ma=max(ma,A[0])
  ab.append(A)


throws=[]
for i in range(1,a+1):
  if ab[i][1]>=ma:
    throws.append(ab[i][1])
throws.sort(reverse=True)


count=0
for i in throws:
  if b>0:
    b-=i
    count+=1
if b>0:
  count+=(ceil(b/ma))
print(count)





Compiler output:
a.cc:5:7: error: stray '#' in program
    5 | ma=0  #max weild
      |       ^
a.cc:6:8: error: stray '#' in program
    6 | ms=[]  #number of max weild
      |        ^
a.cc:1:1: error: 'from' does not name a type
    1 | from math import ceil
      | ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;
bool cmp (int a, int b) {
  return(a > b);
}
int main(){
  int n, h;
  vector<int> b;
  int a_max = 0;
  int count = 0;
  cin >> n >> h;
  for (int i=0;i<n;i++) {
    int aa, bb;
    cin >> aa >> bb;
    a_max = aa > a_max?aa:a_max;
    b.push_back(bb);
  }
  sort(b.begin(), b.end(), cmp);
  for (int i=0;i<n;i++) {
    if (b[i] > a_max) {
      h -= b[i];
      count++;
      if (h<=0) {
	cout << count << endl;
	return(0);
      }
    }
  }

  count += h/a_max;
  if (h%a_max!=0) {
    count++;
  }
  cout << count << endl;
  return(0);
}


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

#include <bits/stdc++.h>
using namespace std;
int sum,cunt2,cunt,N,H,a_max;
static const int MAX=10000;
vector<int> a,b;

void solve(){
    sort(b.begin(),b.end());
    for(int i=0;i<N;i++){
        cunt++;
        sum+=b[i];
        if(sum>=H){
            cout<<cunt<<"\n";
            return;
        }    
    }
/*    sort(b.begin(),b.end());
    vector<int>::iterator low_it= lower_bound(b.begin(),b.end(),a_max);      
    for(vector<int>::iterator it=low_it;it<b.end();it++){
        cunt++;
        sum+=*it;
        if(sum>=H){
            cout<<cunt<<"\n";
            return;
        }
    }*/    
    if((H-sum)%a_max)
        cunt2=cunt+(H-sum)/a_max+1;
    else
        cunt2=cunt+(H-sum)/a_max;                 
    cout<<cunt2<<"\n";    
}        

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


Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: expected '}' at end of input
   35 |     cin>>N>>H;
      |               ^
a.cc:34:11: note: to match this '{'
   34 | int main(){
      |           ^
Language: C++

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

int main(){
  int N,H;
  vector<int> sords;
  cin >> N >> H;
  int m=-1;
  for(int i=0;i<N;i++){
    int a,b;
    cin >> a >> b;
    m=max(m,a);
    sords.push_back(b);
  }
  sort(sords.begin(),sords.end(),greater<int>());
  int atk=0;
  for(int i=0;i<N||H<0||sourds[i]>m;i++){
    H-=sords[i];
    atk++;
  }
  if(H>0){
    atk+=H/m;
    if(H%m!=0)atk++;
  }
  cout << atk << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: 'sourds' was not declared in this scope; did you mean 'sords'?
   19 |   for(int i=0;i<N||H<0||sourds[i]>m;i++){
      |                         ^~~~~~
      |                         sords
Language: C++

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

using namespace std;

int main(){
    int N,H;
    cin >> N >> H;
    int a[N];
    int b[N];
    for(int i = 0; i < N; i++){
        cin >> a[i] >> b[i];
    }
    //printf("%d", a[0]);
    /*if(N>1){

    }*/
    sort(a, a+N, greater<int>());

    int a_max = 0;
    a_max = a[0];

    //printf("a_max : %d\n", a_max);

    //int thrower = 0;
    int count = 0;
    int nokori;
    nokori = H;
    for (int i = 0; i < N; i++){
        if(a_max < b[i]){
            nokori = nokori - b[i];
            //thrower += b[i];
            count++;
            if(nokori <= 0){
                cout << count << endl;
                return 0;
            }
        }
    }
    //printf("throw : %d\n", count);


    //printf("nokori : %d\n", nokori);
    /*
    int slice = nokori/a_max;
    if(nokori%a_max != 0){
        slice += 1;
    }
    */
    while(nokori>0){
        nokori = nokori - a_max;
        count ++
    }
    //printf("slice : %d\n", slice);

    //count += slice;

    cout << count << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:17: error: expected ';' before '}' token
   54 |         count ++
      |                 ^
      |                 ;
   55 |     }
      |     ~
Language: C++

#include <iostream>

#define NMAX 100005

using namespace std;
using ll =  long long;


int N,H,A[NMAX],B[NMAX];

bool check(int x){
  int i = 0;
  ll sum = 0;
  for(; x > 0 && i < N && A[0] < B[i]; --x){
      sum += B[i++];
  }
  sum += x * A[0];
  return sum >= H;
}

int main(){
  cin >> N >> H;
  for(int i = 0; i < N; ++i){
    scanf("%d %d", &A[i], &B[i]);
  }
  sort(A, A + N, greater<int>());
  sort(B, B + N, greater<int>());
  // solve
  int low = 0, hi = H;
  while(hi - low > 1){
    int mid = low + (hi - low) / 2;
    if(check(mid)){
      hi = mid;
    }
    else {
      low = mid;
    }
  }
  // answer
  cout << hi << endl;

  return 0;
}

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

#include <iostream>
#include <vector>

#define NMAX 100002
using namespace std;

vector<int> v;
int H,N,A[NMAX],B[NMAX];

bool judge(int a){
	int sum = 0;
	for (int i = 0; i < a; ++i)
	{
		if(i < v.size()){
			sum += v[i];
		}else{
			sum += v[v.size()-1];
		}
	}
	return (H <= sum);
}

int main(){
	cin >> N >> H;
	int a = 0;
	for (int i = 0; i < N; ++i)
	{
		cin >> A[i] >> B[i];
		a = max(A[i],a);
	}
	v.push_back(a);
	for (int i = 0; i < N; ++i)
	{
		if(B[i] > a){
			v.push_back(B[i]);
		}
	}
	sort(v.begin(), v.end(),greater<int>() );
	int r = 0,l = H/A[0] + (H%A[0] != 0);
	while(l - r > 1){
		int m = (l-r)/2+r;
		if(judge(m)) l = m;
		else r = m;
	}
	// for (int i = 0; i < v.size(); ++i)
	// {
	// 	cout << v[i] << " ";
	// }
	// cout << endl;
	cout << l << endl;
	return 0;
}

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

#include<cstdio>
#include<algorithm>
int n,h,ans;
struct Stu{
	long long a,b;
}k[1000100];
int cmp(Stu x,Stu y)
{
	return x.a<y.a;
}
int main()
{
	scanf("%d%d",&n,&h);
	int oo=1;
	for(int i=1;i<=n;++i)
	{
		scanf("%d",&k[oo++].a);
		k[oo-1].b=1;
		scanf("%d",&k[oo++].a);
	}
	sort(k+1,k+2*n+1,cmp);
	int o=2*n;
	while(h>0)
	{
		if(k[o].b==0)
		{
			h-=k[o].a;
			ans++;
		}
		else break;
		o--;
	}
	if(h<0)
	  h=0;
	if(h%k[o].a==0)
	  printf("%d\n",ans+h/k[o].a);
	else printf("%d\n",ans+h/k[o].a+1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   21 |         sort(k+1,k+2*n+1,cmp);
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

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

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

  vector<int64_t> a(n), b(n + 1);
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i + 1];
  }

  int64_t max_a = 0;
  for (auto &i : a) max_a = max(max_a, i);

  sort(b.begin() + 1, b.end(), greater<int64_t>());
  for (int i = 1; i <= n; ++i) {
    b[i] += b[i - 1];
  }

  int64_t ans = 1001001001001001001ll;
  for (int i = 0; i <= n; ++i) {
    ans = min(ans, i + max(0ll, (h - b[i] + max_a - 1) / max_a));
  }

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: no matching function for call to 'max(long long int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
   23 |     ans = min(ans, i + max(0ll, (h - b[i] + max_a - 1) / max_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:23:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type' {aka 'long int'})
   23 |     ans = min(ans, i + max(0ll, (h - b[i] + max_a - 1) / max_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:23:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   23 |     ans = min(ans, i + max(0ll, (h - b[i] + max_a - 1) / max_a));
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

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

  vector<int64_t> a(n), b(n + 1);
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i + 1];
  }

  int64_t max_a = 0;
  for (auto &i : a) max_a = max(max_a, i);

  sort(b.begin() + 1, b.end(), greater<int64_t>());
  for (int i = 1; i <= n; ++i) {
    b[i] += b[i - 1];
  }

  int64_t ans = 1001001001001001001ll;
  for (int i = 0; i <= n; ++i) {
    ans = min(ans, i + max(0ll, (h - b[i] + max_a - 1) / max_a);
  }

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: no matching function for call to 'max(long long int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
   23 |     ans = min(ans, i + max(0ll, (h - b[i] + max_a - 1) / max_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:23:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and '__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type' {aka 'long int'})
   23 |     ans = min(ans, i + max(0ll, (h - b[i] + max_a - 1) / max_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:23:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   23 |     ans = min(ans, i + max(0ll, (h - b[i] + max_a - 1) / max_a);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

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

  vector<int64_t> a(n), b(n + 1);
  for (int i = 0; i < n; ++i) {
    cin >> a[i] >> b[i + 1];
  }

  int64_t max_a = 0;
  for (auto &i : a) max_a = max(max_a, i);

  sort(b.begin() + 1, b.end(), greater<int64_t>());
  for (int i = 1; i <= n; ++i) {
    b[i] += b[i - 1];
  }

  int64_t ans = 1001001001001001001ll;
  for (int i = 0; i <= n; ++i) {
    ans = min(ans, i + max(0, (h - b[i] + max_a - 1) / max_a);
  }

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
   23 |     ans = min(ans, i + max(0, (h - b[i] + max_a - 1) / max_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:23:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type' {aka 'long int'})
   23 |     ans = min(ans, i + max(0, (h - b[i] + max_a - 1) / max_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:23:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   23 |     ans = min(ans, i + max(0, (h - b[i] + max_a - 1) / max_a);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {

    long long N,H;
    vector<long long> a,b;
    cin >> N >> H;
    int buf_a,buf_b;
    for(int i = 0 ; i < N ; i+=1){
        cin >> buf_a >> buf_b;
        a.push_back(buf_a);
        b.push_back(buf_b);
    }

    long long a_max = *std::max_element(a.begin(), a.end());
    sort(b.begin() , b.end() , greater<long long>());

    long long attack_count = 0;
    for (size_t bi = 0; bi < b.size(); bi+=1) {

        if(b[bi] < a_max) break;
        H -= b[bi];
        attack_count +=1;
        if(H <= 0) {
            cout << attack_count << endl;
            return 0;
        }
    }

    attack_count += (H + a_max -1)/a_max;
    cout << attack_count << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:29: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'?
   18 |     long long a_max = *std::max_element(a.begin(), a.end());
      |                             ^~~~~~~~~~~
      |                             tuple_element
a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |     sort(b.begin() , b.end() , greater<long long>());
      |     ^~~~
      |     short
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;
	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);
	}
	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;
			
		}
	}
}

Compiler output:
a.cc:2:1: error: extended character   is not valid in an identifier
    2 |  
      | ^
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |  
      | ^
a.cc:9:1: error: extended character   is not valid in an identifier
    9 |  
      | ^
a.cc:13:1: error: extended character   is not valid in an identifier
   13 |  
      | ^
a.cc:2:1: error: '\U000000a0' does not name a type
    2 |  
      | ^
a.cc:4:1: error: '\U000000a0' does not name a type
    4 |  
      | ^
a.cc:8:2: error: 'a' does not name a type
    8 | }a[1000000];
      |  ^
a.cc:9:1: error: '\U000000a0' does not name a type
    9 |  
      | ^
a.cc:13:1: error: '\U000000a0' does not name a type
   13 |  
      | ^
Language: C++

#include <iostream>

using namespace std;

typedef long long ll;

int B[100001] = {};

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

    int maxA = 0;
    for (int i = 0; i < N; ++i)
    {
        int a, b;
        cin >> a >> b;
        maxA = max(a, maxA);
        B[i] = b;
    }

    sort(B, B+N, greater<int>());

    int ans = 0;
    for (int i = 0; i < N; ++i)
    {
        if (B[i] < maxA) break;
        H -= B[i];
        ++ans;

        if (H <= 0)
        {
            cout << ans << endl;
            return 0;
        }
    }
    ans += H / maxA;
    if (H % maxA != 0) ++ans;
    cout << ans << endl;


    return 0;
}

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

#include <stdio.h>
#include <stdlib.h>
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)

void yes_or_no(char boolean){
    if(boolean){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
}

int comp(const void *a, const void *b){
    return *(long long*)b - *(long long *)a > 0? 1 : -1;
}

int main(){
    long long N, H;
    long long i;
    scanf("%lld %lld", &N, &H);

    long long use[N], throw[N];
    long long max = 0;
    printf("hp:%lld\n", H);
    for(i = 0; i < N; ++i){
        scanf("%lld %lld", &use[i], &throw[i]);

        if(max < use[i]){
            max = use[i];
        }
    }

    qsort(throw, N, sizeof(long long), comp);

    long long count = 0;
    for(i = 0; i < N; ++i){
        if(throw[i] < max){
            break;
        }
        H -= throw[i];
        count++;
        printf("hp:%lld\n", H);
    }
    printf("%lld\n", count);
    if(max > 1){
        count += H/max;

        if(H % max > 0){
            count++;
        }
    }else if(max == 1){
        count += H;
    }
    printf("%lld\n", count);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: expected unqualified-id before 'throw'
   23 |     long long use[N], throw[N];
      |                       ^~~~~
a.cc:27:38: error: expected primary-expression before 'throw'
   27 |         scanf("%lld %lld", &use[i], &throw[i]);
      |                                      ^~~~~
a.cc:34:11: error: invalid use of void expression
   34 |     qsort(throw, N, sizeof(long long), comp);
      |           ^~~~~
a.cc:38:23: error: 'max' is not a type
   38 |         if(throw[i] < max){
      |                       ^~~
a.cc:38:26: error: expected '>' before ')' token
   38 |         if(throw[i] < max){
      |                          ^
a.cc: In lambda function:
a.cc:38:26: error: expected '{' before ')' token
a.cc: In function 'int main()':
a.cc:38:12: error: could not convert '<throw-expression>' from 'void' to 'bool'
   38 |         if(throw[i] < max){
      |            ^~~~~~~~~~~~~~
      |            |
      |            void
a.cc: In lambda function:
a.cc:41:22: error: expected '{' before ';' token
   41 |         H -= throw[i];
      |                      ^
a.cc: In function 'int main()':
a.cc:41:14: error: void value not ignored as it ought to be
   41 |         H -= throw[i];
      |              ^~~~~~~~
Language: C++

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

struct Weapon {
  long long no, a, b;

  // 演算子オーバーロードで比較関数を定義
  bool operator<(const Weapon& another) const {
    if (b != another.b)
      return b > another.b; // 高い順に並べたいので演算子を逆に
    if (a != another.a)
      return a > another.a; // 同様に比較演算子を反転
    return no < another.no;
  }
};

long long N, H, K;

int main() {
  cin >> N >> H;
  
  vector<Weapon> vec(N);
  for (int i = 0; i < N; i++){
      vec[i].no=i;
      cin >> vec[i].a >> vec[i].b;
  }

//  sort(vec.begin(), vec.end()); // operator< を使ってソートされる
  
  
  // 一番大きい a のweaponを見つける。
  long long MAX_a=0;
  long long MAX_a_no=0;
  for (int i = 0; i <= N; i++){
      if (vec[i].a > MAX_a){
          MAX_a=vec[i]a;
          MAX_a_no=i;
      }
  }
  // 一番大きい a のweapon の a よりも大きいbを持つ前出のweapon以外のweaponをつかってHが0になるまで減らす
  for (int i = 0; i < N; i++){
      if (vec[i].b > vec[MAX_a_no].a){
          H=H-vec[i].b;
          K++;
          
          
          if (H<=0){
              break;
          }
      }
  }
  // 前出のweaponをつかってHが0になるまで減らす
  while (true){
      if (H<=0){
          break;
      }
      H=H-vec[MAX_a_no].a;
      K++;
  }
  cout<<K<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:22: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<Weapon>, Weapon>::value_type' {aka 'Weapon'} to 'long long int' in assignment
   38 |           MAX_a=vec[i]a;
      |                      ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
int a[10004];
int b[10005];
using namespace std;
int main(){
  int n,y,mx=0,ans=0;
  cin>>n>>y;
  for (int i=0;i<n;i++)
  cin>>a[i]>>b[i];
  sort (a,a+n);
  mx=a[n-1];
  for (int j=0;j<n;j++)
  if (y <= 0){
  cout<<ans;
  system ("pause");
  return 0;
  }
  if (b[j] >= mx){
  y -= b[j];
  ans++;
  }
  if (y > 0)
  ans += (y + mx - 1) / mx;
  cout<<ans;
  system ("pause");
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'j' was not declared in this scope
   31 |   if (b[j] >= mx){
      |         ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
int a[10004];
int b[10005];
using namespace std;
int main(){
  int n,y,,mx=0,ans=0;
  cin>>n>>y;
  for (int i=0;i<n;i++)
  cin>>a[i]>>b[i];
  sort (a,a+n);
  mx=a[0];
  for (int j=0;j<n;j++)
  if ((b[j] >= mx) and (y > 0)){
  y -= b[j];
  ans++;
  }
  if (y > 0)
  ans += (y + mx - 1) / mx;
  cout<<ans;
  system ("pause");
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: expected unqualified-id before ',' token
   19 |   int n,y,,mx=0,ans=0;
      |           ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
int a[10004];
int b[10005];
int n,y,mx,ans;
using namespace std;
int main(){
  cin>>n>>y;
  for (int i=0;i<n;i++)
  cin>>a[i]>>b[i];
  sort (a,a+n,greater<int>());
  mx=[0];
  sort (b,b+n,greater<int>());
  for (int j=0;j<n;j++)
  if ((b[j] > ms) and (y > 0)){
  y -= b[j];
  ans++;
  }
  if (y > 0)
  ans += (y + mx - 1) / mx;
  cout<<ans;
  system ("pause");
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: expected identifier before numeric constant
   24 |   mx=[0];
      |       ^
a.cc: In lambda function:
a.cc:24:9: error: expected '{' before ';' token
   24 |   mx=[0];
      |         ^
a.cc: In function 'int main()':
a.cc:24:6: error: invalid user-defined conversion from 'main()::<lambda()>' to 'int' [-fpermissive]
   24 |   mx=[0];
      |      ^~~
a.cc:24:6: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
   24 |   mx=[0];
      |      ^
a.cc:24:6: note:   no known conversion from 'void (*)()' to 'int'
a.cc:27:15: error: 'ms' was not declared in this scope; did you mean 'mx'?
   27 |   if ((b[j] > ms) and (y > 0)){
      |               ^~
      |               mx
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
int a[10004];
int b[10005];
int n,y;
using namespace std;
int main(){
  int num=0,hu=0;
  cin>>n>>y;
  for (int i=0;i<n;i++)
  cin>>a[i]>>b[i];
  sort (a,a+a.size());
  hu=a[0];
  sort (b,b.size());
  for (int  i=0;i<n;i++)
  if ((b[i] > sub) and (y > 0)){
  y -= b[i];
  num++;
  }
  if (y > 0) 
  num += (y + sub - 1) / sub;
  cout<<num;
  system ("pause");
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: request for member 'size' in 'a', which is of non-class type 'int [10004]'
   24 |   sort (a,a+a.size());
      |               ^~~~
a.cc:26:13: error: request for member 'size' in 'b', which is of non-class type 'int [10005]'
   26 |   sort (b,b.size());
      |             ^~~~
a.cc:28:15: error: 'sub' was not declared in this scope; did you mean 'fsub'?
   28 |   if ((b[i] > sub) and (y > 0)){
      |               ^~~
      |               fsub
a.cc:33:15: error: 'sub' was not declared in this scope; did you mean 'fsub'?
   33 |   num += (y + sub - 1) / sub;
      |               ^~~
      |               fsub
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
int a[10004];
int b[10005];
int n,y;
using namespace std;
int main(){
  int num=0;
  cin>>n>>y;
  for (int i=0;i<n;i++)
  cin>>a[i]>>b[i];
  sort (a,a+n);
  int sub=a[0];
  sort (b,b+n);
  for (int  i=0;i<n;i++)
  if ((b[i] > sub) and (y > 0)){
  y -= b[i];
  num++;
  }
  if (y > 0) 
  num += (h + sub - 1) / sub;
  cout<<num;
  system ("pause");
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:33:11: error: 'h' was not declared in this scope
   33 |   num += (h + sub - 1) / sub;
      |           ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
int a[10004];
int b[10005];
int n,y;
using namespace std;
int main(){
  int num=0;
  cin>>n>>y;
  for (int i=0;i<n;i++)
  cin>>a[i]>>b[i];
  sort (a,a+n);
  int sub=a[0];
  sort (b,b+n);
  for (int  i=0;i<n;i++)
  if ((b[i] > sub) and (y > 0)){
  h -= b[i];
  num++;
  }
  if (y > 0) 
  num += (h + sub - 1) / sub;
  cout<<num;
  system ("pause");
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:29:3: error: 'h' was not declared in this scope
   29 |   h -= b[i];
      |   ^
a.cc:33:11: error: 'h' was not declared in this scope
   33 |   num += (h + sub - 1) / sub;
      |           ^
Language: C++

#include <iostream>
using namespace std;

typedef long long ll;
const int MAX_N = 10000;
ll b[MAX_N];

int main() {
  int n;
  ll h;
  cin >> n >> h;
  ll max_a = 0;
  ll ans = 0;
  for (int i = 0; i < n; i++) {
    ll ai, bi;
    cin >> ai >> bi;
    b[i] = bi;
    max_a = max(max_a, ai);
  }
  sort(b, b+n);
  for (int i = n-1; i >= 0; i--) {
    if (b[i] >= max_a) {
      h -= b[i];
      ans++;
      if (h <= 0) break;
    }
  }
  if (h > 0) {
    if (h % max_a == 0) {
      ans += h / max_a;
    }
    else {
      ans += h / max_a + 1;
    }
  }
  cout << ans << endl;
}

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

#include <iostream>
#include <algorithm>
using namespace std;
int a[100005];
int b[100005];
int main()
{
    int n,h;
    while(cin>>n>>h){
        int sum=0;
        for(int i=0;i<n;i++){
            cin>>a[i]>>b[i];
            sum+=b[i];
        }
        int s=0;
        else if(sum<=h){
            int maxn=a[0];
            int num=0;
            for(int i=0;i<n;i++){
                if(a[i]>maxn){
                    maxn=a[i];
                    num=i;
                }
            }
            for(int i=0;i<n;i++){
                if(b[i]>=maxn){
                    h-=b[i];
                    s++;
                }
            }
            if(h%maxn==0) s+=h/maxn;
            else s+=h/maxn+1;
        }
        else{
            sort(b,b+n);
            sum=0;
            for(int i=n-1;i>=0;i--){
                h-=b[i];
                s++;
                if(h<=0) break;
            }
        }
        cout<<s<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'else' without a previous 'if'
   16 |         else if(sum<=h){
      |         ^~~~
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <sstream>
#include <stack>
#include <time.h>
#include <vector>
#include <complex>
int a[10004];
int b[10005];
using namespace std;
int main(){
  int n,y,lon=0,gob=0;
  cin>>n>>y;
  for (int i=1;i<=n;i++)
  cin>>a[i]>>b[i];
  sort (a,a+n);
  for (int j=1;j<=n;j++)
  if (b[j] < a[n]){
  b[j]=0;
  lon++;
  }
  sort (b,b+n);
  for (int q=n;q>lon;q--){
  gob += b[q];
  if (gob >= y){
  cout<<n-q+1;
  system ("pause");
  return 0;
  }
  }
  cout<<n - lon + (y - gob + a[n] - 1) / a[];
  system ("pause");
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:38:44: error: expected primary-expression before ']' token
   38 |   cout<<n - lon + (y - gob + a[n] - 1) / a[];
      |                                            ^
Language: C++

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

int desc(const void *a, const void *b) {
  return *(int *)b - *(int *)a;
}

int main(){
    int n,h,a[100001],b[100001];
    a[0]=0;
    b[0]=0;
    //n=100;
    int pri,count;
    scanf("%d%d",&n,&h);
    for(int i=1;i<=n;i++){
        //a[i]=rand();
        scanf("%d%d",&a[i-1],&b[i-1]);
    }
    qsort(a,n,sizeof(int),desc);
    b[n]=a[0];
    qsort(b,n+1,sizeof(int),desc);
    
    if(a[0]>=b[0]){
        if(!(h%a[0])){
            count=h/a[0];
        }else{
            count=h/a[0]+1;
        }
        printf("%d",count);//
        return 0;
    }
    
    for(int i=0;i<=n;i++){
        if(a[0]==b[i]){
            pri=i;
            break;
        }
    }
    int sum=0;
    int j;
    count=0;
    for(int i=0;-1<i;i++){
        
        sum=0;
        for(j=0;j<pri;j++){
            sum+=b[j];
            if(h<=sum){
                count+=j+1;
                break;
            }
        }
        
        else{
            count++;
            h-=a[0];
            if(h<=0)break;
        }
    }
    
    
    printf("%d",count);

    return 0;
}

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

#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int n;
ll h;
ll a[100001],b[100001];

bool C(ll v){
	if(a[n-1]*v>=h)return true;
	ll sum=a[n-1]*v;
	for(int i=0;i<min(n,v);i++){
		sum-=a[n-1];
		sum+=b[n-1-i];
		if(sum>=h)return true;
	}
	return false;
}

int main(void){
	scanf("%d%lld",&n,&h);
	for(int i=0;i<n;i++){
		scanf("%lld %lld",&a[i],&b[i]);
	}
	sort(a,a+n);
	sort(b,b+n);
	ll l=-1,r=h;
	while(l+1<r){
		ll mid=(l+r)/2LL;
		if(C(mid))r=mid;
		else l=mid;
	}
	printf("%lld\n",r);
	return 0;
}

Compiler output:
a.cc: In function 'bool C(ll)':
a.cc:14:26: error: no matching function for call to 'min(int&, ll&)'
   14 |         for(int i=0;i<min(n,v);i++){
      |                       ~~~^~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:14:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   14 |         for(int i=0;i<min(n,v);i++){
      |                       ~~~^~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:14:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   14 |         for(int i=0;i<min(n,v);i++){
      |                       ~~~^~~~~
Language: C

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

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

    int n, h, a_max;
    vector<int> b_list;

    cin >> n >> h;

    int i, a, b;

    while (i < n && cin >> a >> b)
    {
        if (a > a_max)
        {
            a_max = a;
        }
        b_list.push_back(b);
        ++i;
    }

    int cnt;
    sort(b_list.begin(), b_list.end());
    for (auto j = b_list.begin(); j != b_list.end(); ++j)
    {
        if (*j > a_max)
        {
            h -= *j;
            ++cnt;
        }

        if (h < 0)
        {
            cout << cnt << endl;
            return 0;
        }
    }

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

    cout << cnt << endl;

    return 0;
}


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

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
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();

		
		List<Integer> a = new ArrayList<>(n);
		List<Integer> b = new ArrayList<>(n);
		for (int i = 0 ; i < n; i++) {
		  int sin1 = sc.nextInt();
		  int sin2 = sc.nextInt();
		  a.add(sin1);
		  b.add(sin2);
		}
		sc.close();
		
	
		//計算部分

		int count = 0;
		
		Collections.sort(a,Comparator.reverseOrder());
		Collections.sort(b,Comparator.reverseOrder());
		int a1 = a.get(0);
		roop:
		for (int i=0; i<n; i++) {
			if (b.get(i) > a1){
				h -= b.get(i);
				count++;
				if (h <= 0) {
					break roop;
				}
				if (i == n-1) {
					if (h%a1 == 0) {
						count += h/a1;
						break roop;
					} else {
						count += h/a1 + 1;
						break roop;
					}
					
				}
				
			} else {
				if (h%a1 == 0) {
					count += h/a1;
					break roop;
				} else {
					count += h/a1 + 1;
					break roop;
				}
			}
			
		}
		
		mes(count);
	}

		//回答を表示するメソッド
		public static void mes(int count) {
		    System.out.println(count);
		}
		

Compiler output:
Main.java:73: error: reached end of file while parsing
		}
		 ^
1 error
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#include <algorithm>
#include <utility>
using namespace std;

int N, H, A[100000], B[100000];


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

	//全部投げれば倒せる→全部投げる
	int damage = 0;
	for(int i = 0; i<N; i++){
		damage += B[i];
		if (damage >= H){ cout << i+1 << endl; return 0;}
	}
	
	//全部投げても倒せない→A[i]が最大のものを振る,それ以外は投げる
	
	//	A[i]の最大値を求める
	int max_a = 0;
	for(int i = 0; i<N; i++){ 
		if (A[i] > max_a){ max_a = A[i]; }
	}
	
	//全部投げた分を求める
	for(int i = 0; i<N; i++){ 
		H -= B[i];
	}
	
	if(H & max_a > 0){ int kiriage = 1;} else {kiriage = 0;}
	//振る回数(H/max_aを切り上げ)+投げた回数(N)が答え
	cout << H / max_a + kiriage  + N << endl;
	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:52: error: 'kiriage' was not declared in this scope
   38 |         if(H & max_a > 0){ int kiriage = 1;} else {kiriage = 0;}
      |                                                    ^~~~~~~
a.cc:40:29: error: 'kiriage' was not declared in this scope
   40 |         cout << H / max_a + kiriage  + N << endl;
      |                             ^~~~~~~
Language: Java

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

public class Katana {
	private int atk1;
	private int atk2;
	private boolean nageta;

	Katana(int atk1, int atk2) {
		this.atk1 = atk1;
		this.atk2 = atk2;
	}

	public int getAtk(boolean a) {
		if (a==false) {
			return this.atk1;
		} else {
			return this.atk2;
		}
	}

	public boolean getNageta() {
		return this.nageta;
	}
}

public class Hoge {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String str = scan.next();
		int n = Integer.parseInt(str);
		str = scan.next();
		int h = Integer.parseInt(str);
		int[] a = new int[n];
		int[] b = new int[n];
		for (int i = 0; i < n; i++) {
			str = scan.next();
			a[i] = Integer.parseInt(str);
			str = scan.next();
			b[i] = Integer.parseInt(str);
		}
		ArrayList<Katana> katana = new ArrayList<>();
		katanaSet(katana, a, b);
		int answer = 0;
		if (n==1) {
			if (b[0] > a[0]) {
				h=h-b[0];
				for (answer = 1; ; answer++) {
					if (h<=0) {
						break;
					}
					h=h-a[0];
				}
				
			} else {
				for (answer = 0; ; answer++) {
					if (h<=0) {
						break;
					}
					h=h-a[0];
				}
			}
		} else if (katana.get(max(katana, false)).getAtk(false)>=katana.get(max(katana, true)).getAtk(true)) {
			for (answer = 1; ; answer++) {
				if (h<=0) {
					break;
				}
				h=h-a[max(katana, false)];
			}
		} else {
			int atk = max(katana, false);
			katana.remove(atk);
			while (a[atk]<katana.get(max(katana, true)).getAtk(true) ) {
				if (a[atk]>=h || b[atk]>=h) {
					break;
				}
				h=h-katana.get(max(katana, true)).getAtk(true);
				katana.remove(katana.get(max(katana, true)));
				answer=answer+1;
				if (katana.size()==0) {
					break;
				}
			}
			if (a[atk]>=b[atk]) {
				for (answer = answer; ; answer++) {
					if (h<=0) {
						break;
					}
					h=h-a[atk];
				}
			} else {
				h=h-b[atk];
				for (answer = answer+1; ; answer++) {
					if (h<=0) {
						break;
					}
					h=h-a[atk];
				}
			}
		}

		System.out.println(answer);
	}

	public static void katanaSet(ArrayList<Katana> katana, int[] a, int[] b) {
		for (int i = 0; i < a.length; i++) {
			katana.add(new Katana(a[i], b[i]));
		}
	}

	public static int max(ArrayList<Katana> katana, boolean a) {
		int max = 0;

		for (int i = 1; i < katana.size(); i++) {
			if (katana.get(i).getAtk(a) > katana.get(max).getAtk(a)) {
				max = i;
			}
		}

		return max;
	}
}

Compiler output:
Main.java:4: error: class Katana is public, should be declared in a file named Katana.java
public class Katana {
       ^
Main.java:27: error: class Hoge is public, should be declared in a file named Hoge.java
public class Hoge {
       ^
2 errors