会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
SUMMERMINGQAQ
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
3
4
5
6
7
8
9
10
11
···
21
下一页
2020年6月30日
ICPC Pacific Northwest Regional Contest 2016 Maximum Islands(二分图最大独立集)
摘要: Maximum Islands 思路:预处理‘L’周围包围‘W’。‘L’独自成为岛屿为最优,我们‘L’,‘W’交替处理的图((x+y)%2为同一个集合),分为两个集合,相邻的‘L’和‘W’有边,同一个集合没边,变成二分图的最大独立集问题,得出最多的互不相邻的点就是最大岛屿数量。因为我们匹配的出发点是
阅读全文
posted @ 2020-06-30 16:07 SummerMingQAQ
阅读(189)
评论(0)
推荐(0)
2020年6月28日
二分图中的最大独立集,最小点覆盖,最小边覆盖概念
摘要: 前置技能:二分图匹配和匈牙利算法的了解。 (最小点覆盖) 概念:用最少的点,让每条边都至少和其中一个点关联 性质:最小点覆盖 = 最大匹配 说明:在二分图中,求出了最大匹配后,容易得出,合理分配最大匹配的点去覆盖,未匹配的点一定与覆盖的的某个点有边。 (最小边覆盖) 概念:用尽量少的不相交简单路径覆
阅读全文
posted @ 2020-06-28 16:45 SummerMingQAQ
阅读(572)
评论(0)
推荐(0)
Girls and Boys POJ - 1466(最大独立集)
摘要: Girls and Boys 思路:二分图中,最大独立集 = 顶点数 - 最小点覆盖(最大匹配),这里没有说明明确的二分图,所以匹配出的是二倍的最大匹配(男配女,女配男)。 1 #include <iostream> 2 #include <algorithm> 3 #include <cstdio
阅读全文
posted @ 2020-06-28 16:28 SummerMingQAQ
阅读(253)
评论(0)
推荐(0)
2020年6月24日
ICPC Pacific Northwest Regional Contest 2016 C. Buggy Robot
摘要: Buggy Robot 思路:dp[inx][x][y],表示用了前inx个指令后的最小费用。 对于一个指令,我们可以选择不走或者走,其他的我们可以添加四个方向的指令与使用过指令后的dp来比较。 1 #include <iostream> 2 #include <algorithm> 3 #incl
阅读全文
posted @ 2020-06-24 15:29 SummerMingQAQ
阅读(179)
评论(0)
推荐(0)
2020年6月16日
floyd
摘要: 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 5 using namespace std; 6 7 const int N = 110; 8 int f[N][N]; 9 10 //核心想法://i到达j经过前k
阅读全文
posted @ 2020-06-16 23:48 SummerMingQAQ
阅读(285)
评论(0)
推荐(0)
最小费用最大流(SPFA版本)
摘要: 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <queue> 5 6 using namespace std; 7 8 #define LL long long 9 #define pb pus
阅读全文
posted @ 2020-06-16 23:07 SummerMingQAQ
阅读(322)
评论(0)
推荐(0)
2020年6月12日
中国剩余定理
摘要: /* mi之间互质 同余方程组 : 设正整数m1.m2.mk两两互素,则方程组 x ≡ a1 (mod m1) x ≡ a2 (mod m2) x ≡ a3 (mod m3) . . x ≡ ak (mod mk) 有整数解, 解为 x ≡ (a1 * M1 * 1/M1 + a2 * M2 * 1
阅读全文
posted @ 2020-06-12 20:47 SummerMingQAQ
阅读(170)
评论(0)
推荐(0)
拓展欧几里得
摘要: 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <vector> 5 6 using namespace std; 7 8 #define ll long long 9 10 const int
阅读全文
posted @ 2020-06-12 11:11 SummerMingQAQ
阅读(197)
评论(0)
推荐(0)
2020年6月10日
东华大学2020年程序设计竞赛(同步赛) G Gaming with Mia
摘要: G Gaming with Mia 思路:我们能找出某些情况: -1 1 -1 -1 1 1 -1 -1 1 1 1 -1 -1 1 ... 1 -1 我们发现如果大于5个数相乘,则它一定可以分解成其他更优的情况相乘再相加。(当然如果出现0,也可以最极限情况5个数相乘) 时间复杂度就是:O(1e6*
阅读全文
posted @ 2020-06-10 20:02 SummerMingQAQ
阅读(383)
评论(0)
推荐(0)
2020年6月5日
网络流 dinic算法
摘要: 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <vector> 5 #include <queue> 6 using namespace std; 7 #define pb push_back
阅读全文
posted @ 2020-06-05 19:46 SummerMingQAQ
阅读(246)
评论(0)
推荐(0)
上一页
1
···
3
4
5
6
7
8
9
10
11
···
21
下一页
公告