题目大意:k^n=p,给出 n 和 p 求 k
解题思路:k = p ^ (1/n)
二分法+高精度——Poj 2109 Power of Cryptography(double型开n次方的方法通过的原因)by 猿先生
#include<iostream>
#include<cstdio>
#include<string.h>
#include<stdlib.h>
#include<cmath>
using namespace std;
int main() {
double n, p;
while(scanf("%lf%lf", &n, &p) != EOF) {
printf("%.0lf\n", pow(p, 1/n));
}
return 0;
}