摘要: 传送门:https://www.lydsy.com/JudgeOnline/problem.php?id=1190 【题解】 首先,我们把所有物品都分解成$a\times 2^b$的形式,然后把物品按照$b$分组; 我们按$b$从高到低考虑。$f(i,j)$表示考虑到$2^i$,当前还剩余$j\ti 阅读全文
posted @ 2019-02-14 20:43 Galaxies 阅读(487) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.lydsy.com/JudgeOnline/problem.php?id=1004 【题解】 Burnside引理,考虑Polya原理的推导,由于循环节必须染相同的颜色,那么可以dp出方案。 1 # include <bits/stdc++.h> 2 using na 阅读全文
posted @ 2019-02-10 16:12 Galaxies 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://codeforces.com/problemset/problem/997/C 【题解】 注意在把$i=0$或$j=0$分开考虑的时候,3上面的指数应该是$n(n-j)+j$ 至少一行一列相同颜色,那么这些相同颜色的行列一定是同一种颜色,所以是$3^((n-i)(n-j)+1) 阅读全文
posted @ 2019-02-10 15:42 Galaxies 阅读(266) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://codeforces.com/problemset/problem/9/D 【题解】 树形dp,f(i,j)表示i个节点,高度为j的方案数,枚举左子树大小和哪一个子树高度为j-1即可。 不加任何优化时间复杂度$O(n^4)$ 1 # include <bits/stdc++.h 阅读全文
posted @ 2019-02-10 15:04 Galaxies 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 传送门:http://codeforces.com/problemset/problem/15/E 【题解】 1 # include <bits/stdc++.h> 2 using namespace std; 3 4 typedef long long ll; 5 6 const int mod 阅读全文
posted @ 2019-02-10 14:51 Galaxies 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.lydsy.com/JudgeOnline/problem.php?id=5305 【题解】 1 # include <bits/stdc++.h> 2 using namespace std; 3 4 const int M = 2010; 5 6 int n, m 阅读全文
posted @ 2019-02-10 14:34 Galaxies 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 传送门:https://www.lydsy.com/JudgeOnline/problem.php?id=1485 【题解】 Catalan数,注意不能直接用逆元,需要分解质因数。 1 # include <bits/stdc++.h> 2 using namespace std; 3 4 cons 阅读全文
posted @ 2019-02-10 14:12 Galaxies 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 传送门: https://zerojudge.tw/ShowProblem?problemid=a228 http://acm.hdu.edu.cn/showproblem.php?pid=1693 【题解】 插头dp第一题(难以置信我高中oi没有写过23333) 方程很简单,自己推一推插头的地方的 阅读全文
posted @ 2018-08-19 20:54 Galaxies 阅读(565) 评论(0) 推荐(0) 编辑
摘要: 高三 阅读全文
posted @ 2018-07-21 23:35 Galaxies 阅读(735) 评论(1) 推荐(2) 编辑
摘要: AFO 阅读全文
posted @ 2017-07-22 17:38 Galaxies 阅读(737) 评论(0) 推荐(0) 编辑