CF733A.Grasshopper And the String
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
One day, the Grasshopper was jumping on the lawn and found a piece of paper with a string. Grasshopper became interested what is the minimum jump ability he should have in order to be able to reach the far end of the string, jumping only on vowels of the English alphabet. Jump ability is the maximum possible length of his jump.
Formally, consider that at the begginning the Grasshopper is located directly in front of the leftmost character of the string. His goal is to reach the position right after the rightmost character of the string. In one jump the Grasshopper could jump to the right any distance from 1 to the value of his jump ability.
The picture corresponds to the first example.
The following letters are vowels: 'A', 'E', 'I', 'O', 'U' and 'Y'.
一天,蚱蜢在草坪上跳跃时发现了一张纸,上面写着一个字符串。蚱蜢很好奇:为了仅在英语字母的元音字母上跳跃便能到达该字符串的最右端,它至少需要多大的跳跃能力?跳跃能力定义为一次跳跃所能达到的最大长度。
形式化地,假设蚱蜢初始时位于字符串最左侧字符的正前方。它的目标是到达字符串最右侧字符正后方的位置。每次跳跃,蚱蜢可以向右跳任意距离,但该距离必须在 1 到其跳跃能力(含)之间。
该图对应第一个样例。
以下字母被视为元音字母:'A'、'E'、'I'、'O'、'U' 和 'Y'。
输入格式
The first line contains non-empty string consisting of capital English letters. It is guaranteed that the length of the string does not exceed 100.
第一行包含一个非空字符串,该字符串由大写英文字母组成。保证字符串长度不超过 100。
输出格式
Print single integer a — the minimum jump ability of the Grasshopper (in the number of symbols) that is needed to overcome the given string, jumping only on vowels.
输出一个整数 a —— 蚱蜢所需的最小跳跃能力(以字符数量为单位),使其能够跳过给定字符串,且只能落在元音字母上。
输入输出样例
输入#1
ABABBBACFEYUKOTT
输出#1
4
输入#2
AAA
输出#2
1
输入解题思路,AI测评打分。不知道怎么写?