You are given a positive integer n, please count how many positive integers k satisfy
kk≤nkk≤n.
InputThere are no more than 50 test cases.
Each case only contains a positivse integer n in a line.
1≤n≤10181≤n≤1018
OutputFor each test case, output an integer indicates the number of positive integers k satisfy kk≤nkk≤n in a line.Sample Input
1 4Sample Output
1
2
#include <iostream>
using namespace std;
typedef long long ll;
//a ^ a
__int64 POW(ll a)
{
__int64 result = 1;
ll base = a;
ll tmp = a;
while(tmp > 0)
{
if((tmp & 1) == 1)
result = result * base;
base = base * base;
tmp >>= 1;
}
return result;
}
int main()
{
ios::sync_with_stdio(false);
__int64 n;
while(cin >> n)
{
for(int i = 15 ; i >= 0 ; i--)
{
if(POW(i) <= n)
{
cout << i << endl;
break;
}
}
}
return 0;
}