CF908A.New Year and Counting Cards
入门
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Your friend has n cards.
You know that each card has a lowercase English letter on one side and a digit on the other.
Currently, your friend has laid out the cards on a table so only one side of each card is visible.
You would like to know if the following statement is true for cards that your friend owns: "If a card has a vowel on one side, then it has an even digit on the other side." More specifically, a vowel is one of 'a', 'e', 'i', 'o' or 'u', and even digit is one of '0', '2', '4', '6' or '8'.
For example, if a card has 'a' on one side, and '6' on the other side, then this statement is true for it. Also, the statement is true, for example, for a card with 'b' and '4', and for a card with 'b' and '3' (since the letter is not a vowel). The statement is false, for example, for card with 'e' and '5'. You are interested if the statement is true for all cards. In particular, if no card has a vowel, the statement is true.
To determine this, you can flip over some cards to reveal the other side. You would like to know what is the minimum number of cards you need to flip in the worst case in order to verify that the statement is true.
你的朋友有 n 张卡片。
你知道每张卡片的一面是一个小写英文字母,另一面是一个数字。
目前,你的朋友将这些卡片平铺在桌面上,使得每张卡片仅有一面可见。
你想判断以下命题对你的朋友所拥有的所有卡片是否成立:“如果一张卡片的一面是元音字母,则其另一面是偶数数字。”更具体地说,元音字母是 'a'、'e'、'i'、'o' 或 'u' 中的一个;偶数数字是 '0'、'2'、'4'、'6' 或 '8' 中的一个。
例如,若一张卡片一面是 'a',另一面是 '6',则该命题对该卡片成立。又如,一面是 'b'、另一面是 '4' 的卡片,以及一面是 'b'、另一面是 '3' 的卡片(因为字母不是元音),该命题也成立。而一面是 'e'、另一面是 '5' 的卡片则使该命题不成立。你关心的是该命题是否对所有卡片均成立。特别地,若没有任何一张卡片的一面是元音字母,则该命题视为成立。
为了验证这一点,你可以翻转若干张卡片以查看其另一面。你希望知道:在最坏情况下,为确认该命题成立,你最少需要翻转多少张卡片?
输入格式
The first and only line of input will contain a string s (1 ≤ |s| ≤ 50), denoting the sides of the cards that you can see on the table currently. Each character of s is either a lowercase English letter or a digit.
输入仅有一行,包含一个字符串 $ s ( 1 \leq |s| \leq 50 $),表示你当前在桌面上能看到的卡片的面。字符串 $ s $ 的每个字符均为小写英文字母或数字。
输出格式
Print a single integer, the minimum number of cards you must turn over to verify your claim.
输出一个整数,即为验证你的声明所需翻转的最少卡片数量。
输入输出样例
输入#1
ee
输出#1
2
输入#2
z
输出#2
0
输入#3
0ay1
输出#3
2
说明/提示
In the first sample, we must turn over both cards. Note that even though both cards have the same letter, they could possibly have different numbers on the other side.
In the second sample, we don't need to turn over any cards. The statement is vacuously true, since you know your friend has no cards with a vowel on them.
In the third sample, we need to flip the second and fourth cards.
在第一个样例中,我们必须翻转两张卡片。注意,尽管两张卡片上的字母相同,但它们背面的数字可能不同。
在第二个样例中,我们无需翻转任何卡片。该命题是空真(vacuously true)的,因为你已知你的朋友没有任何元音字母的卡片。
在第三个样例中,我们需要翻转第二张和第四张卡片。
输入解题思路,AI测评打分。不知道怎么写?