摘要: 传送门: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 阅读(242) 评论(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 阅读(268) 评论(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) 编辑