Codeforces Round #257 (Div. 2) B. Jzzhu and Sequences_html/css_WEB-ITnose
程序员文章站
2022-04-23 18:14:58
...
B. Jzzhu and Sequences
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output题目意思很简单 给出三个数x,y,n,其中x=f1,y=f2 fi+1=fi-fi-1;
求出fn%(10^9+7)
一个周期函数。。。。。水过
#include#define M 1000000007#define N 2000000000+5using namespace std;int main(){ __int64 ans,n,x,y,i; int a[7]; while(cin>>x>>y) { cin>>n; n=n%6; x=(x+M)%M; y=(y+M)%M; a[1]=x; a[2]=y; for(i=2;i2) a[i]=a[i]%M; a[i+1]=(a[i]-a[i-1])%M; } if(n) cout
上一篇: php 数目字或者字符串补全
下一篇: PHP微信公众开发笔记(九)
推荐阅读
-
Codeforces Round #649 (Div. 2)-B. Most socially-distanced subsequence(思维)
-
Codeforces Round #461 (Div. 2) B. Magic Forest(异或的性质)
-
Codeforces Round #663 (Div. 2) B. Fix You
-
Codeforces Round #658 (Div. 2) B. Sequential Nim
-
B. Power Sequence(数学+枚举)Codeforces Round #666 (Div. 2)
-
Codeforces Round #666 (Div. 2)B. Power Sequence(等比数列)
-
Codeforces Round #664 (Div. 2) B. Boboniu Plays Chess
-
Codeforces Round #156 (Div. 2)-A. Greg's Workout_html/css_WEB-ITnose
-
Codeforces Round #107 (Div. 2)-A. Soft Drinking_html/css_WEB-ITnose
-
Codeforces Round #191 (Div. 2)-A. Flipping Game_html/css_WEB-ITnose