IT民工
加油!
摘要: 这道题本来不难,但是写的纠结。三维广搜,只有六个方向,有一段时间没写结构体,发现很不熟练。/*Accepted 612K 16MS C++ 2362B 2012-07-23 17:48:55*/#include<cstdio>#include<cstring>#include<cstdlib>#include<queue>using namespace std;const int MAXN = 50;const int dx[] = { 1, -1, 0, 0, 0, 0};const int dy[] = { 0, 0, 1, -1, 0, 0 阅读全文
posted @ 2012-07-23 17:52 找回失去的 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 括号序列,刘汝佳黑书上的经典例题。但是这道题要输出我们最后得到的添加括号最少的序列,输出序列确实很麻烦,参考了题解,才勉勉强强写出来,以后还得把这道题敲一遍。/*Accepted 288K 32MS C++ 1862B 2012-07-23 11:46:07*/#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>using namespace std;#define o -2#define lr -3const int MAXN = 105;int f[MAXN 阅读全文
posted @ 2012-07-23 11:53 找回失去的 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 现在给出两个碱基序列,可以在两个串间插入‘-’即空白,求两串的最大相似度。最长公共子序列的变形状态转移方程:f[i][j] = Max( f[i - 1][j] + score[dna(a[i])][4], f[i][j - 1] + score[4][dna(b[j])], f[i - 1][j - 1] + score[dna(a[i])][dna(b[j])])/*Accepted 216K 0MS C++ 1329B 2012-07-23 09:19:46*/#include<cstdio>#include<cstring>#include<algorit 阅读全文
posted @ 2012-07-23 09:37 找回失去的 阅读(149) 评论(0) 推荐(0) 编辑