P3538 [POI 2012] OKR-A Horrible Poem

题目描述

Bytie 小男孩必须背诵一段特定的诗。按照现代艺术的最佳风格,这首诗是一个仅由小写英文字母组成的长字符串。显然,它听起来很糟糕,但这不是 Bytie 最担心的问题。 首先,他完全忘记了他应该背诵哪一段。而且所有段落看起来都很难记住…… 然而,还有希望:诗的一些部分表现出某种规律性。特别是,有时一个片段,比如 ![](http://main.edu.pl/images/OI19/okr-en-tex.1.png),只是另一个片段的多次重复,比如 ![](http://main.edu.pl/images/OI19/okr-en-tex.2.png)(换句话说,![](http://main.edu.pl/images/OI19/okr-en-tex.3.png),即 ![](http://main.edu.pl/images/OI19/okr-en-tex.4.png),其中 ![](http://main.edu.pl/images/OI19/okr-en-tex.5.png) 是一个整数)。在这种情况下,我们说 ![](http://main.edu.pl/images/OI19/okr-en-tex.6.png) 是 ![](http://main.edu.pl/images/OI19/okr-en-tex.7.png) 的完整周期(特别地,每个字符串都是它自己的完整周期)。 如果给定的片段有一个短的完整周期,Bytie 的任务将会很简单。问题是……那段片段是哪一段? 为 Bytie 做个礼物——编写一个程序,读取整首诗以及 Bytie 怀疑可能是他应该背诵的片段列表,并为每个片段确定其最短的完整周期。

输入格式

输出格式

说明/提示

题面翻译由 ChatGPT-4o 提供。