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 |
水过,贴AC代码Source Code Problem: 3536 User: caizixian Memory: 696K Time: 563MS Language: G++ Result: Accepted * Source Code #include<iostream> #include<cmath> using namespace std; int main() { int i,j,k,n,m=1000000000; int mi,mj,mk; cin>>n; for(i=1;i<=sqrt(n)+1;++i) { if(n%i==0) { for(j=1;j<=n/i;++j) { k=i*j;if(n%k==0) { k=n/k;if(i*j+i*k+j*k<m) { m=i*j+i*k+j*k;mi=i;mj=j;mk=k; } } } } } cout<<mi<<" "<<mj<<" "<<mk<<endl;return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator