CF858C.Did you mean...
普及/提高-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Beroffice text editor has a wide range of features that help working with text. One of the features is an automatic search for typos and suggestions of how to fix them.
Beroffice works only with small English letters (i.e. with 26 letters from a to z). Beroffice thinks that a word is typed with a typo if there are three or more consonants in a row in the word. The only exception is that if the block of consonants has all letters the same, then this block (even if its length is greater than three) is not considered a typo. Formally, a word is typed with a typo if there is a block of not less that three consonants in a row, and there are at least two different letters in this block.
For example:
- the following words have typos: "hellno", "hackcerrs" and "backtothefutttture";
- the following words don't have typos: "helllllooooo", "tobeornottobe" and "oooooo".
When Beroffice editor finds a word with a typo, it inserts as little as possible number of spaces in this word (dividing it into several words) in such a way that each of the resulting words is typed without any typos.
Implement this feature of Beroffice editor. Consider the following letters as the only vowels: 'a', 'e', 'i', 'o' and 'u'. All the other letters are consonants in this problem.
Beroffice 文本编辑器具有丰富的文本处理功能。其中一项功能是自动检测拼写错误,并给出修改建议。
Beroffice 仅支持小写英文字母(即从 a 到 z 的 26 个字母)。Beroffice 认为一个单词存在拼写错误,当且仅当该单词中连续出现了三个或更多辅音字母。唯一的例外是:如果这一连续的辅音块中所有字母都相同,那么即使其长度超过三,也不视为拼写错误。形式化地说,一个单词存在拼写错误,当且仅当存在一个长度不小于 3 的连续辅音子串,且该子串中至少包含两个不同的字母。
例如:
- 以下单词存在拼写错误:“hellno”、“hackcerrs” 和 “backtothefutttture”;
- 以下单词不存在拼写错误:“helllllooooo”、“tobeornottobe” 和 “oooooo”。
当 Beroffice 编辑器发现一个存在拼写错误的单词时,它会在该单词中插入尽可能少的空格(将其分割为若干个单词),使得分割后得到的每个单词均不再含有拼写错误。
请实现 Beroffice 编辑器的这一功能。本题中,仅将以下字母视为元音:'a'、'e'、'i'、'o' 和 'u';其余所有字母均为辅音。
输入格式
The only line contains a non-empty word consisting of small English letters. The length of the word is between 1 and 3000 letters.
唯一的一行包含一个非空单词,该单词由小写英文字母组成。单词的长度在 1 到 3000 个字母之间。
输出格式
Print the given word without any changes if there are no typos.
If there is at least one typo in the word, insert the minimum number of spaces into the word so that each of the resulting words doesn't have any typos. If there are multiple solutions, print any of them.
如果单词中没有拼写错误,则原样输出该单词。
如果单词中至少存在一个拼写错误,则在该单词中插入最少数量的空格,使得分割后得到的每个单词均无拼写错误。若存在多种解法,输出任意一种即可。
输入输出样例
输入#1
hellno
输出#1
hell no
输入#2
abacaba
输出#2
abacaba
输入#3
asdfasdf
输出#3
asd fasd f
输入解题思路,AI测评打分。不知道怎么写?