Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 197 Accepted Submission(s): 90
#include<iostream>
#include<cstdio>
#define LL __int64
using namespace std;
int main()
{
int t;
LL n;
scanf("%d",&t);
for(int i=1;i<=t;i++)
{
scanf("%I64d",&n);
LL exm=1;
LL ans=0;
LL flag=1;
while(n>=exm)
{
LL gg;
gg=exm;
ans++;
n-=exm;
exm+=flag;
flag=gg;
//cout<<flag<<" "<<exm<<endl;
}
printf("%I64d\n",ans);
}
return 0;
}
原文:http://www.cnblogs.com/hsd-/p/5184964.html