Power of Cryptography
来源:互联网 发布:决战武林进阶数据 编辑:程序博客网 时间:2024/05/17 23:11
Description
Power of Cryptography
Background
Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers modulo functions of these primes. Work in this area has resulted in the practical use of results from number theory and other branches of mathematics once considered to be of only theoretical interest.
This problem involves the efficient computation of integer roots of numbers.
The Problem
Given an integer and an integer you are to write a program that determines , the positive root of p. In this problem, given such integers n and p, p will always be of the form for an integer k (this integer is what your program must find).
The Input
The input consists of a sequence of integer pairs n and p with each integer on a line by itself. For all such pairs , and there exists an integer k, such that .
The Output
For each integer pair n and p the value should be printed, i.e., the number k such that .
Sample Input
21632774357186184021382204544
Sample Output
431234
解题报告
一看,貌似是大数据的,其实不然,用double就可以解决。。。
#include<stdio.h>#include<math.h>int main(){ double p,n; while(scanf("%lf%lf",&n,&p)!=EOF) printf("%.lf\n",pow(p,1/n));}
- Power of Cryptography POJ2109
- JOJ1728:Power of Cryptography
- poj21029 Power of Cryptography
- POJ2109 Power of Cryptography
- 113 - Power of Cryptography
- UVa Power of Cryptography
- 113 - Power of Cryptography
- F - Power of Cryptography
- uva Power of Cryptography
- POJ2109--Power of Cryptography
- Power of Cryptography
- 113 - Power of Cryptography
- 113 - Power of Cryptography
- 113 - Power of Cryptography
- poj2109-Power of Cryptography
- POJ2109:Power of Cryptography
- POJ2109 Power of Cryptography
- 1 Power of Cryptography
- IAR的有用的快捷键
- MySQL5.6 选项和变量整理
- 使用逻辑分析仪时如何防止reg_wire型信号被优化掉
- 我的第一篇博客
- 【C语言】格式化输入输出函数
- Power of Cryptography
- asp.net分页和 jquery ajax 无刷新分页
- 一切从实际出发在
- jQuery substr() 方法
- noncopyable详解
- EXEC和sp_executesql的区别
- css内容切换选项卡
- Linux驱动笔记(1)
- 基于智能电网的电力线载波通信研究