要求加强数据及一些建议

P3376 【模板】网络最大流

消灭零回复惨案
by 吹雪吹雪吹 @ 2018-07-14 20:15:38


%%%xhw大佬
by VenusM1nT @ 2018-07-14 20:16:03


大师球~@[Venus](/space/show?uid=23243)
by 吹雪吹雪吹 @ 2018-07-14 20:17:06


你们不是同桌吗,戏这么多的吗
by UKE开车自动机 @ 2018-07-14 20:50:50


所以你需要 [LOJ](https://loj.ac)
by memset0 @ 2018-07-18 18:48:47


@[chen_zhe](/space/show?uid=8457)
by GKxx @ 2018-07-19 09:54:35


dfs都过了... ```cpp #include<iostream> #include<cstdio> #include<vector> #define Maxn 10000 using namespace std; int n,m,source,sink,from,to,capacity,ans,last,cnt; vector<int> g[Maxn+100],l[Maxn+100],b[Maxn+100]; int e[Maxn+100]; int dfs(int num,int val) { if (num==sink)return val; e[num]=cnt; for (int i=0,tmp;i<g[num].size();i++) if (l[num][i]&&e[g[num][i]]!=cnt){ tmp=dfs(g[num][i],min(val,l[num][i])); if (tmp){ l[num][i]-=tmp; l[g[num][i]][b[num][i]]+=tmp; return tmp; } } } int main() { scanf("%d%d%d%d",&n,&m,&source,&sink); for (int i=1;i<=m;i++){ scanf("%d%d%d",&from,&to,&capacity); g[from].push_back(to); l[from].push_back(capacity); g[to].push_back(from); l[to].push_back(0); b[from].push_back(g[to].size()-1); b[to].push_back(g[from].size()-1); }last=-1; while(ans!=last){ last=ans;cnt++; ans+=dfs(source,1000000000); }cout<<ans; return 0; } ``` [1964ms](https://www.luogu.org/record/show?rid=8852856)
by command_block @ 2018-07-24 16:02:25


Dinic没建反边都过了。。。
by CYSCYS @ 2018-07-25 08:39:04


dinic写炸了也过了
by nflsjxc @ 2018-08-04 12:09:18


|