上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 73 下一页
摘要: 题目:http://codeforces.com/contest/914/problem/G 其实就是把各种都用子集卷积和FWT卷起来算即可; 注意乘 Fibonacci 数组的位置; 子集卷积时不能一边做一边更新卷积的数组! 代码如下: 阅读全文
posted @ 2019-01-12 12:02 Zinn 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 题目:http://uoj.ac/problem/348 一开始可以 3^n 子集DP,枚举一种状态的最后一个集合是什么来转移; 设 \( f[s] \) 表示 \( s \) 集合内的点都划分好了,\( g[s] = \sum\limits_{i \in s} w[i] \) 那么 \( f[s] 阅读全文
posted @ 2019-01-12 10:05 Zinn 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.luogu.org/problemnew/show/P4220 http://uoj.ac/problem/347 先写了一下 n^2 和三棵树一样的情况,n^2 还写了ST表O(1)求 lca,其实做 n 遍 dfs 就好了... #include<cstdio> # 阅读全文
posted @ 2019-01-11 19:58 Zinn 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.luogu.org/problemnew/show/P4547 https://www.lydsy.com/JudgeOnline/problem.php?id=5006 参考博客:https://www.cnblogs.com/yanshannan/p/9452802 阅读全文
posted @ 2019-01-11 16:33 Zinn 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.luogu.org/problemnew/show/P4546 先写了个55分的部分分,直接用LCT维护即可,在洛谷上拿了60分; 注意各处 pushup,而且 splay 维护的是一条链但其形态不一定是一条链! #include<iostream> #include< 阅读全文
posted @ 2019-01-11 11:56 Zinn 阅读(187) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-01-08 19:44 Zinn 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4006 用斯坦纳树求出所有关键点的各种连通情况的代价,把这个作为状压(压的是集合选择情况)的初值DP即可。 代码如下: 阅读全文
posted @ 2019-01-07 22:12 Zinn 阅读(161) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-01-07 19:28 Zinn 阅读(2) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-01-06 21:27 Zinn 阅读(3) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2019-01-06 16:16 Zinn 阅读(1) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 73 下一页