1 2 3 4
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 20 下一页
摘要: 神奇的树形DP+二分图最大权值匹配转移 dp[x][y]表示以左边的树x为根,右边的树y为根,他们有dp[x][y]个序号是重合的,若x和y不同构那就dp[x][y] = -INF; 如何转移? 给x的儿子们和y的儿子们建个二分图跑最大权值匹配,跑下来的最大权值就是儿子们的答案,很好笑,但是复杂度有 阅读全文
posted @ 2020-08-11 16:44 Lesning 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 本题和cf 888G是一样的 利用分治算法 #include<iostream> #include<cstring> #include<algorithm> #include<vector> using namespace std; const int maxn = 2e5+11; typedef 阅读全文
posted @ 2020-07-31 18:13 Lesning 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 题解传送门,大佬说的非常好:https://www.luogu.com.cn/blog/xuxing/solution-at1999 对于一次删除一行的问题来说,可以优先画个网格图考虑左下点的变化方式,太强了! 阅读全文
posted @ 2020-07-22 20:40 Lesning 阅读(117) 评论(0) 推荐(0) 编辑
摘要: https://ac.nowcoder.com/acm/problem/20265 dp[a][b][c][d][e][llast]可以涂满1个块的颜色有a个,2个块的有b个。。。。。当前末尾是可以涂last个颜色的块涂的。 可以发现,如果用了一次b,b就会少一个颜色,a会增加一个颜色。原理就是这样 阅读全文
posted @ 2020-07-21 13:35 Lesning 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 传送门 https://ac.nowcoder.com/acm/contest/5669/H 我写在这里了https://blog.nowcoder.net/n/589d219b9636417b903d633f6c44d2c7 阅读全文
posted @ 2020-07-21 13:11 Lesning 阅读(89) 评论(0) 推荐(0) 编辑
摘要: https://ac.nowcoder.com/acm/contest/5667/G 题解其实有个前置知识,先整出一个O(n*m)的写法,很简单。但是需要优化。 利用bitset数1的个数计算答案,排好顺序。具体看神仙的代码吧,真的很强!我是看代码学会的 #include<iostream> #in 阅读全文
posted @ 2020-07-14 23:47 Lesning 阅读(224) 评论(0) 推荐(0) 编辑
摘要: https://ac.nowcoder.com/acm/problem/51265 割点的板子 #include<iostream> #include<cstring> #include<algorithm> #include<vector> #include<queue> using namesp 阅读全文
posted @ 2020-07-11 16:44 Lesning 阅读(132) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/justPassBy/p/5369930.html看这个就理解了,棒 阅读全文
posted @ 2020-07-11 00:50 Lesning 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 传送门 : https://ac.nowcoder.com/acm/contest/1063/C 棋子两两冲突,放最多的棋子。 把冲突的棋子之间建条边,建好后发现选择的是最大独立集。 图中不可能有奇环,是二分图。 二分图的 最大独立集 = 顶点总数 - 最小路径覆盖 = 顶点总数 - 最大匹配 然后 阅读全文
posted @ 2020-07-10 17:06 Lesning 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 传送门 : http://poj.org/problem?id=2226 这个题需要的知识 1 二分图的最大匹配(网络流,或者匈牙利) 2 二分图的最小顶点覆盖等于最大匹配 左边顶点是行编号,右边顶点是列编号,每个边是一个泥坑。顶点覆盖边,就是木板覆盖泥坑。 具体看代码吧,横着扫一遍竖着再扫一遍 # 阅读全文
posted @ 2020-07-09 18:03 Lesning 阅读(206) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 20 下一页