andre_joy

导航

2012年8月20日

hdu 1080

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1080题意:匹配两个人相似度。A,G,C,T,每两个都会有一个对应的值,给出两串基因,长度可以不一样,可以在基因中间加_使两串长度一样,然后有一个对应值,求最大对应值。mark:LCS的升级版。dp[i][j] = max(dp[i-1][j]+tab[s[0][i-1]][4], dp[i][j-1]+tab[s[1][j-1]][4], dp[i-1][j-1]+tab[s[0][i-1]][s[1][j-1]]);代码:#include <stdio.h>#include <st 阅读全文

posted @ 2012-08-20 21:11 andre_joy 阅读(216) 评论(0) 推荐(0) 编辑

hdu 1428

摘要: 地址:http://acm.hdu.edu.cn/showproblem.php?pid=1428题意:问最短路径有多少条。mark:首先bfs是用来确定每个点到终点的最短路径。dfs来确定有多少条相同的最短路径。代码:#include <stdio.h>#include <string.h>#include <stdlib.h>#include <queue>#define LL long longusing namespace std;typedef struct{ int a,b;}qq;const int N = 60;const int 阅读全文

posted @ 2012-08-20 18:01 andre_joy 阅读(175) 评论(0) 推荐(0) 编辑