Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define SZ(i) int(i.size())
#ifdef tmd
#define IOS()
#define debug(...) fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);_do(__VA_ARGS__);
template<typename T> void _do(T &&x){cerr<<x<<endl;}
template<typename T, typename ...S> void _do(T &&x, S &&...y){cerr<<x<<", ";_do(y...);}
#else
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define debug(...)
#endif

const int MAXN = 602;
const ll MOD = 1000000007;

struct Edge {
    int des, nxt;
} edge[MAXN*MAXN];
int head[MAXN], ecnt;

int n, m;
float dp[MAXN];
/*********************GoodLuck***********************/
int main () {
    IOS();
    cin >> n >> m;

    memset(head, -1, sizeof(head));
    REP (i, m) {
        int f, t;
        cin >> f >> t;
        edge[ecnt++] = {t, head[f]};
        head[f] = ecnt - 1;
    }

    dp[n] = 0;

    double ans = n + 3;
    REP (ban, m + 1) {
        for (int i=n-1; i>=1; i--) {
            dp[i] = 0;
            int cnt = 0;
            for (int id=head[i]; id!=-1; id=edge[id].nxt) {
                if (id == ban) {
                    continue;
                }
                dp[i] += dp[edge[id].des] + 1;
                cnt++;
            }
            dp[i] /= cnt;
        }
        if (dp[1] != 0) {
            ans = min(ans, dp[1]);
        }
    }

    cout << fixed << setprecision(10) << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:22: error: no matching function for call to 'min(double&, float&)'
   58 |             ans = min(ans, dp[1]);
      |                   ~~~^~~~~~~~~~~~
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:58:22: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'float')
   58 |             ans = min(ans, dp[1]);
      |                   ~~~^~~~~~~~~~~~
/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:58:22: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   58 |             ans = min(ans, dp[1]);
      |                   ~~~^~~~~~~~~~~~