Language: C++

struct EDGE
{
    int v,cap,next;
}e[EM];

int head[VM],cnt=0;
int dis[VM],vn[VM];
int source,sink,NV;

void add(int u,int v,int c)
{
    e[cnt].v=v;e[cnt].cap=c;e[cnt].next=head[u];head[u]=cnt++;
    e[cnt].v=u;e[cnt].cap=c;e[cnt].next=head[v];head[v]=cnt++;
}

void init()
{
    memset(head,-1,sizeof(head));
    cnt=0;
}

int dfs(int cur,int cost)
{
    if(cur==sink)   return cost;
    int leave=cost,Mind=NV,v;
    for(int i=head[cur];i!=-1;i=e[i].next)
    {
        if(e[i].cap>0)
        {
            if(dis[v=e[i].v]+1==dis[cur])
            {
                int flow=dfs(v,min(leave,e[i].cap));
                leave-=flow;
                e[i].cap-=flow;
                e[i^1].cap+=flow;
                if(dis[source]>=NV) return cost-leave;
                if(leave==0)    break;
            }
            if(dis[v]<Mind)
                Mind=dis[v];
        }
    }
    if(cost==leave)
    {
        if((--vn[dis[cur]])==0)dis[source]=NV;
        dis[cur]=Mind+1;
        vn[dis[cur]]++;
    }
    return cost-leave;
}

int Sap()
{
    int flag=0,f;
    memset(dis,0,sizeof(dis));
    memset(vn,0,sizeof(vn));
    vn[0]=NV;
    while(di[source]<NV)
    {
        flow+=dfs(source,Inf);
    }
    return flow;
}

Compiler output:
a.cc:4:4: error: 'EM' was not declared in this scope
    4 | }e[EM];
      |    ^~
a.cc:6:10: error: 'VM' was not declared in this scope
    6 | int head[VM],cnt=0;
      |          ^~
a.cc:7:9: error: 'VM' was not declared in this scope
    7 | int dis[VM],vn[VM];
      |         ^~
a.cc:7:16: error: 'VM' was not declared in this scope
    7 | int dis[VM],vn[VM];
      |                ^~
a.cc: In function 'void add(int, int, int)':
a.cc:12:5: error: 'e' was not declared in this scope
   12 |     e[cnt].v=v;e[cnt].cap=c;e[cnt].next=head[u];head[u]=cnt++;
      |     ^
a.cc:12:41: error: 'head' was not declared in this scope
   12 |     e[cnt].v=v;e[cnt].cap=c;e[cnt].next=head[u];head[u]=cnt++;
      |                                         ^~~~
a.cc: In function 'void init()':
a.cc:18:12: error: 'head' was not declared in this scope
   18 |     memset(head,-1,sizeof(head));
      |            ^~~~
a.cc:18:5: error: 'memset' was not declared in this scope
   18 |     memset(head,-1,sizeof(head));
      |     ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | struct EDGE
a.cc: In function 'int dfs(int, int)':
a.cc:26:15: error: 'head' was not declared in this scope
   26 |     for(int i=head[cur];i!=-1;i=e[i].next)
      |               ^~~~
a.cc:26:33: error: 'e' was not declared in this scope
   26 |     for(int i=head[cur];i!=-1;i=e[i].next)
      |                                 ^
a.cc:30:16: error: 'dis' was not declared in this scope; did you mean 'dfs'?
   30 |             if(dis[v=e[i].v]+1==dis[cur])
      |                ^~~
      |                dfs
a.cc:32:32: error: 'min' was not declared in this scope
   32 |                 int flow=dfs(v,min(leave,e[i].cap));
      |                                ^~~
a.cc:39:16: error: 'dis' was not declared in this scope; did you mean 'dfs'?
   39 |             if(dis[v]<Mind)
      |                ^~~
      |                dfs
a.cc:45:15: error: 'vn' was not declared in this scope; did you mean 'v'?
   45 |         if((--vn[dis[cur]])==0)dis[source]=NV;
      |               ^~
      |               v
a.cc:45:18: error: 'dis' was not declared in this scope; did you mean 'dfs'?
   45 |         if((--vn[dis[cur]])==0)dis[source]=NV;
      |                  ^~~
      |                  dfs
a.cc:46:9: error: 'dis' was not declared in this scope; did you mean 'dfs'?
   46 |         dis[cur]=Mind+1;
      |         ^~~
      |         dfs
a.cc:47:9: error: 'vn' was not declared in this scope; did you mean 'v'?
   47 |         vn[dis[cur]]++;
      |         ^~
      |         v
a.cc: In function 'int Sap()':
a.cc:55:12: error: 'dis' was not declared in this scope; did you mean 'dfs'?
   55 |     memset(dis,0,sizeof(dis));
      |            ^~~
      |            dfs
a.cc:55:5: error: 'memset' was not declared in this scope
   55 |     memset(dis,0,sizeof(dis));
      |     ^~~~~~
a.cc:55:5: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:56:12: error: 'vn' was not declared in this scope
   56 |     memset(vn,0,sizeof(vn));
      |            ^~
a.cc:58:11: error: 'di' was not declared in this scope
   58 |     while(di[source]<NV)
      |           ^~
a.cc:60:9: error: 'flow' was not declared in this scope
   60 |         flow+=dfs(source,Inf);
      |         ^~~~
a.cc:60:26: error: 'Inf' was not declared in this scope
   60 |         flow+=dfs(source,Inf);
      |                          ^~~
a.cc:62:12: error: 'flow' was not declared in this scope
   62 |     return flow;
      |            ^~~~