摘要: 参考:https://www.cnblogs.com/CQzhangyu/p/6952371.html 费用流很简单,考虑但是会T。 考虑费用流的本质,流一次需要要找一个能够从当前点到达的距离最小的点x,然后进行增广,然后把c[x] 1,并且会出现一些反向边。 考虑二叉树的性质,任何一条两点之间路径 阅读全文
posted @ 2018-04-23 22:01 lokiii 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 妙啊 首先暴力建图跑最大流非常简单,s向每个i连流量为p[i]的边,每个i向t连流量为s[i]的边,每个i向j连流量为c的边(i include using namespace std; const int N=10005; int n,c,p[N],s[N]; long long f[2][N], 阅读全文
posted @ 2018-04-23 19:46 lokiii 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 参考:https://blog.csdn.net/wxh010910/article/details/55806735 以下课件,可并堆部分写的左偏树 cpp include include using namespace std; const int N=600005; int n,m,tot,f 阅读全文
posted @ 2018-04-23 17:06 lokiii 阅读(223) 评论(0) 推荐(0) 编辑