【poj1080】 Human Gene Functions】的更多相关文章

http://poj.org/problem?id=1080 (题目链接) 题意 给出两个只包含字母ACGT的字符串s1.s2,可以在两个字符串中插入字符“-”,使得s1与s2的相似度最大. Solution 动态规划. 用f[i][j]表示字符串s1前i位和s2前j位的最大相似度,转移很简单,直接看程序吧,边界条件要注意,当i=0或j=0时,就等于是在长度等于0的字符串中全部插入“-”,使得两字符串长度相等的相似度.打个表预处理出每两个字符的相似度比较方便后面的操作. 代码 // poj108…
[POJ 1080] Human Gene Functions 相似于最长公共子序列的做法 dp[i][j]表示 str1[i]相应str2[j]时的最大得分 转移方程为 dp[i][j]=max(dp[i-1][j-1]+score[str1[i]][str2[j]], max(dp[i-1][j]+score[str1[i]]['-'],dp[i][j-1]+score['-'][str2[j]]) ) 注意初始化0下标就好 代码例如以下: #include <iostream> #inc…
Human Gene Functions Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 17805   Accepted: 9917 Description It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four…
Human Gene Functions Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 19573   Accepted: 10919 Description It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four…
Human Gene Functions Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18053 Accepted: 10046 Description It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four let…
Human Gene Functions Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3103    Accepted Submission(s): 1761 Problem Description It is well known that a human gene can be considered as a sequence,…
Human Gene Functions Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 18007   Accepted: 10012 Description It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four…
题目大意:每次给出两个碱基序列(包含ATGC的两个字符串),其中每一个碱基与另一串中碱基如果配对或者与空串对应会有一个分数(可能为负),找出一种方式使得两个序列配对的分数最大 思路:字符串动态规划的经典题,很容易想到状态dp[i][j],指第一个长度为i的串和第二个长度为j的串配对的最大分数.显然,这个状态可以由dp[i][j-1],dp[i-1][j],dp[i-1][j-1]三个子问题得到,即第一串最后一个字符对应空格.第二串最后一个字符对应空格和第一串第二串最后一个字符配对所得到的分数这三…
题面 It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been interested in identifying human genes and determining their function…
题目地址:http://poj.org/problem?id=1080 Description It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply denoted by four letters, A, C, G, and T. Biologists have been interested in identifyi…