F - The Minimum Length
Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%lld & %llu
Submit Status
Description
There is a string A. The length of A is less than 1,000,000. I rewrite it aga...
分类:
其他好文 时间:
2015-04-17 11:45:01
阅读次数:
137
Tavas is a strange creature. Usually "zzz" comes out of people's mouth while sleeping, but string s of
length n comes out from Tavas' mouth instead.
Today Tavas fell asleep in Malekas' place. W...
分类:
其他好文 时间:
2015-04-16 23:46:03
阅读次数:
233
题目链接:BZOJ - 3620题目分析这道题使用 KMP 做 O(n^2) 的暴力就能过。首先,我们依次枚举字串左端点 l ,然后从这个左端点开始向后做一次 KMP。然后我们枚举右端点 r,符合条件的右端点 r 就是 S[l..r] 这一段的一个前缀和后缀相同,并且这一部分的长度 x 要满足 k ...
分类:
其他好文 时间:
2015-04-16 23:33:26
阅读次数:
170
B - Oulipo
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
The French author Georges Perec (1936?1982) once wrote a book, La disparition, without t...
分类:
其他好文 时间:
2015-04-16 22:01:49
阅读次数:
166
C - 剪花布条
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?
Input
输入中含有一...
分类:
其他好文 时间:
2015-04-16 21:59:28
阅读次数:
131
D - Cyclic Nacklace
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
CC always becomes very depressed at the end of this month, he has checked his c...
分类:
其他好文 时间:
2015-04-16 21:57:27
阅读次数:
215
E - Period
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
For each prefix of a given string S with N characters (each character has an ASCII code ...
分类:
其他好文 时间:
2015-04-16 21:55:41
阅读次数:
112
A - Number Sequence
Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ......
分类:
编程语言 时间:
2015-04-16 20:02:08
阅读次数:
154
题意:有两个夫妻,名字分别是a和b两个字符串,然后给孩子起名字,名字可以是父亲的名字前缀和母亲名字后缀相等的那部分,问可以给孩子起多少个名字。
题解:kmp中的next[i]数组记录了前i个字符前缀与后缀相等的长度是多少,那么可以利用这个特性,先把a和b拼接起来总长度是len,然后得到next数组,从next[len]往前找,前缀与后缀相等的串中是否还有前后缀相等串存在,一直到next[i] =...
分类:
其他好文 时间:
2015-04-16 01:33:03
阅读次数:
130
维护一个栈。。。如果栈顶出现了要被删除的字符串就全删掉就好了,判断的话。。。kmp就行了 1 /************************************************************** 2 Problem: 3942 3 User: rausen ...
分类:
其他好文 时间:
2015-04-16 00:58:00
阅读次数:
142