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

一开始居然想当然以为是第一个三分点 我傻×了

Posted by lccycc at 2009-10-27 22:31:11 on Problem 3536
#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:
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