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

数据有问题的,这个代码示例过不了,但能ac

Posted by raymondj at 2014-03-08 16:12:14 on Problem 2109
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main()
{
    long long 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("%.0lld\n",mid);
                break;
            }
        }
    }
    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