Sunday, September 25, 2011

ACM - UVA 113 - Power of Cryptography

Problem : 113 - Power of Cryptography
Solution : C++
Hints : http://algorithmist.com/index.php/UVa_113



#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <sstream>
#include <set>
#include <math.h>
using namespace std;

int main() {
    double n, p;
    while(scanf("%lf%lf",&n,&p) == 2)
   {
       printf("%.0lf\n",pow(p,1/n));
    }
    return 0;
}

1 comment: