上一页 1 ··· 8 9 10 11 12 13 14 下一页

2014年10月9日

摘要: CollisionTime Limit:2 Seconds Memory Limit:65536 KB Special JudgeThere's a round medal fixed on an ideal smooth table, Fancy is trying to throw some c... 阅读全文

posted @ 2014-10-09 18:15 LLGemini 阅读(226) 评论(0) 推荐(0) 编辑

2014年9月27日

摘要: ---恢复内容开始---记a, b的最大公约数为gcd(a, b)。显然, gcd(a,b)=gcd(|a|,|b|).计算最大公约数的Euclid算法基于下面定理: 【GCD递归定理】对于任意非负整数a和任意正整数b,gcd(a,b)=gcd(b,a%b)。===================... 阅读全文

posted @ 2014-09-27 17:03 LLGemini 阅读(416) 评论(0) 推荐(0) 编辑

2014年9月25日

摘要: 想麻烦了。这题真的那么水啊。。直接暴力模拟,1000次(看了网上的200次就能A)后判断是否全为0,否则就是LOOP; 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #inc... 阅读全文

posted @ 2014-09-25 21:19 LLGemini 阅读(311) 评论(0) 推荐(0) 编辑

2014年9月19日

摘要: POINT: 关于表示一个编码:利用code字符数组表示一个编码字符,其中code[len][val]表示长度为len,二进制值为val的字符;主程序如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include... 阅读全文

posted @ 2014-09-19 18:33 LLGemini 阅读(319) 评论(0) 推荐(0) 编辑

2014年9月18日

摘要: 类型:循环走步 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include... 阅读全文

posted @ 2014-09-18 18:05 LLGemini 阅读(163) 评论(0) 推荐(0) 编辑

2014年9月12日

摘要: 题目大意:输入n,统计有多少个n个结点的有根树,使得每个深度中所有结点的子结点数相同。结果模1000000007。思路:根据题意,每个结点的每个子树都是相同的。所以n结果为n-1的所有约数的结果加起来。示意图:代码如下: 1 #include 2 #include 3 #include 4 #... 阅读全文

posted @ 2014-09-12 19:31 LLGemini 阅读(162) 评论(0) 推荐(0) 编辑

2014年9月5日

摘要: 模拟发现,每个元素求和时,元素的系数是二项式系数,于是ans=sum(C(n-1,i)*a[i]/2^(n-1)),但是n太大,直接求会溢出,其实double的范围还是挺大的,所以可以将组合数转化成对数:e^(lnC(n-1, k)*A[k]/(2^n-1) ) ==> e^( ln C(n-1,k... 阅读全文

posted @ 2014-09-05 19:32 LLGemini 阅读(295) 评论(0) 推荐(0) 编辑

2014年9月4日

摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int maxn = 1000; 7 int Num_of_Player; 8 int m_val; 9 int cnt; 10 //循环链... 阅读全文

posted @ 2014-09-04 16:24 LLGemini 阅读(322) 评论(0) 推荐(0) 编辑

摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=481&page=show_problem&problem=1962刚开始没理解题意,看了题解之后也不太理解,现在好点了。其实可以看作每个麻球的... 阅读全文

posted @ 2014-09-04 00:37 LLGemini 阅读(167) 评论(0) 推荐(0) 编辑

2014年9月2日

摘要: http://blog.csdn.net/acdreamers/article/details/17021095有一个n*m的棋盘,每次可以取走一个方格并拿掉它右边和上面的所有方格。拿到左下角的格子(1,1)者输,如下图是8*3的棋盘中拿掉(6,2)和(2,3)后的状态。结论:答案是除了1*1的棋盘... 阅读全文

posted @ 2014-09-02 18:01 LLGemini 阅读(371) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12 13 14 下一页