RT!!!
快速幂用了,特殊情况考虑了,ios::sync_with_stdio(false);用了, long double用了,还是0分!!!!!!!!!
#include<bits/stdc++.h>
using namespace std;
long long int pow(long long int x, int n)
{
long long int ans=1;
while(n)
{
if(n&1)
ans=ans*x;
x*=x;
n>>=1;
}
return ans;
}
int main()
{
ios::sync_with_stdio(false);
long double x,n;
long long int i=0;
cin>>x>>n;
if(x==1)
{
cout<<"0";
return 0;
}
else if(x>pow(2,n))
{
cout<<"0";
return 0;
}
else if(x==2&&n>1)
{
cout<<"inf";
return 0;
}
else if(x==n==1)
{
cout<<"1";
return 0;
}
else if(n==1)
{
cout<<"0";
return 0;
}
while(x<pow(2,n))
{
x=(x==1)?1:(x/2)*x;
i++;
}
cout<<i;
return 0;
}