| ||||||||||
| 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 | |||||||||
一开始居然想当然以为是第一个三分点 我傻×了#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n,i,j,k;
double maxt=1e16;
int maxi,maxj,maxk;
cin>>n;
for (k=1;k<=n;k++) if (n%k==0)
{
j=ceil(pow((double)(n/k),0.5));
while ((n/k)%j) j++;
i=n/k/j;
if (i*j+j*k+i*k<maxt)
{
maxt=i*j+j*k+i*k;
maxi=i;maxj=j;maxk=k;
}
}
cout<<maxk<<' '<<maxj<<' '<<maxi<<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