Secretary Time Limit: 1000ms Memory Limit: 65536KB This problem will be judged on PKU. Original ID: 221764-bit integer IO format: %lld Java class name: Main The basic condition of success of a political party, it is the good Election Program…
题目链接 题意:可重叠的 k 次最长重复子串.给定一个字符串,求至少出现 k 次的最长重复子串,这 k 个子串可以重叠. 分析:与POJ 1743做法类似,先二分答案,height数组分段后统计 LCP>=m 的子串的个数. #include <cstdio> #include <cstring> #include <algorithm> const int N = 2e4 + 5; int sa[N], rank[N], height[N]; int t[N],…
题目链接 题意:连续重复子串.给定一个字符串 L,已知这个字符串是由某个字符串 S 重复 R 次而得到的(L = S^R ), 求 R 的最大值. 分析:枚举长度,判断条件是能被总长度整除且LCP (suffix (0), suffix (i)) = n - i,预处理出lcp,方法是,lcp[i] = min (height[rank[i]] to height[rank[0]]); DC3算法,C++提交才能AC. #include<cstdio> #include<cstring&…
Long Long Message Description The little cat is majoring in physics in the capital of Byterland. A piece of sad news comes to him these days: his mother is getting ill. Being worried about spending so much on railway tickets (Byterland is such a bi…
Time Limit: 4000MS Memory Limit: 131072K Total Submissions: 24756 Accepted: 10130 Case Time Limit: 1000MS Description The little cat is majoring in physics in the capital of Byterland. A piece of sad news comes to him these days: his mother is ge…
Language: Default Long Long Message Time Limit: 4000MS Memory Limit: 131072K Total Submissions: 21228 Accepted: 8708 Case Time Limit: 1000MS Description The little cat is majoring in physics in the capital of Byterland. A piece of sad news comes…
Milk Patterns Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 7586 Accepted: 3448 Case Time Limit: 2000MS Description Farmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation,…
永恒的大牛,kuangbin,膜拜一下,Orz 链接:http://www.cnblogs.com/kuangbin/archive/2013/04/23/3039313.html Musical Theme Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 14334 Accepted: 4945 Description A musical melody is represented as a sequence of…
Musical ThemeTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://poj.org/problem?id=1743 Description A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It…
http://poj.org/problem?id=3415 Common Substrings Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 5805 Accepted: 1911 Description A substring of a string T is defined as: T(i, k)=TiTi+1...Ti+k-1, 1≤i≤i+k-1≤|T|. Given two strings A, B an…
http://poj.org/problem?id=2406 Power Strings Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 27003 Accepted: 11311 Description Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = &q…