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 soyscut at 2013-07-16 17:28:10 on Problem 2063
在我程序里面 背包的主过程, 这样就A了
		for(i=0;i<year;i++)
		{
			memset(f,0,sizeof(f));
			pack=(amount+s_P)/1000;
			for(j=0;j<d;j++)
				for(k=W[j];k<=pack;k++)
				{
					f[k]=max(f[k],f[k-W[j]]+P[j]);
				}
			s_P+=f[pack];
			//pack=(amount+s_P)/1000;

		}
但是把第四行写成 pack=amount/1000+s_P/1000就WA了(s_P是利息的和,amount是最开始的钱数),我觉得是一样的啊!求问这是我理解题意的问题还是什么?

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