Power of Cryptography Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 21354 Accepted: 10799 Description Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work…
题目地址:http://poj.org/problem?id=2109 /* 题意:k ^ n = p,求k 1. double + pow:因为double装得下p,k = pow (p, 1 / n); 基础知识: 类型 长度 (bit) 有效数字 绝对值范围 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 2. 二分查找…
点击打开链接 Power of Cryptography Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 16388   Accepted: 8285 Description Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these pr…
Power of Cryptography Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 26622   Accepted: 13301 Description Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes.…
题目:http://poj.org/problem?id=2109 题意:求一个整数k,使得k满足kn=p. 思路:exp()用来计算以e为底的x次方值,即ex值,然后将结果返回.log是自然对数,就是e为底计算的.换底公式 log<a>(b) = log<c>(b) / log<c>(a). float 的范围为-2^128 ~ +2^127,也即-3.40E+38 ~ +3.40E+38: double 的范围为-2^1024 ~ +2^1023,也即-1.79E+…
题目链接: http://poj.org/problem?id=2109 参考: http://blog.csdn.net/code_pang/article/details/8263971 题意: 给定n,p,求k使得kn=p(1≤n≤200, 1≤p<10101, 1≤k≤109) 分析: 高精度+二分~~ k的位数为p的位数除以n的向上取整,这样知道k的位数便可以在范围内二分了~注意这里的答案是向下取整~~ 代码: #include<cstring> #include<cst…
Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in this area has resulted in the practical use of results from number theory and other branches of mathematics onc…
import java.math.BigInteger; import java.util.Scanner; public class Main { static BigInteger p,l,r,div; static int n; public static int cmp(BigInteger mid){ BigInteger sum=mid.pow(n); return sum.compareTo(p); } public static BigInteger calc(){ l=BigI…
1.Link: http://poj.org/problem?id=2109 http://bailian.openjudge.cn/practice/2109/ 2.Content: Power of Cryptography Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 18872   Accepted: 9520 Description Current work in cryptography involves (…
Power of Cryptography Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 18258   Accepted: 9208 Description Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. W…