As is known to all, Wells doesn't have a good command of English. As a result, some unfamiliar words, which may cause sadness of Wells, is called tragedy words. In more detail, a word will be defined as a tragedy word, if and only if when it satisfies all following conditions.
First, it only contain uppercase letter.
Second, it doesn't contain three consecutive vowel(AEIOU) or three consecutive consonant(the other 21 letter).
And last of all, it should contain at least one special tragedy letter 'L'.
Now, you are given a word, which consists of uppercase letter or underline, and you are allow to fill each underline with one uppercase letter. And in order to make fun of Wells, you want to know how many tragedy words you can make in this way.
Input
For each test, only contains a line of one word, which consists of uppercase letter and underline(’_’).
The total length of each word will not exceed 100, and the number of underline(’_’) will not exceed 10.
Output
For each test, print one line, which contains a integer as the total amount of tragedy words you can make.
Notice: the number may be very large and may exceed the 32-bits unsigned integer.
Sample Input
V__KV_KSample Output
100Hint
The vowel means 'A','E','I','O','U'
The consonant means the other 21 letter.
The special tragedy letter 'L' still belongs to consonant.
Of course, the letter here means English letters, not other language letters.
题意:输入时只包含大写字母和下划线的字符串,要在下划线的位置填入大写字母,要求填完后字符串满足:1.没有3个辅音或元音字母相连,至少有一个L。输出方案数
思路:可以把字母分成两种元音(5)、辅音(21),DFS一个下划线一个下划线地填上元音或辅音,如果填入元音可以则结果*5,如果填入辅音可以则结果*21,中间要特殊处理L
也可以分成三种元音(5)、辅音(20)、L,思路和上面差不多,就L的处理稍有不同
#include#include #include #include #include #include #include #include