Skip to content

UVa 113

Alex Wind edited this page Aug 5, 2014 · 3 revisions

Power of Cryptography

from Volume 1. Elementary Problem Solving :: Maths - Misc

Problem

给出 n 和 p。求出 p 的 n 次方根。

Solution

虽然题目中的 p 值很大。但我们仍然可以用 double 类型来解决。但是不知是精度问题还是 WTF 问题。利用 log() 来计算是不行的,只能用 pow() 来计算,同时结果要四舍五入。

Clone this wiki locally