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

各位大哥大姐帮忙看看哪错了,N次WA了!!!!!

Posted by zdqpp at 2007-12-28 00:07:05 on Problem 2545
#include"iostream"
using namespace std;
int main()
{
_int64 a[10000]={1},p1,p2,p3,this1,this2,this3;
int pp1,pp2,pp3;
int n;
scanf("%I64d %I64d %I64d %I64d",&p1,&p2,&p3,&n);
//printf("%I64d %I64d %I64d %d",p1,p2,p3,n);
pp1=pp2=pp3=0;
for(int i=1;i<=n;i++)
{
	this1=a[pp1]*p1;
	this2=a[pp2]*p2;
	this3=a[pp3]*p3;
	_int64 min=((this1<=this2?this1:this2)<=this3)?(this1<=this2?this1:this2):this3;
	a[i]=min;
	if(this1==min) pp1++;
    if(this2==min) pp2++;
	if(this3==min) pp3++;
//printf("%I64d\n",a[i]);
}
printf("%I64d\n",a[n]);
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