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 |
改进了很多,怎么还wa啊?郁闷啊!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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator