1 2 3 4
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页
摘要: 传送门 : https://ac.nowcoder.com/acm/contest/1063/C 棋子两两冲突,放最多的棋子。 把冲突的棋子之间建条边,建好后发现选择的是最大独立集。 图中不可能有奇环,是二分图。 二分图的 最大独立集 = 顶点总数 - 最小路径覆盖 = 顶点总数 - 最大匹配 然后 阅读全文
posted @ 2020-07-10 17:06 Lesning 阅读(312) 评论(0) 推荐(0)
摘要: 传送门 : http://poj.org/problem?id=2226 这个题需要的知识 1 二分图的最大匹配(网络流,或者匈牙利) 2 二分图的最小顶点覆盖等于最大匹配 左边顶点是行编号,右边顶点是列编号,每个边是一个泥坑。顶点覆盖边,就是木板覆盖泥坑。 具体看代码吧,横着扫一遍竖着再扫一遍 # 阅读全文
posted @ 2020-07-09 18:03 Lesning 阅读(209) 评论(0) 推荐(0)
摘要: 妹想到会是二分图匹配问题 https://www.luogu.com.cn/problem/P1129 图片选自https://www.luogu.com.cn/blog/sswcdak/solution-p1129,一目了然 #include<iostream> #include<cstring> 阅读全文
posted @ 2020-07-09 11:06 Lesning 阅读(134) 评论(0) 推荐(0)
摘要: 题链接 https://nanti.jisuanke.com/t/39277 好久不见我又回来了,这题要考虑他在问啥。这题要找子路径包含 异或和为0的路径 的路径的数量,而且有些许重复,枚举所有异或和为0 的路径,把他们的所有父路径列出来。 题解 如果x p在一条链子上,那就(siz[p])*( n 阅读全文
posted @ 2020-07-07 17:29 Lesning 阅读(182) 评论(0) 推荐(0)
摘要: https://codeforc.es/contest/1364/problem/D 看错题了,要求小于等于k的环或者(k+1)/2个独立集 找环dfs树就行了,独立集不知道定理,就盲找了,前十几个数字总有在最大独立集中参与的吧...所以就和1相连的所有点都猜一猜。。。。 #include<iost 阅读全文
posted @ 2020-06-17 15:20 Lesning 阅读(171) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/5795/B 提取一个公式既可 具体看代码 #include<iostream> #include<algorithm> using namespace std; typedef long long ll; const int 阅读全文
posted @ 2020-06-03 15:26 Lesning 阅读(291) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/5902/C 感谢LDK大神提供的最后解法 一个点z 到另一个点集合S的最长路为 ans 集合S中的最远点对x,y ans = max(ans,dis(x,z),dis(y,z)); 就是这样了 #include<cstring 阅读全文
posted @ 2020-06-02 20:53 Lesning 阅读(199) 评论(0) 推荐(0)
摘要: “科林明伦杯”哈尔滨理工大学第十届程序设计竞赛(同步赛) 换根来一波 https://ac.nowcoder.com/acm/contest/5758/A #include<iostream> #include<algorithm> #include<cstring> using namespace 阅读全文
posted @ 2020-05-31 17:15 Lesning 阅读(192) 评论(0) 推荐(0)
摘要: https://codeforc.es/contest/1359/problem/D 参考了一位大佬 https://www.cnblogs.com/stelayuri/p/12986700.html 看完题解我是震惊的。 枚举最大值,如果前面区间sum小于0,就直接扔掉(sum = 0),因为留下 阅读全文
posted @ 2020-05-29 17:34 Lesning 阅读(155) 评论(0) 推荐(0)
摘要: https://ac.nowcoder.com/acm/contest/5600/J #include<iostream> using namespace std; typedef long long ll; const ll mod = 1e9+7; const int maxn = 2e5+11 阅读全文
posted @ 2020-05-20 18:19 Lesning 阅读(701) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页