poj 1080 Human Gene Functions dp
来源:互联网 发布:aes256算法 java实现 编辑:程序博客网 时间:2024/05/21 10:23
这个题目也没什么可以说的了
dp[i][j]表示第一段长度为i,第二段长度为j的时候的最优值
状态转移方程
dp[i][j]=max(dp[i][j],dp[i-1][j-1]+mat[a[i]][b[j]]);
dp[i][j]=max(dp[i][j],dp[i-1][j]+mat[a[i]][0]);
dp[i][j]=max(dp[i][j],dp[i][j-1]+mat[0][b[j];
注意边界就ok了
#include
#include
#include
using namespace std;
const int maxn=111,inf=99999999;
char a[maxn],b[maxn];
int mat[501][501];
int dp[maxn][maxn];
const char A='A',G='G',T='T',C='C';
int max(int a,int b)
{
}
int main()
{
}
- poj 1080 Human Gene Functions dp
- ZOJ 1027 Human Gene Functions
- POj 1159 Palindrome (dp)
-  
- poj 2096 Collecting Bugs 期望dp
- poj 1141 Brackets Sequence dp
- poj 3280 Cheapest Palindrome dp(…
- poj 2948 Martian Mining dp
- poj 1609 Tiling Up Blocks(DP)
-
- poj 2488
- POJ 2485 Highways
- poj 1952 BUY LOW, BUY LOWER dp
- ACM: 回文串 dp题 poj 1159 (滚动…
- POJ 3299
- poj 1905
- ACM: dp题 poj 1276 go on 动态规…
- dp 3267 The Cow Lexicon
- poj 1038 动态规划(dp)
- LDA整体流程
- poj 1848 Tree 树型dp
- poj 1946 Cow Cycl…
- poj 3356 AGTC dp 最短编辑距离
- poj 1080 Human Gene Functions dp
- poj 3034 Whac-a-Mole dp
- 求高手请进,帮我分析这种情况是什么原因
- poj 3280 Cheapest Palindrome dp(…
- poj 2948 Martian Mining dp
- poj 1691 Painting A Board
- poj 3670 Eating Together
- ACM算法训练
- 管理者,你要懂这十大黄金管理法则