Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这根本就是水题 什么都不用考虑。。。没什么好考虑的 #include<iostream> #include<cmath> using namespace std; int main() { int n,a,b; while(cin>>b>>n&&(n+b)) { a=pow(b,(double)1/n); if(b-pow((double)a,n)>pow((double)a+1,n)-b) a++; cout<<a<<endl; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator