同余问题 基本定理: 若a,b,c,d是整数,m是正整数, a = b(mod m), c = d(mod m) a+c = b+c(mod m) ac = bc(mod m) ax+cy = bx+dy(mod m) -同余式可以相加 ac = bd(mod m) -同余式可以相乘 a^n = b^n(mod m) f(a) = f(b)(mod m) if a = b(mod m) and d|m then a = b(mod d) eg: 320 = 20(mod 100) and d =…
http://acm.hdu.edu.cn/showproblem.php?pid=1021 Fibonacci Again Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 29201 Accepted Submission(s): 14148 Problem Description There are another kind…
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1021 Fibonacci Again Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 70782 Accepted Submission(s): 32417 Problem Description There are another ki…
刚开始直接按题意来写,WA了,唉,果然经验不够..然后开始找规律,本来一看到这种题,第一反应就是规律题,然后看看题意,貌似没啥规律哦!就像当时学DP一样,总是想当然被智商压制了啊喂! #include<iostream> #include<cstdio> using namespace std; int main(){ int k; while(scanf("%d",&k)!=EOF){ if((k-2)%4!=0) cout<<"…
#include<iostream> using namespace std; int main() { int n; while(cin>>n) { if((n+1)%4==3) cout<<"yes"<<endl; else cout<<"no"<<endl; } return 0; } There are another kind of Fibonacci numbers: F(0) =…
参考自:https://www.cnblogs.com/ECJTUACM-873284962/p/6404504.html Fibonacci Again Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 58267 Accepted Submission(s): 27275 Problem Description There are…
Fibonacci Again Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 66450 Accepted Submission(s): 30760 Problem Description There are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n)…