TLE?0分求助

P3355 骑士共存问题

dinic不是这么写的
by ___balalida___ @ 2020-08-21 19:18:35


```cpp int dinic() { int ans=0; while(bfs()) { while(int d=dfs(s,inf))//这个 { ans+=d; } } return ans; } ``` 去掉那个while
by ___balalida___ @ 2020-08-21 19:19:39


@[___balalida___](/user/237541) ???为什么要去掉 `while`
by Zxx200611 @ 2020-08-21 19:21:34


@[___balalida___](/user/237541) 这个貌似没啥用吧
by gdjcwsk @ 2020-08-21 19:22:08


@[gdjcwsk](/user/243024) `dfs` 函数应该不是这么写的,建议再学学 Dinic。
by Zxx200611 @ 2020-08-21 19:24:05


@[Zxx200611](/user/175590) 我再看看试试,毕竟dinic对我来说也不那么熟。
by gdjcwsk @ 2020-08-21 19:24:38


我的是这么写的:https://www.luogu.com.cn/paste/nr1bbunv
by ___balalida___ @ 2020-08-21 19:27:17


代码明显有点问题吧。。
by gdjcwsk @ 2020-08-21 19:32:35


A了,仔细观察一番确有些问题
by gdjcwsk @ 2020-08-21 19:55:11


|