Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
挺简单的,,,没那么麻烦,,,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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator