摘要:
"POJ" 题意:给一个01序列,现在随意拿出来一个区间,然后说出区间内含有奇数个1还是偶数个1,因为有可能存在假话,让你判断前多少条没有假话,也就是查找第一个假话的位置 1.序列长度$n include include include include include include include 阅读全文
摘要:
"洛咕" 题意:考虑一个约束满足问题的简化版本:假设$x1,x2,x3...$代表程序中出现的变量,给定$n(n include include include include include include include define ll long long using namespace s 阅读全文
摘要:
"LOJ" 题意:在给定的$n$个整数$a_1,a_2,...,a_n$之中选出两个并进行异或运算,得到的最大结果是多少?$n include include include include include include include define ll long long using name 阅读全文
摘要:
"洛咕" 题意:对于一个01字符串,如果将这个字符串0和1取反后,再将整个串反过来和原串一样,就称作“反对称”字符串.比如00001111和010101就是反对称的,1001就不是.现在给出一个长度为N的01字符串,求它有多少个子串是反对称的.$n include include include i 阅读全文
摘要:
"POJ" 题意:给定若干个长度小于等于$400000$的字符串,在每个字符串中求出既是前缀又是后缀的子串长度. 分析:字符串哈希记录前缀值,然后直接枚举长度,分别表示出前缀和后缀的哈希值,并判断是否相等即可. cpp include include include include include 阅读全文
摘要:
"POJ" 题意:给定若干个长度小于等于$1e6$的小写字母字符串,询问每个字符串最多由多少个相同的子串重复连接而成. 分析:字符串哈希记录字符串每一段的值.然后从小到大枚举$n$(设$n$为字符串的长度)的约数,判断每一段约数长度的哈希值是否相等即可. cpp include include in 阅读全文
摘要:
"POJ" 题意:多组数据,给定两个只含大写字母的字符串$S1,S2$,求$S1在$S2$中出现了多少次? 分析:字符串哈希模板题,我写了双哈希,好像一个就够了. cpp include include include include include include include include 阅读全文
摘要:
"POJ" 题意:在一块$n m$的网格状地面上,有一些格子是泥泞的,其它格子是干净的.现在需要用一些宽度为1,长度任意的木板把泥地盖住,同时不能盖住干净的地面,木板可以重叠,求最少需要多少块木板.$n,m include include include include include includ 阅读全文