20111018

ACM 113 Power of Cryptography

做p ^ (1/n)次,就是答案。

/* ACM 113
 * mythnc
 * 2011/10/18 09:17:44   
 * run time: 0.008
 */
#include <stdio.h>
#include <math.h>
 
int main(void)
{
    double p, n;
 
    while (scanf("%lf %lf", &n, &p) != EOF)
        printf("%.0lf\n", pow(p, 1 / n));
    return 0;
}

沒有留言: