#P7021. [NWRRC2017] Consonant Fencity
[NWRRC2017] Consonant Fencity
题目描述
There are two kinds of sounds in spoken languages: vowels and consonants. Vowel is a sound, produced with an open vocal tract; and consonant is pronounced in such a way that the breath is at least partly obstructed. For example, letters a and are used to express vowel sounds, while letters and are the consonants (e.g . bad, pot).
a vowel (e.g . silly) or as a consonant (e.g . yellow). The letter , usually used as a consonant (e.g . wet) could produce a vowel after another vowel (e.g . growth) in English, and in some languages (e.g . Welsh) it could be even the only vowel in a word.
In this task, we consider and as vowels, so there are seven vowels in English alphabet: a , and , all other letters are consonants.
Let's define the consonant fencity of a string as the number of pairs of consecutive letters in the string which both are consonants and have different cases (lowercase letter followed by uppercase or vice versa). For example, the consonant fencity of a string CoNsoNaNts is , the consonant fencity of a string dEsTrUcTiOn is and the consonant fencity of string StRenGtH is .
You will be given a string consisting of lowercase English letters. Your task is to change the case of some letters in such a way that all equal letters will be of the same case (that means, no letter can occur in resulting string as both lowercase and uppercase), and the consonant fencity of resulting string is maximal.
输入格式
The only line of the input contains non-empty original string consisting of no more than lowercase English letters.
输出格式
Output the only line: the input string changed to have maximum consonant fencity.
题目大意
定义非辅音字母为 a
e
i
o
u
w
y
。
定义一个字符串的价值是连续两个大小写不同的辅音的个数。
给定一个小写字符串,试图改变若干个字母的大小写使得这个字符串的价值最大。
输出更改后的字符串。多解任意输出。
consonants
CoNsoNaNts
destruction
dEsTrUcTiOn
strength
StRenGtH
提示
Time limit: 3 s, Memory limit: 512 MB.