上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 37 下一页
摘要: int lowbit(int x){ return x&(-x);}int sum(int x){ int ret=0; while(x>0) { ret+=c[x]; x-=lowbit(x); } return re... 阅读全文
posted @ 2015-07-27 09:25 xryz 阅读(93) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;int use[30],a[30],flag,b[30],m,p[20];char s[1024];void dfs(int x){ int i,a1,a2,a3,t,l; if(fl... 阅读全文
posted @ 2015-07-25 16:21 xryz 阅读(145) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;struct data{ int x,y;} a[200],b[200];bool cmp(data n,data m){ if(n.x==m.x) return n.yb[j].x)... 阅读全文
posted @ 2015-07-25 15:16 xryz 阅读(155) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;int mp[30][250][250];int main(){ int n,u,v,i,j,l,k,p,f; char s[1024]; while(~scanf("%d",&... 阅读全文
posted @ 2015-07-25 14:25 xryz 阅读(132) 评论(0) 推荐(0) 编辑
摘要: #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) 编辑
摘要: 1001 OO’s Sequence分析:对于样例,可以得到,我们要求的是(1,1)(1,2)(1,3)(1,4)(1,5)(2,2)(2,3)(2,4)(2,5)(3,3)(3,4)(3,5)(4,4)(4,5)(5,5)这些范围内满足题目中所给的要求的i的个数。所以可以将两个求和... 阅读全文
posted @ 2015-07-23 13:43 xryz 阅读(130) 评论(0) 推荐(0) 编辑
摘要: #include#include#includeusing namespace std;int dp[2048][2048];int main(){ int i,j,n,s[500],t; char s1[2048],s2[2048],s3[2048]; while... 阅读全文
posted @ 2015-07-23 09:36 xryz 阅读(101) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 37 下一页