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

改进了很多,怎么还wa啊?郁闷啊!

Posted by radish at 2005-04-04 21:50:47 on Problem 2363
In Reply To:高手帮我看看,怎么想也没发现问题,连0我都算了,怎么还wa啊?这个肯定不会超时的啦,因为我。。。 Posted by:radish at 2005-04-02 22:15:38
#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