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
#include<stdio.h>
#include<string.h>
int main()
{
long long int a[51];
for(long long int i = 1; i < 16;i++)
{
a[i] = 1;
for(long long int j = 1; j <= i;j++)
{
a[i] = a[i]*i;
}
}
long long int n;
while(~scanf("%lld",&n))
{
int ans = 0;
for(int i = 1; i < 16;i++)
{
if(n >= a[i])
ans++;
if(n < a[i])
break;
}
printf("%d\n",ans);
}
return 0;
}