Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
using P = pair<int,int>;
using pll = pair<ll,ll>;
// Binary Indexed Tree (Fenwick Tree)
// https://youtu.be/lyHk98daDJo?t=7960
template<typename T>
struct BIT {
int n;
vector<T> d;
BIT(int n=0):n(n),d(n+1) {}
void add(int i, T x=1) {
    for (i++; i <= n; i += i&-i) {
    d[i] += x;
    }
}
T sum(int i) { //[0,i]のsum
    T x = 0;
    for (i++; i; i -= i&-i) {
    x += d[i];
    }
    return x;
}
T sum(int l, int r) { // [l,r)のsum
    return sum(r-1) - sum(l-1);
}
};

int main()
{
    int n,d,a;
    cin >> n >> d >>a;
    vector<pll> p(n);
    rep(i,n)cin >> p[i].first >> p[i].second;
    BIT<ll> bit(n+5);
    sort(p.begin(),p.end());
    ll ans = 0;
    rep(i,n){
        ll x = p[i].first;
        ll h = p[i].second;
        int tot = bit.sum(i);
        h -= tot;
        if(h> 0){
            int num = (h+a-1)/a;
            ans += num;
            ll damage = num*a;
            bit.add(i,damage);
            ll hashi = min(x + 2*d+1,10010010010101);
            int  ni = upper_bound(p.begin(),p.end(),pll(hashi,999))-p.begin();
            bit.add(ni,-damage);
        }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:50:27: error: no matching function for call to 'min(ll, long int)'
   50 |             ll hashi = min(x + 2*d+1,10010010010101);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
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:50:27: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long int')
   50 |             ll hashi = min(x + 2*d+1,10010010010101);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/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:50:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   50 |             ll hashi = min(x + 2*d+1,10010010010101);
      |                        ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~