随笔分类 -  字符串

HDU 5785 interesting
摘要:给你一个字符串,问满足i<=j<k并且【i,j】和【j,k】都是回文的时候,i*k的sum值是多少。 看了网上的做法,基本都是每个点算贡献,但是有的记录起来比较考验代码能力。 其中有一种做法是这样的: 首先,推公式,自然不用说。由于每个i*k必然出现在一个以j为中心的双回文串中,所以直接统计左右以当 阅读全文

posted @ 2016-08-03 21:10 very_czy 阅读(218) 评论(0) 推荐(0)

准备学习后缀数组 先存一个论文里的模板
摘要:#include #include #include #include #include using namespace std; #define F(x) ((x) / 3 + ((x) % 3 == 1 ? 0 : tb)) #define G(x) ((x) = 0 ; i--) b[--wsd[wv[i]]] = a[i]; } void dc3(int *r,int *... 阅读全文

posted @ 2016-08-03 14:45 very_czy 阅读(194) 评论(0) 推荐(0)

codeforces 701C They Are Everywhere
摘要:问:包含全部种类的连续字符串的最短长度是多少。 写完了才知道写的是双指针。叫two pointer。 以前也写过,今天算是存个档吧~。 阅读全文

posted @ 2016-07-25 17:33 very_czy 阅读(178) 评论(0) 推荐(0)

一发kuangbin~~AC自动机版子,带注解,计数的作用。
摘要:屌丝的字典树。。。醉了。。。 #include #include #include #include #include #include #include using namespace std; struct Trie { int next[500010][26],fail[500010],isend[500010]; int root,L; int ... 阅读全文

posted @ 2016-06-02 11:43 very_czy 阅读(441) 评论(0) 推荐(0)

导航