标签:
Description
Input
Output
Sample Input
2 16 3 27 7 4357186184021382204544
Sample Output
4 3 1234
Source
#include<cstdio> #include<math.h> int main(){ double p,n,k; long long int end,mid,begin; while(~scanf("%lf%lf",&n,&p)){ end = 1000000000,begin = 1; while(begin <= end){ mid = (begin + end )/2 ; k =pow(mid,n); if(k<p){ begin = mid ; } else if (k>p){ end = mid ;} else { printf("%lld\n",mid); break; } } } return 0; }
标签:
原文地址:http://www.cnblogs.com/zero-begin/p/4313146.html