Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
using ll=long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;


//頂点fromから頂点toへのcost
struct edge{ll from,to,cost;};

vector<ll>d;//最短距離
vector<int>to[2505],rto[2505];

void dfs(int v){
    if()
}

ll bellman_ford(vector<edge> &es,int V,int s){//es:頂点,costという要素からなる、辺についての配列、V:頂点数,s:スタート地点
    d.resize(V+1,INF);
    ll ans=0,sum=0;
    d[s]=0;
    for(int i=0;i<V-1;i++){
    //それぞれの頂点につき1回ずつしか通らないため、V-1回しかループは実行されない(V回目があるときは負の辺を含む)
        for(auto &e:es){//esの変更が反映される
            if(d[e.from]==INF)continue;
            d[e.to]=min(d[e.to],d[e.from]+e.cost);
            ans=d[e.to];
        }
        sum+=ans;
    }
    return sum;
}

int main(){
    ll n,m,p;
    cin>>n>>m>>p;
    vector<edge>es;
    rep(i,m){
        ll a,b,c;
        cin>>a>>b>>c;
        a--;b--;
        es.emplace_back(a,b,-(c-p));
        to[a].pb(b);rto[b].pb(a);
    }
    dfs(0);
    return 0;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:33:8: error: expected primary-expression before ')' token
   33 |     if()
      |        ^
a.cc:34:1: error: expected primary-expression before '}' token
   34 | }
      | ^
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
                 from /usr/include/c++/14/bits/allocator.h:46,
                 from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/new_allocator.h: In instantiation of 'void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = edge; _Args = {long long int&, long long int&, long long int}; _Tp = edge]':
/usr/include/c++/14/bits/alloc_traits.h:575:17:   required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = edge; _Args = {long long int&, long long int&, long long int}; _Tp = edge; allocator_type = std::allocator<edge>]'
  575 |           __a.construct(__p, std::forward<_Args>(__args)...);
      |           ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:117:30:   required from 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {long long int&, long long int&, long long int}; _Tp = edge; _Alloc = std::allocator<edge>; reference = edge&]'
  117 |             _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
      |             ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  118 |                                      std::forward<_Args>(__args)...);
      |                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:60:24:   required from here
   60 |         es.emplace_back(a,b,-(c-p));
      |         ~~~~~~~~~~~~~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/new_allocator.h:191:11: error: new initializer expression list treated as compound expression [-fpermissive]
  191 |         { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/new_allocator.h:191:11: error: no matching function for call to 'edge::edge(long long int)'
a.cc:27:8: note: candidate: 'edge::edge()'
   27 | struct edge{ll from,to,cost;};
      |        ^~~~
a.cc:27:8: note:   candidate expects 0 arguments, 1 provided
a.cc:27:8: note: candidate: 'constexpr edge::edge(const edge&)'
a.cc:27:8: note:   no known conversion for argument 1 from 'long long int' to 'const edge&'
a.cc:27:8: note: candidate: 'constexpr edge::edge(edge&&)'
a.cc:27:8: note:   no known conversion for argument 1 from 'long long int' to 'edge&&'