poj 2109
来源:互联网 发布:php超链接怎么做 编辑:程序博客网 时间:2024/06/05 05:45
#include <iostream>
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long LL;
int main()
{
LL left,right,mid;
double n,p;
while(cin>>n>>p)
{
left=0,right=1000000;
while(right-0.00001>left)
{
mid=(left+right)/2;
if(pow(mid,n)-p>0)
right=mid;
else if(pow(mid,n)-p<0)
left=mid;
else {
printf("%d\n",mid);
break;
}
}
}
return 0;
}
#include<cstdio>
#include<cmath>
using namespace std;
typedef long long LL;
int main()
{
LL left,right,mid;
double n,p;
while(cin>>n>>p)
{
left=0,right=1000000;
while(right-0.00001>left)
{
mid=(left+right)/2;
if(pow(mid,n)-p>0)
right=mid;
else if(pow(mid,n)-p<0)
left=mid;
else {
printf("%d\n",mid);
break;
}
}
}
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
- Lumen 查询执行SQL
- SQL中SELECT INTO和INSERT INTO SELECT语句
- android studio 运行coco2dx 的小问题
- ubuntu PJSIP编译java库及jni生成,开放新jni接口
- 打造自己的 APP「冰与火百科」(三):Material Design 控件
- poj 2109
- YII2验证码
- OpenCV3_C++_Sobel()sobel边缘检测 实例
- Androidstudio 出现 Call requires API level 24(current minimum is 15):android.icu.util.calendar 问题时的办法
- 正则表达式总结(二)重复
- 问题:C++编写的核心模块如何暴露给外部HTTP Web服务接口???
- 图片都没有显示出来的更多资料在我的印象笔记中
- 【清明】奇怪的初赛汇总
- 浅谈iOS中MVVM的架构设计与团队协作