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

pow(m,1.0/3)外面加上ceil应该就好了

Posted by frkstyc at 2005-04-08 10:38:21 on Problem 2363
In Reply To:改进了很多,怎么还wa啊?郁闷啊! Posted by:radish at 2005-04-04 21:50:47
> #include<iostream.h>
> #include<math.h>
> int main()
> {
>     int i,j,k,m,n;
>     cin>>n;
>     while(n)
>     {
>         cin>>m;
>         for(i=int(pow(m,1.0/3))+1;i>0;i--)
>         if(m%i==0)
>         {
>             m=m/i;
>             for(j=int(pow(m,0.5))+1;j>0;j--)if(m%j==0)
>             {k=m/j;cout<<2*(i*j+j*k+k*i)<<endl;goto next;}
>         }
> next:   n--;
>     }
>     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