1 条题解
-
0
Sol
小恐龙的战斗力为 。
Code
#include<bits/stdc++.h> using namespace std; int n,x,k,a=1,b=1,c=2,mod=1e9+7; int gcd(int x,int y) { if(x<y) { swap(x,y); } if(!y) { return x; } return gcd(y,x%y); } int main() { cin>>n; for(int i=1;i<=n;i++) { cin>>x; k=gcd(k,x); } if(k<3) { cout<<1; } else { k-=3; while(k--) { a=b; b=c; c=a+b; c%=mod; } cout<<c; } }
信息
- ID
- 728
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 4
- 标签
- (无)
- 递交数
- 90
- 已通过
- 9
- 上传者