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:谁能给我说一下,这个思路是怎么想到的啊?怎么才能想到这个面~~? 谢谢了!

Posted by Eclipse2008 at 2011-08-09 00:09:33 on Problem 3356
In Reply To:谁能给我说一下,这个思路是怎么想到的啊?怎么才能想到这个面~~? 谢谢了! Posted by:cssdnx at 2011-07-30 16:48:31
跟LCS很像,根据LCS的思路考虑,

f[i][j]表示,a的前i个基因序列和b的前j个基因序列需要的最少操作数
则:
f[i][j] =  min
{
	若 a[i] == b[j] f[i][j] = f[i-1][j-1];
	若 不等:
	插入:f[i][j] = f[i][j-1] + 1;
	删除: f[i][j] = f[i-1][j] + 1;
	替换:f[i][j] = f[i-1][j-1] + 1;
}
注意初值:
f[0][0] = 0;
f[i][0] = i;
f[0][i] = i;

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