Language: C++

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using vi = vector<int64_t>;
using vvi = vector<vi>;
int64_t INF = 1000000007;

int main() {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    int64_t n,k;
    cin >> n >> k;
    // サイコロで勝つ確率 * コインで勝つ確率
    double dice = 0.0;
    double not_dice = 1.0;
    if(n>k-1){
        dice = (n-k+1.0)/n;
        not_dice = (k-1.0)/n;
    }
    int64_t div = 1;
    double prob = 0;
    // i: サイコロの出目
    for(int64_t i=1; i<=min(k-1,n); i++){
        // i * 2^j が k を超えた最小の j に対して、 2^j で割る
        int64_t div = 1;
        for(int64_t j=1; j<k; j++){
            div *= 2;
            if(i * div>=k) break;
        }
        prob += (1.0/div);
        // cout << prob << endl;
    }
    cout << setprecision(20) << dice + not_dice*prob/min(max(1LL,k-1),n) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:61: error: no matching function for call to 'max(long long int, int64_t)'
   36 |     cout << setprecision(20) << dice + not_dice*prob/min(max(1LL,k-1),n) << endl;
      |                                                          ~~~^~~~~~~~~
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:36:61: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int64_t' {aka 'long int'})
   36 |     cout << setprecision(20) << dice + not_dice*prob/min(max(1LL,k-1),n) << endl;
      |                                                          ~~~^~~~~~~~~
/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:36:61: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   36 |     cout << setprecision(20) << dice + not_dice*prob/min(max(1LL,k-1),n) << endl;
      |                                                          ~~~^~~~~~~~~