Language: C++

// ------------------------------------
// Date:2018/ 3/24
// Problem:Katana Thrower _ re_d.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

static const int MOD = 1e9 + 7;
static const int MAX_N = 1;

int main()
{
  LCIN(N, H);
  vector< pair< int, int > > d(N);
  ll aMax = 0;
  REP(i, N) {
    scanf("%d %d", &d[i].first, &d[i].second);
    aMax = max(aMax, d[i].first);
  }

  sort(ALL(d), [](pair< int, int > x, pair< int, int > y) {
      return x.second > y.second;
  });

  ll ans = 0;
  ll sum = 0ll;
  REP(i, 10) {
    if (sum >= H) break;
    if (d[i].second > aMax) {
      sum += d[i].second;
      ans++;
    } else {
      ans += (H - sum) / aMax + ((H - sum) % aMax == 0?0:1);
      break;
    }
    //  debug(sum);
    // debug(ans);
  }

  cout << ans << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:40:15: error: no matching function for call to 'max(ll&, int&)'
   40 |     aMax = max(aMax, d[i].first);
      |            ~~~^~~~~~~~~~~~~~~~~~
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:7:
/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:40:15: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   40 |     aMax = max(aMax, d[i].first);
      |            ~~~^~~~~~~~~~~~~~~~~~
/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:40:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   40 |     aMax = max(aMax, d[i].first);
      |            ~~~^~~~~~~~~~~~~~~~~~