Language: C++

zz#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
struct edge{int to,cap,rev;};//ikisaki youryou gyakuhen
class Dinic{//max flow
public:
    int n;
    vector<vector<edge> >G;//[MAX];
    vi level,iter;//[MAX];
    Dinic(int size){
        n=size;
        G=vector<vector<edge> >(n);
    }
    void add_edge(int from, int to, int cap){
        edge q={to,cap,int(G[to].size())};
        G[from].push_back(q);
    }
    int getmaxflow(int s,int t) {//from s to t,ford_fulkerson
        int flow=0;
        while(1){
            bfs(s);
            if(level[t]<0)return flow;
            iter=vi(n);
            int f;
            while((f=dfs(s,t,INF))>0)flow+=f;
        }
    }
private:
    void bfs(int s){
        level=vi(n,-1);
        queue<int>q;
        level[s]=0;
        q.push(s);
        while(!q.empty()){
            int v=q.front();q.pop();
            for(int i=0;i<G[v].size();i++){
                edge &e=G[v][i];
                if(e.cap>0&&level[e.to]<0){
                    level[e.to]=level[v]+1;
                    q.push(e.to);
                }
            }
        }
    }
    int dfs(int v,int t, int f) {
        if(v==t)return f;
        for(int &i=iter[v];i<G[v].size();i++){
            edge &e=G[v][i];
            if(level[v]>=level[e.to]||e.cap<=0) continue;
            int d =dfs(e.to,t,min(f,e.cap));
            if(d>0){
                e.cap-=d;
                G[e.to][e.rev].cap+=d;
                return d;
            }
        }
        return 0;
    }
};
 
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:1:3: error: stray '#' in program
    1 | zz#include<bits/stdc++.h>
      |   ^
a.cc:1:1: error: 'zz' does not name a type
    1 | zz#include<bits/stdc++.h>
      | ^~
a.cc:11:13: error: 'll' does not name a type; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:20:1: note: in expansion of macro 'int'
   20 | int dx[]={0,0,1,-1};
      | ^~~
a.cc:11:13: error: 'll' does not name a type; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:21:1: note: in expansion of macro 'int'
   21 | int dy[]={1,-1,0,0};
      | ^~~
a.cc:11:13: error: 'll' does not name a type; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:22:1: note: in expansion of macro 'int'
   22 | int W,H;
      | ^~~
a.cc:11:13: error: 'll' was not declared in this scope; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:23:14: note: in expansion of macro 'int'
   23 | bool inrange(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
      |              ^~~
a.cc:11:13: error: 'll' was not declared in this scope; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:23:20: note: in expansion of macro 'int'
   23 | bool inrange(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
      |                    ^~~
a.cc:23:25: error: expression list treated as compound expression in initializer [-fpermissive]
   23 | bool inrange(int x,int y){return (0<=x&&x<W)&&(0<=y&&y<H);}
      |                         ^
a.cc:25:9: error: 'pair' does not name a type
   25 | typedef pair<int, int> pii;
      |         ^~~~
a.cc:26:9: error: 'pair' does not name a type
   26 | typedef pair<int,pii> piii;
      |         ^~~~
a.cc:11:13: error: 'll' does not name a type; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:28:13: note: in expansion of macro 'int'
   28 | struct edge{int to,cap,rev;};//ikisaki youryou gyakuhen
      |             ^~~
a.cc:11:13: error: 'll' does not name a type; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:31:5: note: in expansion of macro 'int'
   31 |     int n;
      |     ^~~
a.cc:32:5: error: 'vector' does not name a type
   32 |     vector<vector<edge> >G;//[MAX];
      |     ^~~~~~
a.cc:2:12: error: 'vector' does not name a type
    2 | #define vi vector<int>
      |            ^~~~~~
a.cc:33:5: note: in expansion of macro 'vi'
   33 |     vi level,iter;//[MAX];
      |     ^~
a.cc:34:15: error: expected ')' before 'size'
   34 |     Dinic(int size){
      |          ~    ^~~~
a.cc:11:13: error: 'll' has not been declared
   11 | #define int ll
      |             ^~
a.cc:38:19: note: in expansion of macro 'int'
   38 |     void add_edge(int from, int to, int cap){
      |                   ^~~
a.cc:11:13: error: 'll' has not been declared
   11 | #define int ll
      |             ^~
a.cc:38:29: note: in expansion of macro 'int'
   38 |     void add_edge(int from, int to, int cap){
      |                             ^~~
a.cc:11:13: error: 'll' has not been declared
   11 | #define int ll
      |             ^~
a.cc:38:37: note: in expansion of macro 'int'
   38 |     void add_edge(int from, int to, int cap){
      |                                     ^~~
a.cc:11:13: error: 'll' does not name a type; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:42:5: note: in expansion of macro 'int'
   42 |     int getmaxflow(int s,int t) {//from s to t,ford_fulkerson
      |     ^~~
a.cc:11:13: error: 'll' has not been declared
   11 | #define int ll
      |             ^~
a.cc:53:14: note: in expansion of macro 'int'
   53 |     void bfs(int s){
      |              ^~~
a.cc:11:13: error: 'll' does not name a type; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:69:5: note: in expansion of macro 'int'
   69 |     int dfs(int v,int t, int f) {
      |     ^~~
a.cc: In member function 'void Dinic::add_edge(int, int, int)':
a.cc:39:28: error: 'G' was not declared in this scope
   39 |         edge q={to,cap,int(G[to].size())};
      |                            ^
a.cc:11:13: error: 'll' was not declared in this scope; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:39:24: note: in expansion of macro 'int'
   39 |         edge q={to,cap,int(G[to].size())};
      |                        ^~~
a.cc:39:41: error: too many initializers for 'edge'
   39 |         edge q={to,cap,int(G[to].size())};
      |                                         ^
a.cc: In member function 'void Dinic::bfs(int)':
a.cc:54:9: error: 'level' was not declared in this scope
   54 |         level=vi(n,-1);
      |         ^~~~~
a.cc:2:12: error: 'vector' was not declared in this scope
    2 | #define vi vector<int>
      |            ^~~~~~
a.cc:54:15: note: in expansion of macro 'vi'
   54 |         level=vi(n,-1);
      |               ^~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | zz#include<bits/stdc++.h>
a.cc:11:13: error: 'll' was not declared in this scope; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:2:19: note: in expansion of macro 'int'
    2 | #define vi vector<int>
      |                   ^~~
a.cc:54:15: note: in expansion of macro 'vi'
   54 |         level=vi(n,-1);
      |               ^~
a.cc:54:18: error: 'n' was not declared in this scope
   54 |         level=vi(n,-1);
      |                  ^
a.cc:55:9: error: 'queue' was not declared in this scope
   55 |         queue<int>q;
      |         ^~~~~
a.cc:1:1: note: 'std::queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
  +++ |+#include <queue>
    1 | zz#include<bits/stdc++.h>
a.cc:55:19: error: 'q' was not declared in this scope
   55 |         queue<int>q;
      |                   ^
a.cc:59:17: error: expected ';' before 'v'
   59 |             int v=q.front();q.pop();
      |                 ^
a.cc:60:21: error: expected ';' before 'i'
   60 |             for(int i=0;i<G[v].size();i++){
      |                     ^
a.cc:60:25: error: 'i' was not declared in this scope
   60 |             for(int i=0;i<G[v].size();i++){
      |                         ^
a.cc:60:27: error: 'G' was not declared in this scope
   60 |             for(int i=0;i<G[v].size();i++){
      |                           ^
a.cc:60:29: error: 'v' was not declared in this scope
   60 |             for(int i=0;i<G[v].size();i++){
      |                             ^
a.cc:62:22: error: 'struct edge' has no member named 'cap'
   62 |                 if(e.cap>0&&level[e.to]<0){
      |                      ^~~
a.cc:62:37: error: 'struct edge' has no member named 'to'
   62 |                 if(e.cap>0&&level[e.to]<0){
      |                                     ^~
a.cc:63:29: error: 'struct edge' has no member named 'to'
   63 |                     level[e.to]=level[v]+1;
      |                             ^~
a.cc:64:30: error: 'struct edge' has no member named 'to'
   64 |                     q.push(e.to);
      |                              ^~
a.cc: In function 'int main()':
a.cc:11:13: error: 'll' was not declared in this scope; did you mean 'ld'?
   11 | #define int ll
      |             ^~
a.cc:86:5: note: in expansion of macro 'int'
   86 |     int v,e;
      |     ^~~
a.cc:87:5: error: 'cin' was not declared in this scope
   87 |     cin>>v>>e;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | zz#include<bits/stdc++.h>
a.cc:87:10: error: 'v' was not declared in this scope; did you mean 'vb'?
   87 |     cin>>v>>e;
      |          ^
      |          vb
a.cc:87:13: error: 'e' was not declared in this scope
   87 |     cin>>v>>e;
      |             ^
a.cc:89:9: error: expected ';' before 'i'
   89 |     rep(i,e){
      |         ^
a.cc:14:26: note: in definition of macro 'rep'
   14 | #define rep(i,n) for(int i=0;i<n;i++)
      |                          ^
a.cc:89:9: error: 'i' was not declared in this scope; did you mean 'vi'?
   89 |     rep(i,e){
      |         ^
a.cc:14:30: note: in definition of macro 'rep'
   14 | #define rep(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:90:13: error: expected ';' before 'a'
   90 |         int a,b,c;cin>>a>>b>>c;
      |             ^
a.cc:90:24: error: 'a' was not declared in this scope
   90 |         int a,b,c;cin>>a>>b>>c;
      |                        ^
a.cc:90:27: error: 'b' was not declared in this scope; did you mean 'vb'?
   90 |         int a,b,c;cin>>a>>b>>c;
      |                           ^
      |                           vb
a.cc:90:30: error: 'c' was not declared in this scope; did you mean 'vc'?
   90 |         int a,b,c;cin>>a>>b>>c;
      |                              ^
      |                              vc
a.cc:93:5: error: 'cout' was not declared in this scope
   93 |     cout<<yebi.getmaxflow(0, v-1)<<endl;
      |     ^~~~
a.cc:93:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:93:16: error: 'class Dinic' has no member named 'getmaxflow'
   93 |     cout<<yebi.getmaxflow(0, v-1)<<endl;
      |                ^~~~~~~~~~
a.cc:93:36: error: 'endl' was not declared in this scope
   93 |     cout<<yebi.getmaxflow(0, v-1)<<endl;
      |                                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | zz#include<bits/stdc++.h>
a.cc:93:41: error: expected '}' at end of input
   93 |     cout<<yebi.getmaxflow(0, v-1)<<endl;
      |                                         ^
a.cc:85:14: note: to match this '{'
   85 | signed main(){
      |              ^