Advertisement

Codeforces1092C. 前缀和后缀——思维与字符串处理

阅读量:

C. Prefixes and Suffixes

Ivan wants to play a game with you. He picked some string s of length n consisting only of lowercase Latin letters.

You don’t know this string. Ivan has informed you about all its improper prefixes and suffixes (i.e. prefixes and suffixes of lengths from 1 to n−1), but he didn’t tell you which strings are prefixes and which are suffixes.

Ivan wants you to guess which of the given 2n−2 strings are prefixes of the given string and which are suffixes. It may be impossible to guess the string Ivan picked (since multiple strings may give the same set of suffixes an

全部评论 (0)

还没有任何评论哟~