HDU1299&&SPOJ - KPEQU(找因子来找解的个数)...
分类:
其他好文 时间:
2015-06-22 14:58:03
阅读次数:
111
题目大意:给定一个字符串,求每个对应的长度能产生的相同子串的最大个数这里构建好后缀自动机之后,再将整个字符串从头到尾扫一遍,然后将每个对应的点上的sc值+1表示从头走到尾的前提下,所能产生的子串能够得到的最大数量为1然后再去考虑其他子串每个后缀自动机上的节点上的长度表示的是当前点所能接收的最大长度的...
分类:
其他好文 时间:
2015-06-20 17:07:18
阅读次数:
219
这里用第一个字符串构建完成后缀自动机以后不断用第二个字符串从左往右沿着后缀自动机往前走,如能找到,那么当前匹配配数加1如果找不到,那么就不断沿着后缀树不断往前找到所能匹配到当前字符的最大长度,然后将cur节点转移到当前节点即可,再把答案加1记住不断更新所能得到的最大值 1 #include 2 #....
分类:
其他好文 时间:
2015-06-19 01:14:35
阅读次数:
222
题目大意:一座村庄有N户人家。只有第一家可以连上互联网,其他人家要想上网必须拉一根缆线通过若干条街道连到第一家。每一根完整的缆线只能有一种颜色。网管有一个要求,各条街道内不同人家的缆线必须不同色,且总的不同颜色种数最小。求在指定的K户人家都能上网的前提下,最小的不同颜色种数。(1 <= N <= 5...
分类:
Web程序 时间:
2015-06-13 12:47:56
阅读次数:
130
As you are probably well aware, in Byteland it is always the military officer's main worry to order his soldiers on parade correctly. In Bitland ordering soldiers is not really such a problem. If a pl...
分类:
其他好文 时间:
2015-06-11 14:47:40
阅读次数:
100
Description
You are the King of Byteland. Your agents have just intercepted a batch of encrypted enemy messages concerning the date of the planned attack on your island. You immedietaly send for ...
分类:
编程语言 时间:
2015-06-08 13:30:27
阅读次数:
129
题目大意:给定n个数,再给q个区间询问,希望在区间s,t中找到一段连续的子序列使其和最大因为询问上万,节点数50000,明显是用线段树去做,这里很明显的区间更新,唯一写起来有点恶心的是询问每一个区间的最大都要跟左右区间的左最大右最大有关系反正时要注意细节了,查询的时候同时要查询其左右连续最大自己的错...
分类:
其他好文 时间:
2015-06-06 20:44:26
阅读次数:
126
树链剖分
把边权的模板也敲了一下
关键在于弄明白点和边的对应关系
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define out(x) cout<<#x<<": "<<x<<e...
分类:
其他好文 时间:
2015-06-05 10:20:41
阅读次数:
125
扩展BSGS Orz zyf……然而他的题解对AC大神的题解作了引用……而坑爹的百度云……呵呵了。。。 扩展BSGS模板题 1 /************************************************************** 2 Problem: 2480 ...
分类:
其他好文 时间:
2015-06-03 21:25:47
阅读次数:
130
Description
Given a string, we need to find the total number of its distinct substrings.
Input
T- number of test cases. T
Each test case consists of one string, whose length is
Output
For e...
分类:
编程语言 时间:
2015-05-29 15:46:00
阅读次数:
120