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

Re:那位大牛帮忙看看啊 小弟不胜感激 折腾了两天了 不知道哪里错了。。。。。

Posted by dirtysalt at 2009-07-17 11:57:59 on Problem 1018 and last updated at 2009-07-17 12:01:45
In Reply To:Re:那位大牛帮忙看看啊 小弟不胜感激 折腾了两天了 不知道哪里错了。。。。。 Posted by:starvae at 2009-07-16 20:49:06
> J可能达到0的啊 题目数据范围给定的
我没有说j的范围取错了,是你这样写的话
for(j=0;j<n;j++)
.....
   if(f[j][k].brand>=i&&bb[i]==1)
	dp[j][i]=MMIN(dp[j][i],dp[j-1][i]+f[j][k].price);//
对于j=0的时候引用了dp[j-1][i]就是DP[-1][i]的数据,而DP[-1][..]其实是未定义的[C++将这块内存初始化为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