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
人气:201 ℃ 时间: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 _.
- My sister is too young.I have to ____ her at home
- 线段AB上有C,D两点,AD=15,BC18.CD二分之一AB求AB
- I like the yellow skirt 提问the yellow
猜你喜欢
- 借问酒家何处有,牧童遥指杏花村.这句诗与哪种酒有关?
- 现代汉语题,指出下列词语的结构类型.
- 一个数列{an}:当n为奇数时,an=5n+1;当n为偶数时,an=2n/2.求这个数列的前2m项的和(m是正整数).
- 三个小朋友称体重,小宁小飞重62千克,小飞小云重60千克,小宁小云重58千克,算出他们每人各重多少千克?
- thank you ______me with my english you are welcome A for help B to help C to helping D for helping
- 在三角形abc中,内角A,B,C,的对边分别为a,b,c,且2c的平方=2a的平方+2b的平方+ab.则
- 求证对角线互相垂直且一条对角线平分一组对角的四边形是菱形
- 小学六年级上册语文大本回顾拓展七的作文怎么写?