摘要: 题目链接: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) 编辑