BZOJ 3713: [PA2014]Iloczyn|暴力
2016-02-24 18:49
513 查看
这种水题我也能交4遍 0.0
斐波那契数列是指数级的的增长,所以求不了多少就到了109,暴力求出所有的小于等于109数,暴力判断……
PS: int不靠谱,longlong保平安
斐波那契数列是指数级的的增长,所以求不了多少就到了109,暴力求出所有的小于等于109数,暴力判断……
PS: int不靠谱,longlong保平安
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<queue> #include<vector> #include<set> #include<map> #include<algorithm> #include<iostream> #define N 520050 #define e exp(1.0) #define pi acos(-1.0) using namespace std; int sc() { int i=0,f=1; char c=getchar(); while(c>'9'||c<'0'){if(c=='-')f=-1;c=getchar();} while(c>='0'&&c<='9')i=i*10+c-'0',c=getchar(); return i*f; } long long F[111]; int main() { F[0]=0,F[1]=1; for(int i=2;i<=45;i++)F[i]=F[i-1]+F[i-2]; int T=sc(); while(T--) { long long x=sc(); bool flag=0; for(int i=0;i<=45;i++) for(int j=i;j<=45;j++) if(F[i]*F[j]==x) flag=1; if(flag)puts("TAK");else puts("NIE"); } return 0; }
相关文章推荐
- 用fail2ban阻止SSH和VSFTP暴力破解密码
- 2015BJOI day1第三题 糖果candy
- 4495: Least Prime factor 找到最小质因子P的第N小正整数
- 暴力枚举法求最大连续和
- CodeForces 241F Race
- POJ 2965.The Pilots Brothers' refrigerator
- POJ 1753.Flip Game
- POJ 3295.Tautology
- hdu 5533 Dancing Stars on Me
- hdu5532Almost Sorted Array
- 没参加的2015百度之星——数矩形
- poj 3279 Fliptile
- Birthday Cake——直线分割
- Spiral——找规律暴力
- POJ 1166&IOI 1994 The blocks 暴力枚举 解题报告
- hdu 1248
- LCM Challenge(暴力)
- 小晴天老师系列——竖式乘法(暴力)
- URAL 1786 Sandro's Biography
- URAL 1788 On the Benefits of Umbrellas