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

无语__int64才过!!贴代码!!

Posted by wocha at 2012-04-18 16:42:51 on Problem 2545
#include<stdio.h>

	__int64  q[2342432];
__int64 min(__int64 q,__int64 w,__int64 e)
{
	__int64 m;
	m=q<w?q:w;
	m=m<e?m:e;
	return m;
}
int main()
{
__int64 w,e,r,t,q1[33];
	while(scanf("%I64d%I64d%I64d%I64d",&q1[0],&q1[1],&q1[2],&w)!=EOF)
	{
	__int64 i,j;
	__int64 b2=1,b3=1,b5=1;
	q[1]=1;
	for(i=2;i<=w+1;i++)
	{
		q[i] = min(q[b2]*q1[0],q[b3]*q1[1],q[b5]*q1[2]);

	 if(q[i] == q[b2]*q1[0])
			b2++;
	 if(q[i] == q[b3]*q1[1])
			b3++;
	 if(q[i] == q[b5]*q1[2])
			b5++;
	}
	printf("%I64d\n",q[w+1]);
}
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