> 其他 >
Number Sequence
Time Limit:2000/1000 MS (Java/Others) Memory Limit:65536/32768 K (Java/Others)
Total Submission(s):8030 Accepted Submission(s):1482
Problem Description
A number sequence is defined as follows:
f(1) = 1,f(2) = 1,f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.
Given A,B,and n,you are to calculate the value of f(n).
Input
The input consists of multiple test cases.Each test case contains 3 integers A,B and n on a single line (1
人气:164 ℃ 时间:2020-04-13 13:40:50
解答
计算有时间限制 2000/1000 毫秒
1
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版