随笔分类 - 网络瘤
摘要:##题目 Dearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area there are N shopkeepers (marked from 1 to N) whi
阅读全文
摘要:##题目 As you know, all the computers used for ACM contests must be identical, so the participants compete on equal terms. That is why all these compute
阅读全文
摘要:##题目 (left->)[https://www.luogu.com.cn/problem/solution/P4012] ##思路 首先考虑费用和流量分别是什么,那么很显然,费用是步数,流量是价值。那么接下来考虑建图,首先源点连机器人,汇点连目的地,这都没问题。然后考虑相邻的点并且可以行走的话就
阅读全文
摘要:##题目 (戳我)[https://www.luogu.com.cn/problem/solution/P4016] ##思路 讲一下费用流的建图,首先我们需要做的肯定是做到数量平均,所以我们考虑大于平均值的边应该是要出流的,小于的应该是要流入的,题目要求的是搬运量,自然而然它就是费用,我们在相邻的
阅读全文
摘要:##题目 roblem Description Little Q's factory recently purchased m pieces of new equipment, labeled by 1,2,…,m. There are n workers in the factory, label
阅读全文
摘要:##题目 (戳我)[https://www.luogu.com.cn/problem/P2765] ##思路 两种思路,第一种贪心很明显了,我们直接从第一个开始放球,可以放就放,不能放就新开一个。第二种的话建图,首先我们应该发现这个东西的特点,一个柱子可以放多个球,有多个柱子,但是每个柱子的球是不可
阅读全文
摘要:##题面 戳我 ##思路 有蜥蜴连超级源点,可以出图的连超级汇点,不用说了,然后就是有高度的柱子裂点,边权为高度,然后可以互相跳的连边,跑dinic就好了。 ##代码实现 #include<cstdio> #include<algorithm> #include<vector> #include<q
阅读全文
摘要:##题目 戳我 ##思路 三分图匹配,不过看上去裸匈牙利应该能过吧,我们考虑网络流,但是由于一本书只能匹配一次,那么我们考虑裂点来做流量限制,然后直接跑dinic就好了。 #代码实现 #include<cstdio> #include<algorithm> #include<vector> #inc
阅读全文
摘要:##题目 链接 ##思路 看题目就知道是最小割了,但是不一样的是,我们一般求的最小割是割边,而这题让我们求的是割点,那么我们在原有的网络基础上在每个点和一个我们附加的点上连上一条边权为1的边限制流量就好了。 ##代码实现 #include<cstdio> #include<algorithm> #i
阅读全文
摘要:##最大流 (洛谷 3376) #include<cstdio> #include<algorithm> #include<vector> #include<queue> #include<map> #include<set> #include<iostream> #include<cstring>
阅读全文
摘要:##题目 题目背景 第二次世界大战期间,英国皇家空军从沦陷国征募了大量外籍飞行员。由皇家空军派出的每一架飞机都需要配备在航行技能和语言上能互相配合的两名飞行员,其中一名是英国飞行员,另一名是外籍飞行员。在众多的飞行员中,每一名外籍飞行员都可以与其他若干名英国飞行员很好地配合。 题目描述 一共有 nn
阅读全文

浙公网安备 33010602011771号