http://poj.org/problem?id=2109
Test instructions: kn = P, known as N,p, asks K. 1<=n<=, 1<=p<10101, 1<=k<=109
Analysis: I was also frightened, so big data, but see discuss said a word can AC, I think of K=pow (p,1.0/n); But K,p,n must be double .
As for why I checked:
Type length (bit) valid numeric absolute range
Float 32 6~7 10^ (-37) ~ 10^38
Double 64 15~16 10^ (-307) ~10^308
Long double 128 18~19 10^ (-4931) ~ 10 ^ 4932
Other people say this problem can be two points heightening accuracy, I will not do. Also have no language.
Power of cryptography
Time Limit: 1000MS |
|
Memory Limit: 30000K |
Total Submissions: 19419 |
|
Accepted: 9804 |
Description
Cryptography involves (among other things) large prime numbers and computing powers of numbers among these Primes. resulted in the practical use of results from number theory and other branches of mathematics once C Onsidered to is only of theoretical interest.This problem involves the efficient computation of the integer roots of numbers. Given An integer n>=1 and an integer p>= 1 you had to write a program that determines the n th positive root of P. In this problem, given such integers n and p, p is always being of the form K to the nth. Power, for a integer k (this is the what your program must find).
Input
The input consists of a sequence of integer pairs N and p with each integer in a line by itself. For all such pairs 1<=n<=, 1<=p<10101and there exists an integer k, 1<=k<=109 such that kn = p.
Output
The For each integer pair n and p the value K should is printed, i.e., the number k such that K n =p.
Sample Input
2 163 277 4357186184021382204544
Sample Output
431234
POJ 2109 Power of cryptography