#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
typedef unsigned long long ll;
ll gcd(ll a,ll b)
{
return b==0?a:gcd(b,a%b);
}
int main()
{
//最大公约数斐波那契定理 gcd(f[2020],[2020])=f[gcd(2020,520]
int x=gcd(2020,520);
x-=2;//第一项和第二项为 1 已经求过,往后滚x-2个 找到第 gcd(2020,520)项
int a=1,b=1,c=0;
while(x--)
{
c=a+b;
a=b;
b=c;
}
cout<<c<<endl;
return 0;
}
0 回复
0 转发
0 喜欢
5 阅读



