离谱

P3376 【模板】网络最大流

sanwei @ 2022-10-27 22:36:50

dinic跑dfs的时候没有修改反边流量过了

发送一些问号问号问号问号

https://www.luogu.com.cn/record/91801511

dfs函数:

    int dinic(int x,int flow){
        if(x==T)return flow;
        int res=flow,i=now[x];
        for(;i&&res;i=nxt[i])if(dis[ver[i]]==dis[x]+1){
            int f=0;
            if(edge[i])f=dinic(ver[i],min(res,edge[i]));
            res-=f,edge[i]-=f;
            if(!res)break;
        }
        now[x]=i;
        return flow-res;
    }

|