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 |
Re:第一次发帖,纪念第一次独立分析及解决的DP~In Reply To:第一次发帖,纪念第一次独立分析及解决的DP~ Posted by:bengol at 2012-11-23 17:00:16 > 虽然基本照抄LCS。。。 LCS[0][0] = 0; for(i=1; i<=gene2_len; i++) LCS[0][i] = LCS[0][i-1]+score[4][gene2[i]]; for(i=1; i<=gene1_len; i++) LCS[i][0] = LCS[i-1][0] + score[gene1[i]][4]; for(i=1; i<=gene1_len; i++) for(j=1; j<=gene2_len; j++) { if (gene1[i] == gene2[j]) LCS[i][j] = LCS[i-1][j-1] + score[gene1[i]][gene2[j]]; else LCS[i][j] = MAX(MAX(LCS[i][j-1]+score[4][gene2[j]], LCS[i-1][j]+score[gene1[i]][4]),LCS[i-1][j-1]+score[gene1[i]][gene2[j]]); } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator