随笔分类 - 网络流----费用流
摘要:pro: https://www.luogu.com.cn/problem/P2469 sol: 发现这个模型和最小路径覆盖有着密切的联系 考虑最小路径覆盖是怎么实现的 一开始用n条长度为1的路径去覆盖n个点 使初始答案为n 每个点拆成入点和出点 对于原图每条边x >y 然后x的出点和y的入点连边
阅读全文
摘要:在何Au的讲解下终于搞明白了这个以前的坑。 首先考虑最小路径覆盖。 这个题意又要求我们求出的最大流为n 1(这样才能保证路径为1条) 考虑高速航行模式的图怎么建,只需要保证最大流的同时费用最小即可,显然费用流。 再考虑跳跃模式,等价于每个点都互相连边,代价是跳跃的定位时间。 直接暴力建图,每个点向另
阅读全文
摘要:原题的话,由于保证了wi include include include include include include include include include define N 220000 define M 220000 define L 200000 define eps 1e 7 d
阅读全文