首个小程序第三方插件平台开放!免费制作小程序功能再次升级!
1027
2022-08-27
HIT 2060 Fibonacci Problem Again(矩阵乘法)
题目:Problem Again
My Tags | (Edit) |
| Source : HCPC 2005 FALL | ||
| Time limit | | Memory limit |
Submitted : 547, Accepted
As we know , the Fibonacci numbers are defined as follows:
"""" Given two numbers a and b , calculate
. """"
Input
The input contains several test cases. Each test case consists of two non-negative integer numbers a and b (0 ≤ a ≤ b ≤1,000,000,000). Input is terminated by a = b = 0.
Output
For each test case, output S mod 1,000,000,000, since S may be quite large.
Sample Input
1 13 5 10 1000 0 0
Sample Output
116 496035733
关于取模的问题每步都要注意啊!!
#include
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~