
CF
翛醨
这个作者很懒,什么都没留下…
展开
-
CF8B Train and Peter
好像这题只有我这个憨憨在写KMP欸. 首先明确,题意是说将两个字符串与一个主串进行匹配,而且这两个字符串在主串中的位置顺序不能变. 那么显然,可以用 KMP ,我们先匹配第一个串,要保证两个串的顺序,那么我们就可以在第一个串匹配成功时往后匹配第二个串,如果匹配不成功说明第二个串在后面没有出现过,那么就可以确定以当前方向不能够看到 Peter 所看到的串. 那么再用reversereversereverse函数把主串翻转,接着按照之前的方法再进行一次 KMP 匹配. 这样我们就可以得到在两个方向上是否能够看到原创 2020-12-02 19:14:17 · 240 阅读 · 0 评论 -
CF 1C.Ancient Berland Circus
有点慢的CF Description Nowadays all circuses in Berland have a round arena with diameter 13 meters, but in the past things were different. In Ancient Berland arenas in circuses were shaped as a regular (equiangular) polygon, the size and the number of angles c原创 2020-11-23 16:24:08 · 211 阅读 · 0 评论