摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1712ACboy needs your helpTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3045Accepted Submission(s): 1581Problem DescriptionACboy has N courses this term, and he plans to spend at most M days on study. 阅读全文
posted @ 2013-09-10 16:27 飞火扑蛾 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4714Tree2cycleTime Limit: 15000/8000 MS (Java/Others)Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 400Accepted Submission(s): 78Problem DescriptionA tree with N nodes and N-1 edges is given. To connect or disconnect one edge, we need 1 阅读全文
posted @ 2013-09-08 21:26 飞火扑蛾 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1159Common SubsequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18201Accepted Submission(s): 7697Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (pos 阅读全文
posted @ 2013-09-07 19:31 飞火扑蛾 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4604DequeTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1879Accepted Submission(s): 689Problem DescriptionToday, the teacher gave Alice extra homework for the girl weren't attentive in his class. 阅读全文
posted @ 2013-09-06 19:54 飞火扑蛾 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=1568分析:一道数学题找出斐波那契数列的通项公式,再利用对数的性质就可得到前几位的数斐波那契通项公式如下:取完对数后(记fn为第n个数)log10(fn)=-0.5*log10(5.0)+((double)n)*log(f)/log(10.0)+log10(1-((1-√5)/(1+√5))^n) 其中f=(sqrt(5.0)+1.0)/2.0;最后取对数的小数部分就可得最终结果代码如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 阅读全文
posted @ 2013-09-06 00:16 飞火扑蛾 阅读(174) 评论(0) 推荐(0) 编辑