码迷,mamicode.com
首页 >  
搜索关键字:最小表示法    ( 137个结果
POJ 1635 树的最小表示法
题目大意:用一堆01字符串表示在树上走动的路径,0表示往前走,1表示往回走,问两种路径方式下形成的树是不是相同的树我们可以利用递归的方法用hash字符串表示每一棵子树,然后将所有子树按照字典序排序,来判断这个hash字符串是否相同 1 #include 2 #include 3 #include.....
分类:其他好文   时间:2015-06-01 11:17:01    阅读次数:96
【POJ】【1635】Subway Tree Systems
树的最小表示法 给定两个有根树的dfs序,问这两棵树是否同构 题解:http://blog.sina.com.cn/s/blog_a4c6b95201017tlz.html题目要求判断两棵树是否是同构的,思路是用树的最小表示法去做。这里用的最小表示法就是将树的所有子树分别用1个字符串表示,要按字.....
分类:其他好文   时间:2015-05-27 22:23:56    阅读次数:227
Gym Conference Room (最小表示法,哈希)
#include using namespace std;const int maxn=1005;const int base=10007;typedef unsigned long long ULL;setsave;int n;int a[4][maxn],b[maxn];int id[maxn=...
分类:其他好文   时间:2015-05-11 21:27:47    阅读次数:113
ZOJ2006 (最小表示法)
var s:ansistring; cas:longint;function minp(st,len:longint):longint;var p1,p2,k,tmp:longint;begin p1:=0; p2:=1; k:=0; while ((p1p2) then exit...
分类:其他好文   时间:2015-04-28 11:14:35    阅读次数:129
[最小表示法] HDU 2609 How many
题意: 给n个串,问不断的循环左移之后,有几个不相同的串。 思路: 全部转换的成字符串的最小表示法,统计。 裸题存模板 代码: #include"cstdlib" #include"cstdio" #include"cstring" #include"cmath" #include"queue" #include"algorithm" #include"iostream" #inclu...
分类:其他好文   时间:2015-03-30 16:33:37    阅读次数:145
BZOJ 2176 Strange string 最小表示法
题目大意:给定一个串S,求最小表示法 n 记得用unsigned char不然WA= = 数据真是逗- - #include #include #include #include #define M 10001000 using namespace std; int n; unsigned char s[M]; int Min_Representation() { int i,j,...
分类:其他好文   时间:2015-03-14 09:38:23    阅读次数:124
HDU 2609 How many(最小表示法)
Problem Description Give you n ( n How many kinds of necklaces total have.(if two necklaces can equal by rotating ,we say the two necklaces are some). For example 0110 express a necklace, you ca...
分类:其他好文   时间:2015-03-03 15:20:26    阅读次数:167
HDU 4162 Shape Number 最小表示法
Shape NumberTime Limit: 24000/12000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 981Accepted Submission(s): 471Proble...
分类:其他好文   时间:2015-01-28 00:48:34    阅读次数:318
字符串小结
这几天多做一些字符串的题并进行总结, 争取可以对这一类的题有更深一层次的认知。 ^_^1) kmp2) ac自动机3) 字典树2) 后缀数组3)后缀自动机附manacher最小表示法
分类:其他好文   时间:2015-01-21 22:20:33    阅读次数:192
POJ 1509 Glass Beads 后缀自动机
题目大意:给出一个环形的字符串,问从哪里开始是的这个字符串的字典序最小。 思路:最小表示法和后缀自动机的裸题,不过我是为了学后缀自动机才写的这个题,就没有去学最小表示法。 做法很简单,先建立一个后缀自动机,然后从根开始沿tranc指针从a->z走len次到达的点就是字典序最小的字符串的结尾点,求起始点只要减一下长度再+1即可。 对于后缀自动机的理解:http://wyfcyx...
分类:其他好文   时间:2015-01-17 10:04:22    阅读次数:197
137条   上一页 1 ... 10 11 12 13 14 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!