You are given a positive integer n, please count how many positive integers k satisfy
kk≤n
.
Each case only contains a positivse integer n in a line.
1≤n≤1018
1 4
1 2
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
long long int mutu(long long int x,long long int k)
{
long long int ans = 1;
long long int temp = x;
while (k)
{
if (k & 1)
{
ans = ans*temp;
}
temp *= temp;
k >>= 1;
}
return ans;
}
int main()
{
long long int n;
while (cin >> n)
{
for (int i = 15; i >= 0; i--)
{
if (mutu(i, i) <= n)
{
cout << i << endl;
break;
}
}
}
return 0;
}