Sicily 1394. Root of the Problem
来源:互联网 发布:fifaonline韩服数据库 编辑:程序博客网 时间:2024/05/16 11:29
答案就在ceil(pow(B,1/N))和floor(pow(B,1/N))这两者之间(很久没见过这么短的代码了)。
Run Time: 0sec
Run Memory: 312KB
Code length: 274Bytes
SubmitTime: 2012-02-09 17:07:48
// Problem#: 1394// Submission#: 1208419// The source code is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License// URI: http://creativecommons.org/licenses/by-nc-sa/3.0/// All Copyright reserved by Informatic Lab of Sun Yat-sen University#include <iostream>#include <cmath>using namespace std;int main(){ int A, B, N; while ( cin >> B >> N && B && N ) { A = floor( powl( B, 1.0 / N ) ); cout << ( B - powl( A, N ) < powl( A + 1, N ) - B ? A: A + 1 ) << endl; } return 0;}
- Sicily 1394. Root of the Problem
- Sicily 1394. Root of the Problem
- sicily 1394 Root of the Problem
- 1394. Root of the Problem
- 1394. Root of the Problem
- Root of the Problem
- TJU Root of the Problem
- Root of the Problem-3100
- POJ 3100 Root of the Problem
- zoj 2818 Root of the Problem
- poj 3100 Root of the Problem
- POJ 3100 Root of the Problem (水题)
- POJ 3100:Root of the Problem
- POJ 3100 Root of the Problem G++
- POJ 3100 Root of the Problem 可能会
- ZOJ Problem Set - 2818 Root of the Problem
- hdu 2740 Root of the Problem (水)
- POJ 3100 Root of the Problem || 1004 Financial Management 洪水!!!
- oracle expdp/impdp高版本导入到低版本
- XP及其以上版本自动关机提升权限代码
- android2.3 使用浏览器地址栏 鼠标移动时导致输入法消失问题
- 查看linux版本
- 十一张图让你轻松学会用VS打包
- Sicily 1394. Root of the Problem
- JQuery Learning(4):JQuery events
- 从java jar文件包中读资源的常用方法
- linux环境下BDI3000固件程序更新
- The New C++ -- 基本数据类型和字面值常量 (3. sizeof表达式和typeid表达式)
- 窗口动态效果
- 淘宝网的网站服务器
- 读书笔记集
- (2011年java基础)设计模式总结(简述)