Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll,ll> P;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin() , v.end()
#define inputv(v,n) rep(i,n){\
    ll x;\
    cin>>x;\
    v.push_back(x);\
    }
const ll INF=99999999999999;
const ll MOD=1000000007;
ll c,d,e,f,p,t,ans=0;


ll n,m;
vector<P> gragh[3000];
vl A,B,C;
vl cost(3000,INF);

void input(void){
    cin>>n>>m>>p;
    rep(i,m){
        cin>>c>>d>>e;
        gragh[c].push_back(make_pair(d,p-e));
    }
}

ll solve(void){
    cost[1]=0;
    vl renewed(3000,0);
    rep(k,n-1){
    for(ll i=1;i<n+1;i++){
        rep(j,gragh[i].size()){
            cost[gragh[i][j].first]=min(cost[i]+gragh[i][j].second,cost[gragh[i][j].first]);
        }
    }
    }

    rep(k,n-1){
    for(ll i=1;i<n+1;i++){
        rep(j,gragh[i].size()){
            if(cost[i]+gragh[i][j].second<cost[gragh[i][j].first]){
                cost[gragh[i][j].first]=cost[i]+gragh[i][j].second;
                if(cost[i]<INF/2)renewed[gragh[i][j].first]=1;
            }
            if(renewed[i]==1)renewed[gragh[i][j].first]=1;
        }
    }
    }

    if(renewed[n]==1)return -1;
    return min(-cost[n],0);
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    input();
    cout<<solve()<<endl;
}

Compiler output:
a.cc: In function 'll solve()':
a.cc:55:15: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type, int)'
   55 |     return min(-cost[n],0);
      |            ~~~^~~~~~~~~~~~
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:55:15: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   55 |     return min(-cost[n],0);
      |            ~~~^~~~~~~~~~~~
/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:55:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   55 |     return min(-cost[n],0);
      |            ~~~^~~~~~~~~~~~