CF174B.File List

普及/提高-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Eudokimus, a system administrator is in trouble again. As a result of an error in some script, a list of names of very important files has been damaged. Since they were files in the BerFS file system, it is known that each file name has a form "name.ext", where:

  • name is a string consisting of lowercase Latin letters, its length is from 1 to 8 characters;
  • ext is a string consisting of lowercase Latin letters, its length is from 1 to 3 characters.

For example, "read.me", "example.txt" and "b.cpp" are valid file names and "version.info", "ntldr" and "contestdata.zip" are not.

Damage to the list meant that all the file names were recorded one after another, without any separators. So now Eudokimus has a single string.

Eudokimus needs to set everything right as soon as possible. He should divide the resulting string into parts so that each part would be a valid file name in BerFS. Since Eudokimus has already proved that he is not good at programming, help him. The resulting file list can contain the same file names.

系统管理员尤多基穆斯(Eudokimus)又遇到麻烦了。由于某段脚本中存在错误,一份包含若干极其重要文件名称的列表被损坏了。这些文件均位于 BerFS 文件系统中,因此已知每个文件名的格式均为 "name.ext",其中:

  • name 是一个由小写拉丁字母组成的字符串,长度为 11 至 88 个字符;
  • ext 是一个由小写拉丁字母组成的字符串,长度为 11 至 33 个字符。

例如,"read.me"、"example.txt" 和 "b.cpp" 是合法的文件名,而 "version.info"、"ntldr" 和 "contestdata.zip" 则不是。

列表损坏后,所有文件名被连续拼接成一个长字符串,中间没有任何分隔符。因此,尤多基穆斯现在仅拥有这样一个单一字符串。

尤多基穆斯需要尽快修复一切。他应当将该字符串划分为若干段,使得每一段都是 BerFS 中的一个合法文件名。由于尤多基穆斯早已证明自己不擅长编程,请你帮他完成这项任务。最终得到的文件列表中允许出现重复的文件名。

输入格式

The input data consists of a single string s, its length is from 1 to 4·105 characters. The string can contain only lowercase Latin letters ('a' - 'z') and periods ('.').

输入数据为一个字符串 ss,其长度在 11 到 4×1054 \times 10^5 个字符之间。该字符串仅包含小写拉丁字母('a'–'z')和英文句点('.')。

输出格式

In the first line print "YES" (without the quotes), if it is possible to divide s into parts as required. In this case, the following lines should contain the parts of the required partition, one per line in the order in which they appear in s. The required partition can contain the same file names. If there are multiple solutions, print any of them.

If the solution does not exist, then print in a single line "NO" (without the quotes).

第一行输出 "YES"(不带引号),表示可以将字符串 ss 按要求划分为若干部分。此时,后续各行应依次输出所要求划分的各部分,每行一个,顺序与它们在 ss 中出现的顺序一致。所要求的划分中可以包含相同的文件名。若存在多种解,输出任意一种即可。

若不存在满足条件的解,则单行输出 "NO"(不带引号)。

输入输出样例

  • 输入#1

    read.meexample.txtb.cpp

    输出#1

    YES
    read.m
    eexample.t
    xtb.cpp
  • 输入#2

    version.infontldrcontestdata.zip

    输出#2

    NO

输入解题思路,AI测评打分。不知道怎么写?

首页