ACM: 简单数学推导+挑战平台的精度…
来源:互联网 发布:淘宝网店加盟哪家好 编辑:程序博客网 时间:2024/06/09 20:02
Description
Current work in cryptography involves (among other things) largeprime numbers and computing powers of numbers among these primes.Work in this area has resulted in the practical use of results fromnumber theory and other branches of mathematics once considered tobe only of theoretical interest.
This problem involves the efficient computation of integer roots ofnumbers.
Given an integer n>=1 and an integerp>= 1 you have to write a program that determinesthe n th positive root of p. In this problem, given such integers nand p, p will always be of the form k to the nth. power,for an integer k (this integer is what your program must find).
Input
The input consists of a sequence of integer pairs n and p witheach integer on a line by itself. For all such pairs1<=n<= 200,1<=p<10101 and thereexists an integer k,1<=k<=109 such thatkn = p.
Output
For each integer pair n and p the value k should be printed,i.e., the number k such that k n =p.
Sample Input
2 16
3 27
7 4357186184021382204544
Sample Output
4
3
1234
题意: k^n = p . 现在给出n , p 求 k
解题思路:
代码:
#include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
//
}
- ACM: 简单数学推导+挑战平台的精度…
- ACM: 一道组合数学的题 poj3252
- ACM : 一道基础数学题目POJ 1423 …
- 杭电ACM 1239 简单的搜索类 Callin…
- 惯性力的数学推导
- 惯性力的数学推导
- lstm的数学推导
- lstm的数学推导
- ACM: 一道简单数论题 (重要的是建…
- ZOJ 3827 简单数学推导+简单模拟
- ACM: 简单 动态规划题 toj 1509 (…
- ACM: 简单题 poj 1152 (简单题也wr…
- 【从0开始ACM】【LV3】【数学】【 FFT 快速傅里叶变换 && NTT 更高精度的 快速数论变换】
- ACM: 极其简单题 uva&nb…
- KMP 算法的数学推导
- svm的数学推导原理
- logistic回归的数学推导
- ACM: 简单最小生成树 图论题 poj 1…
- ACM: 图论题 poj 2253 (poj上的dou…
- ACM: 图论题 poj 1062 (邻接矩阵+d…
- 2016"百度之星" - 资格赛(Astar Round1)(hdu5685(线段树、乘法逆元),hdu5686(大数),hdu5687(字典树),hdu5688)
- ACM: 一题DFS(深搜,剪枝) poj 1011
- ACM: 一题STL map题 poj 1002 (bt…
- ACM: 简单数学推导+挑战平台的精度…
- ACM: 初中数学 poj 1328
- ACM: 深搜 poj 2531 (一开始,居然…
- ACM: 高速打素数表 TOJ 3749 (疯狂…
- ACM: 数论 台州OJ 3151 (久违的数…
- ACM: poj 1664
- linux入门
- ACM: 广搜+素数 poj 3126 (素数表…
- ACM: 模拟队列判定 poj 1426