自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

scf0920

退役ACMer渣

  • 博客(9)
  • 收藏
  • 关注

原创 vim配置文件(持续更新

刚学会用vim,真的很强大很好用的感觉。自己写了一点配置文件,今后会持续更新。"vim环境变量设置 set nu "显示行号 set hlsearch "搜索时关键字高亮反白 set backspace=2 "允许退格键删除 set autoindent "自动缩进 set showmode "显

2015-11-26 12:19:00 646

原创 HDU 3065 病毒侵袭持续中 (AC自动机)

题目地址:HDU 3065 裸的AC自动机。由于AC自动机的指针是不断回溯的,所以对于AA在AAA中算两次的问题完全不用担心,当在第二个A中+1后,指针会再次回溯到A上,然后当到第三个A的时候,会再记录一次。 代码如下:#include <iostream> #include <string.h> #include <math.h> #include <queue> #include <algo

2015-11-06 19:36:21 644

原创 HDU 2896 病毒侵袭 (AC自动机)

题目地址:HDU 2896 AC自动机模板题。 记录每个终止节点的ID。然后在自动机里找就行了。 代码如下:#include <iostream> #include <string.h> #include <math.h> #include <queue> #include <algorithm> #include <stdlib.h> #include <map> #include <set

2015-11-05 21:23:27 488

原创 HDU 2222 Keywords Search (AC自动机)

题目地址:HDU 2222 AC自动机第一发!真好奇这些算法是怎么被发明的。。算法的魅力真是无穷。 这题是AC自动机模板题。自己实在写不出来,比着kuangbin的模板写的= = 代码如下:#include <iostream> #include <string.h> #include <math.h> #include <queue> #include <algorithm> #includ

2015-11-05 20:35:01 447

原创 POJ 1226 Substrings (后缀数组)

题目地址:POJ 1226 将每一个字符串反转连接一次,再把所有字符串都连接起来,然后二分,找最大长度。注意与反转字符串之间不能直接相连。 代码如下:#include <iostream> #include <string.h> #include <math.h> #include <queue> #include <algorithm> #include <stdlib.h> #include

2015-11-03 12:36:35 475

原创 POJ 3294 Life Forms (后缀数组)

题目地址:POJ 3294 把所有字符串连在一块,并用一个从未出现的字符隔开,注意这个每两个之间的用来隔开的字符也不能重复,除非对1个的时候进行特判。 然后二分长度,然后判断这个长度下能否有出现次数超过n/2次的,可以对其分组然后hash判断。找出最大长度之后,再用同样的方法从头找一遍,然后把符合要求的输出、 代码如下:#include <iostream> #

2015-11-02 23:36:28 560

原创 POJ 1743 Musical Theme (后缀数组)

题目地址:POJ 1743 二分长度,由于相似的都挨在一块,所以需要判断大于等于mid的区间的位置最左端与最右端是否大于mid. 代码如下:#include <iostream> #include <string.h> #include <math.h> #include <queue> #include <algorithm> #include <stdlib.h> #include <map

2015-11-02 21:12:59 533

原创 SPOJ 705 New Distinct Substrings (后缀数组)

后缀数组模板题。由于height数组是指与排名上一个的公共前缀,所以重复的个数是height[i]个,考虑当前这个字母所构成的子串的贡献即为n-sa[i]-height[i],然后累加即可。 代码如下:#include <iostream> #include <string.h> #include <math.h> #include <queue> #include <algorithm> #in

2015-11-02 19:47:57 584

原创 Ural 1297 Palindrome (后缀数组)

题目地址:Ural 1297 后缀数组模板题。把字符串倒过来接到字符串后面,并在中间加一个从未出现的字符。然后用后缀数组就可以了。 代码如下:#include <iostream> #include <string.h> #include <math.h> #include <queue> #include <algorithm> #include <stdlib.h> #include <ma

2015-11-02 19:06:10 577

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除