上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 19 下一页
摘要: /*鞍山区域赛的K题。。当时比赛都没来得及看(反正看了也不会)学了polya定理之后就赶紧跑来补这个题。。由于几何比较烂写了又丑又长的代码,还debug了很久。。比较感动的是竟然1Y了。。*/题目大意:给定一些点,某些点上有边,问用k种颜色染色的等价类有多少种思路:由于坐标是整数。。只有可能旋转90... 阅读全文
posted @ 2014-11-16 21:18 PlasticSpirit 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 题目大意:求x属于[1,b]和 y属于[1,d]的 gcd(x,y)=k 的方案数题解:观察发现 gcd()=k 不好处理,想到将x=x/k,y=y/k 后 gcd(x,y)=1。。即问题转化为求区间 [1,b/k]和 [1,d/k]的互质数对个数由于题目规定 (x,y)和(y,x)是同一种,所以我... 阅读全文
posted @ 2014-11-13 21:53 PlasticSpirit 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Another LISTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1244Accepted Submission(s): 431Problem ... 阅读全文
posted @ 2014-11-12 23:11 PlasticSpirit 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 题意:n种元素,每种有 ni个,选出 m 个的排列有多少种题解:指数型母函数的裸题x^n 项的系数为 an/n!....代码如下:#include #include #include#include#include#includeusing namespace std;#define MAXN 10... 阅读全文
posted @ 2014-11-11 18:39 PlasticSpirit 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 题目大意:有1~6六种宝石,价格分别为1~6 。。给定每种宝石的个数,问能否平分给两个人分析:一看显然是个多重背包问题,也可以用母函数做不过母函数的复杂度是n*v*k,第一次tle了。。后来发现一种优化方式当个数大于 6的时候直接把个数设为 5(奇数),6(偶数)。。discuss 里面有位神牛给出... 阅读全文
posted @ 2014-11-11 16:11 PlasticSpirit 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 火车进站问题卡特兰数引入的例子。卡特兰数递推公式:h(n)=h(n-1)*(4*n-2)/(n+1)通项公式:h(n)=c(2n,n)/(n+1)...这题需要高精度,刚好学了一下java。。。第一次写的java好丑啊,还好1y了。。import java.math.*;import java.ut... 阅读全文
posted @ 2014-11-11 14:46 PlasticSpirit 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Wow! Such Sequence!Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3354Accepted Submission(s): 96... 阅读全文
posted @ 2014-11-11 13:42 PlasticSpirit 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Cow XORAdrian Vladu -- 2005Farmer John is stuck with another problem while feeding his cows.All of his N (1 ≤ N ≤ 100,000) cows (numbered 1..N) areli... 阅读全文
posted @ 2014-11-10 18:42 PlasticSpirit 阅读(305) 评论(0) 推荐(0) 编辑
摘要: LightsTime Limit:8 Seconds Memory Limit:131072 KBNow you haveNlights in a line. Don't worry - the lights don't have color. The only status they have i... 阅读全文
posted @ 2014-11-08 11:46 PlasticSpirit 阅读(242) 评论(0) 推荐(0) 编辑
摘要: Play with ChainProblemDescriptionYaoYao is fond of playing his chains. He has a chain containing n diamonds on it. Diamonds are numbered from 1 to n.A... 阅读全文
posted @ 2014-11-07 20:39 PlasticSpirit 阅读(165) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 19 下一页