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
人气:242 ℃ 时间:2020-04-13 13:40:50
解答
计算有时间限制 2000/1000 毫秒
1
推荐
- 杭电ACM1005 Number Sequence
- number-letter sequence是什么意思
- The sequence 1/1,1/2,2/2,1/3,2/3,3/3,1/4,2/4,3/4,4/4,then the 2003rd number is
- What is the next number in this sequence?
- The sequence 1/1,1/2,2/2,1/3,2/3,3/3,1/4,2/4,3/4,4/4,1/5,2/5…,then the 2011th number is _.
- 2cos^2 α-1=?
- 除了黄土高原,那里再有这么厚这么厚的土层啊!的赏析
- 渔民在叉鱼时,真实的鱼是在渔夫看到的鱼的________像
猜你喜欢