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 yy17yy at 2011-05-11 17:21:10 on Problem 2323
dp[i][j],,,权值个数为i,,,逆序数对为j的answer,,,
推i+1时,,我们有理由假设第i+1个权值比前i个权值都大,,,那么根据它放的位置不同会使逆序数增加[0,i]个不等
于是方程就出来了,,,
for(i=1;i<18;i++)
		for(j=0;dp[i][j];j++)
			for(k=0;k<=i;k++)
				if(j+k<201)
					dp[i+1][j+k]+=dp[i][j];

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