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 hp_carrot at 2009-11-03 08:56:30 on Problem 1952
In Reply To:DP再DP,不知道哪里错啦,帮忙看看 Posted by:mingruoyuan at 2009-07-02 16:52:53
for(j=1;j<i;j++)
                        if(a[j]>a[i]&&s[j]+1==s[i]&&a[j]!=k)
			{
				k=a[j];
				num[i]+=num[j];
			}
在这里,你是说碰到一个数字,如果比我当前要求得的数大并且能构成一个最大的序列就加上他的num值,并且保证之后碰到和此数字同样大小的数字的时候就不会再重复的加上,但是您没有考虑到,相同的数字,都是后面的num值最全面。所以导致你算的num值小。举个例子:56 55 57 55 43第一个55对应的种类是1,但是第二个55对于的种类是2.

	

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