poj 2109
来源:互联网 发布:百成玻璃优化排版软件 编辑:程序博客网 时间:2024/06/14 20:24
POJ - 2109 Power of Cryptography
比赛时,一看到这种题,觉得数这么大,就想用大数,然后用log,但是计算过程中,k的值不断被精确,导致最后的精确度差距很大,后来看了一些题解,谈到了范围问题:
类型 长度 (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
才知道,double范围这么大,并且题目也没有我想象的这么复杂
#include<cstdio>#include<iostream>#include<cmath>using namespace std;int main(){ double n,p; while(scanf("%lf%lf",&n,&p)!=EOF) cout<<pow(p,1.0/n)<<endl; return 0;}
0 0
- POJ 2109
- POJ 2109
- poj 2109
- POJ 2109
- poj 2109
- POJ 2109
- POJ 2109
- poj.2109
- POJ 2109
- poj-2109
- poj 2109
- POJ 2109
- POJ-2109
- poj 2109
- POJ 2109
- poj 2109
- POJ 2109
- poj 2109
- Collections类方法详解
- Ionic2双击退出应用
- VS调试C程序跳转至_debugger_hook_dummy = 0;
- Android Studio 新建编译 Java 工程
- 模拟点击事件动态增删元素
- poj 2109
- 操作系统原理:链接与ELF文件
- 1045. 快速排序(25)
- 概率图模型学习(3)——马尔科夫网表示1
- 用Python处理"大"XLS文件
- canvas简单API
- MAC下安装与配置MySQL
- Collection中的基本方法
- 数据挖掘-商品购买记录-商品推荐_亲和度分析