上一页 1 2 3 4 5 6 7 8 ··· 13 下一页
摘要: Problem Description Now you are back,and have a task to do:Given you a string s consist of lower-case English letters only,denote f(s) as the number o 阅读全文
posted @ 2016-08-26 08:40 wust_ouyangli 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Problem Description Given a string S. K-string is the sub-string of S and it appear in the S at least K times.It means there are at least K different 阅读全文
posted @ 2016-08-25 09:12 wust_ouyangli 阅读(927) 评论(0) 推荐(0) 编辑
摘要: Description A string is finite sequence of characters over a non-empty finite set Σ. In this problem, Σ is the set of lowercase letters. Substring, al 阅读全文
posted @ 2016-08-24 15:09 wust_ouyangli 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 代码 //确认maxn大小,一般是原字符串长度最大值的2倍,然后是init(),最后是一个一个的字符插入, //转化成对应的数字,调用Insert函数,可支持在线。 struct SAM { int ch[maxn][26]; int pre[maxn],step[maxn]; int last,i 阅读全文
posted @ 2016-08-24 14:59 wust_ouyangli 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 代码 //maxn,n取二分图两方中点数的最大值,首先init,然后在输入中加边AddEdge, //最后调用solve struct edge { int v,next; }E[2*maxn]; struct TwoMatch { int head[maxn],eid; bool vis[maxn 阅读全文
posted @ 2016-08-24 08:47 wust_ouyangli 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 单调栈 int rear=0; for(int st=1;st<=N;st++) { while(rear>0&&H[que[rear]]>=H[st]) --rear; if(rear==0) le[st]=0; else le[st]=que[rear]; que[++rear]=st; } 单 阅读全文
posted @ 2016-08-23 10:03 wust_ouyangli 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 搜索分为dfs(深度优先搜索)和bfs(广度优先搜索)。简单的爆搜: 适用于数据比较小或是访问数很少的情况,一般是初学者最开始接触的。剪枝搜索: 一般的爆搜不可行(TLE),在爆搜的基础上进行适当剪枝,有些题目需要强剪枝。这种题目难就难在如何剪枝,而不在搜的过程。一般会设置一个限制作为预估的条件,事 阅读全文
posted @ 2016-08-22 20:32 wust_ouyangli 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 将最大独立集转化为极大团来做 代码 //首先要init,初始化G全部置为true,除了G[i][i],然后对于连了边的(u,v),G[u][v]=G[v][u]=false; //接下来调用solve,group保存的是一组独立集的点,而且是字典序最小的。 struct MaxClique { bo 阅读全文
posted @ 2016-08-22 18:24 wust_ouyangli 阅读(344) 评论(0) 推荐(0) 编辑
摘要: 代码 //首先init,传进去的参数分别是两边的点的个数,然后调用solve,如果是求 //最小值,改为负数,相当于的求负数的最大值。 struct KM { int W[maxn][maxn],n,m; int Lx[maxn],Ly[maxn]; int To[maxn]; bool S[max 阅读全文
posted @ 2016-08-22 11:12 wust_ouyangli 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Problem Description A group of thieves is approaching a museum in the country of zjsxzy,now they are in city A,and the museum is in city B,where keeps 阅读全文
posted @ 2016-08-22 09:43 wust_ouyangli 阅读(185) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 13 下一页