hdu 2481 Toy】的更多相关文章

好题!!!没话说…… 用到的知识面很多,这题的难点在于公式的推导. 原始推导过程见:http://hi.baidu.com/spellbreaker/item/d8bb3bda5af30be6795daa93 这个过程有点小问题,改进后的见:http://blog.csdn.net/acm_cxlove/article/details/7868589 下面是自己敲的代码: /*************************************************************…
传送门 题意: 相邻珠子不能相同,旋转等价.$n$个珠子$k$中颜色,求方案数 首先中间珠子$k$种选择,$k--$如果没有相邻不同的限制,就和$POJ\ 2154$一样了$|C(f)|=k^{\#(f)}$但是有了相邻不同的限制,每种循环的颜色就不能任意选择了旋转等价循环个数是$gcd(n,i)$,同一个循环的元素相差$i$步容易得到只要满足长度$gcd(n,i)$的一段相邻颜色不同整个环就不同了,因为这样的一段正好每个循环有一个元素考虑$DP$,$f[i]$表示$i$个元素组成的环染色方案数…
题目链接 题意:n个小珠子组成的正n边形,中间有一个大珠子.有木棍相连的两个珠子不能有相同的颜色,旋转后相同视为相同的方案,求着色方案数. \(\\\) 先选定一种颜色放在中间,剩下的\(k-1\)种颜色再摆在环上.下面直接令\(k=k-1\). 根据Burnside引理,\(ans=\sum_{a|n}f(a)\phi(\frac{n}{a})\).\(f(a)\)表示最多使用\(k\)种颜色且长度为\(a\)的,首尾以及相邻珠子颜色互不相同的方案数.计算\(f(n)\)时,假设\(n-1\)…
Quoit Design Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 47104    Accepted Submission(s): 12318 Problem Description Have you ever played quoit in a playground? Quoit is a game in which fla…
Birthday Toy Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 644    Accepted Submission(s): 326 Problem Description AekdyCoin loves toys. It is AekdyCoin’s Birthday today and he gets a special “…
Adding New Machine Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1428    Accepted Submission(s): 298 Problem Description Incredible Crazily Progressing Company (ICPC) suffered a lot with the…
Picture Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3897    Accepted Submission(s): 1978 Problem Description A number of rectangular posters, photographs and other pictures of the same shape…
Looploop Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1651    Accepted Submission(s): 517 Problem Description XXX gets a new toy named Looploop. The toy has N elements arranged in a loop, an…
http://acm.hdu.edu.cn/showproblem.php?pid=1078 题意: 一张n*n的格子表格,每个格子里有个数,每次能够水平或竖直走k个格子,允许上下左右走,每次走的格子上的数必须比上一个走的格子的数大,问最大的路径和. 记忆化搜索 #include <iostream> #include <string.h> #include <stdio.h> using namespace std; ][] = { {, },{ -, }, {, }…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1007 Quoit Design Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 62916    Accepted Submission(s): 16609 Problem Description Have you ever played…