当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

BZOJ3499:PA2009 Quasi-template

题目描述

定义一个串s能匹配S当且仅当s能可超出头尾得覆盖S。  如下图。
  
给定S,问不同的s的个数。
S的长度 <  = 200000。

输入解释

The only line of the standard input contains a non-empty word that is not longer than 200000 letters. It consists of small letters of English alphabet.

输出解释

The first line of the standard output should contain the number of quasi-templates of word v. The second line should contain the shortest word being a quasi-template of word v . If there is more than one such shortest word, output the lexicographically smallest from the shortest quasi-templates.

输入样例
aaaabaabaaaba
输出样例
10
aabaa
提示



The word from the sample input has 10 quasi-templates: aaaabaabaaab, aaaabaabaaaba, aaabaaba, aaabaabaa, aaabaabaaa, aaabaabaaaba, aabaa, aabaabaa, aabaabaaa, and abaabaaa.


 

BZPRO Powered by Remmina.
Github Repository
来自acmore.cc的附加信息
bzoj_id 3499
import_source_sha256 a2f05e7611c357de9bccafce8697a5a9cc9024f0e96fa251e34bb6aa0597b3ba
bzoj_checker_pending False

该题目包含在题集 大视野(八中)OJ 中

题目来源 BZOJ 3499

源链接: LOCAL-BZOJ3499

共提交 0 次

通过率 --%
时间上限 内存上限
10000 MS 256 MB