begin lydsy 2731】的更多相关文章

2731: 最长重复子串 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 6  Solved: 4[Submit][Status][Web Board] Description 如果一个串x在S中出现,并且xx也在S中出现,那么x就叫做S的重复子串. 输入长度为n的串S,求它的最长重复子串.  Input 首先给出字符串长度,其小于等于30000,接下来一个字符串 Output 如题  Sample Input 12 ABBABBCBCCCC Sam…
2774: Poi2000 病毒 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 5  Solved: 4[Submit][Status][Web Board] Description 二进制病毒审查委员会最近发现了如下的规律:某些确定的二进制串是病毒的代码.如果某段代码中不存在任何一段病毒代码,那么我们就称这段代码是安全的.现在委员会已经找出了所有的病毒代码段试问,是否存在一个无限长的安全的二进制代码.示例:例如如果{011, 11, 00000}…
2770: PKU2503 Babelfish Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 2  Solved: 2[Submit][Status][Web Board] Description You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialectof a foreign language. Fortun…
2768: Zju1290 Word-Search Wonder Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 4  Solved: 2[Submit][Status][Web Board] Description The Pyrates Restaurant was starting to fill up as Valentine McKee walked in. She scanned the crowd for her sister, bro…
题目链接:http://begin.lydsy.com/JudgeOnline/problem.php?id=1328 题意: 给你一个长度为n的正整数序列. 可以选任意个数字,只能从左往右选. 偶数步答案加上这个数,奇数步减去这个数. 问你最大答案. 题解: 对于一个递减区间,只能加上最高,减去最低,在中间部分不可能有操作(会使答案减小). 例如: [0,4]段单调递减. 如果加上a[0],减去a[4],则在[0,4]这段区间内不可能再有任何有用的选择. 所以贪心策略: 找出每一个递减区间,加…
F.A.Qs Home Discuss ProblemSet Status Ranklist Contest ModifyUser  hyxzc Logout 捐赠本站 Notice:1:由于本OJ建立在Linux平台下,而许多题的数据在Windows下制作,请注意输入.输出语句及数据类型及范围,避免无谓的RE出现. 2:本站即将推出针对初学者的试题系统(与目前OJ是分开的,互不影响),内容覆盖从语法入门到NOI的所有知识点,网址是http://begin.lydsy.com/JudgeOnli…
http://begin.lydsy.com/JudgeOnline/problem.php?id=2604   Description 总部最近打算向下面的N个工作人员发出了一条秘密消息.因为它是机密,所以只能一对一的传递消息,也就是说每一个人知道消息之后只能把消息传给他能够传达到的且还未知道该消息的若干个人中的一个.对于A.B两个人,可能存在A能够传消息给B,而B无法传消息给A的情况.现在总部为了防止消息被泄露,命令你计算最开始总部至少要告诉多少人消息,才能保证最终所有人都知道了这个消息.…
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> using namespace std; #define maxn 100005 #define maxm 2000000 int na,nb,now[maxm],prep[maxn],val[maxn]; void read(int &x){ x=; ; char ch; ; +ch-'; x*…
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; #define maxn 100005 #define maxk 256 int n,type,ans,sum,a[maxn],f[maxk][maxk],g[maxk][maxk]; bool v[maxk]; ];…
#include <iostream> #include <cstdio> #include <cmath> #include <algorithm> #include <cstring> #define maxn 4005 #define maxm 2005 using namespace std; ],dist[maxn]; char st[maxm]; struct Tsegment{ int ans[maxn]; ;} int newno…