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:第一次发帖,纪念第一次独立分析及解决的DP~

Posted by bengol at 2012-11-23 17:02:55 on Problem 1080
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:
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