Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

根本就是水题

Posted by 492943457 at 2009-08-26 10:14:29 on Problem 3100
#include<iostream>
#include<math.h>
using namespace std;
int main()
{   int n,m,i,j,k,n1,n2;
    while(cin>>n>>m)
    {    if(n==0&&m==0)break;
         k=(int)pow(n,1.0/m);
         n1=(int)pow(k,m*1.0);
         n2=(int)pow(k+1,m*1.0);
         if(n-n1<n2-n)cout<<k<<endl;
         else
         { cout<<k+1<<endl; }
    }
    return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator