bzoj3713: [PA2014]Iloczyn(乱搞)

3713: [PA2014]Iloczyn

题目:传送门 


题解:

   随手一发水题x2

   直接离线啊,斐波那契到了第五十个就炒鸡大了

    


代码:

 1 #include<cstdio>
 2 #include<cstring>
 3 #include<cstdlib>
 4 #include<cmath>
 5 #include<algorithm>
 6 using namespace std;
 7 typedef long long LL;
 8 LL f[55],T,n;
 9 int main()
10 {
11     f[1]=0;f[2]=1;for(int i=3;i<=50;i++)f[i]=f[i-1]+f[i-2];
12     scanf("%lld",&T);
13     while(T--)
14     {
15         scanf("%lld",&n);bool bk=false;
16         for(int i=1;i<=50;i++)if(bk==true)break;else
17             for(int j=1;j<=50;j++)
18                 if(f[i]*f[j]==n){bk=true;break;}
19         if(bk==true)printf("TAK
");
20         else printf("NIE
");
21     }
22     return 0;
23 }
原文地址:https://www.cnblogs.com/CHerish_OI/p/8688108.html