摘要: #includeusing namespace std;int a[128][128];void init(){ memset(a,0,sizeof(a)); a['A']['A']=5; a['A']['C']=-1; a['A']['G']=-2; ... 阅读全文
posted @ 2015-07-24 16:33 xryz 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 首先要去学习最长公共上升子序列LCIS,然后是对n*n效率的算法进行优化,这里要注意的是可以求出来的序列中间可以有一个最高的。刚开始将输入的数组进行逆置,写下来发现这可能存在问题。不过具体是什么也没有仔细想明白。#includeusing namespace std;int dp[3... 阅读全文
posted @ 2015-07-24 15:29 xryz 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 1006Friends 刚开始想用邻接矩阵来保存边的关系,不过后来发现实现dfs时很困难。后来又想到了储存边的关系来dfs,这会终于ac了。这几天写了好几道最小生成树的水题,居然一下子想不到用领接表来存储,实在是不应该#include#include#includeusing na... 阅读全文
posted @ 2015-07-24 13:55 xryz 阅读(89) 评论(0) 推荐(0) 编辑
摘要: #includeusing namespace std;const int inf=1<<24;int main(){ int n,i,j,k,e[50][50],u,v,w,low[50],ans; char s; while(~scanf("%d",&n)) ... 阅读全文
posted @ 2015-07-24 12:55 xryz 阅读(97) 评论(0) 推荐(0) 编辑