Language: C++

#include<bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int> >
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
using ll = long long;
using ld =long double;
#define int ll
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
int dx[]={0,0,1,-1};
int dy[]={1,-1,0,0};
int W,H;
bool inrange(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
using namespace std;
typedef pair<int, int> pii;
typedef pair<int,pii> piii;
#define MP make_pair
using Flow = int;
using Cost = int;
struct Edge{
    int s,to,rev,cost,source,sink;
    Flow cap;
    
    Edge(int _s, int _to) : s(_s) , to(_to) {;}
    Edge(int _s, int _to, int _c) : s(_s), to(_to),cost(_c){;}
    Edge(int _s, int _to, Flow f, int _rev) : s(_s), to(_to), cap(f), rev(_rev){;}
    Edge(int _s, int _to, Flow f, int _rev, int _c) : s(_s), to(_to),cost(_c), cap(f),
    rev(_rev){;}
};
class MCF{    //Minimum Cost Flow
public:
    using pii = pair<int, int>;
    using ve =  vector<Edge>;
    using vve = vector<ve>;
    int n;
    vve G;
    vector<int> h,dist,prev,pree;
    MCF(int size){
        n=size;
        G=vve(n);
        h=dist=prev=pree=vector<int>(n);
    }
    void add_edge(int s,int t,Flow ca,int co){
        Edge e=Edge(t,ca,co,(int)G[t].size());
        G[s].push_back(e);
        Edge ee=Edge(s,0,-co,(int)G[s].size()-1);
        G[t].push_back(ee);
    }
    int mcf(int s,int t,Flow f){
        int out=0;
        h=vector<int>(n);
        while(f>0){
            priority_queue<pii,vector<pii> >q;
            dist=vector<int>(n,INF);
            dist[s]=0;
            q.push(pii(0,s));
            while(!q.empty()){
                pii p=q.top();q.pop();
                int v=p.second;
                if(dist[v]<-p.first)continue;
                for(int i=0;i<G[t].size();i++){
                    Edge &e=G[v][i];
                    if(e.cap>0&&dist[e.to]>dist[v]+e.cost+h[v]-h[e.to]){
                        dist[e.to]=dist[v]+e.cost+h[v]-h[e.to];
                        prev[e.to]=v;
                        pree[e.to]=i;
                        q.push(pii(-dist[e.to],e.to));
                    }
                }
            }
            if(dist[t]==INF)return -1;
            for(int i=0;i<n;i++)h[i]+=dist[i];
            int d=f;
            for(int v=t;v!=s;v=prev[v])d=min(d,G[prev[v]][pree[v]].cap);
            f-=d;
            out+=d*h[t];
            for(int v=t;v!=s;v=prev[v]){
                Edge &e=G[prev[v]][pree[v]];
                e.cap-=d;
                G[v][e.rev].cap+=d;
            }
        }
        return out;
    }
};
signed main(){
    int v,e;
    cin>>v>>e;
    Dinic yebi(v+1);
    rep(i,e){
        int a,b,c;cin>>a>>b>>c;
        yebi.add_edge(a,b,c);
    }
    cout<<yebi.getmaxflow(0, v-1)<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:99:5: error: 'Dinic' was not declared in this scope
   99 |     Dinic yebi(v+1);
      |     ^~~~~
a.cc:102:9: error: 'yebi' was not declared in this scope
  102 |         yebi.add_edge(a,b,c);
      |         ^~~~
a.cc:104:11: error: 'yebi' was not declared in this scope
  104 |     cout<<yebi.getmaxflow(0, v-1)<<endl;
      |           ^~~~