CF56A.Bar
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
According to Berland laws it is only allowed to sell alcohol to people not younger than 18 years. Vasya's job is to monitor the law's enforcement. Tonight he entered a bar and saw n people sitting there. For every one of them Vasya happened to determine either the age or the drink the person is having. Vasya can check any person, i.e. learn his age and the drink he is having at the same time. What minimal number of people should Vasya check additionally to make sure that there are no clients under 18 having alcohol drinks?
The list of all alcohol drinks in Berland is: ABSINTH, BEER, BRANDY, CHAMPAGNE, GIN, RUM, SAKE, TEQUILA, VODKA, WHISKEY, WINE
根据贝尔兰法律,仅允许向年满18周岁的人出售酒精饮料。瓦西娅的工作是监督该法律的执行情况。今晚他进入一家酒吧,看到其中有 n 个人就座。对于其中每个人,瓦西娅恰好已知其年龄或其所饮用的饮料(二者之一)。瓦西娅可以检查任意一个人,即同时获知此人的年龄及其所饮用的饮料。那么,瓦西娅至少还需额外检查多少人,才能确保没有任何未满18周岁的顾客正在饮用酒精饮料?
贝尔兰所有酒精饮料的列表如下:ABSINTH、BEER、BRANDY、CHAMPAGNE、GIN、RUM、SAKE、TEQUILA、VODKA、WHISKEY、WINE
输入格式
The first line contains an integer n (1 ≤ n ≤ 100) which is the number of the bar's clients. Then follow n lines, each describing one visitor. A line either contains his age (an integer from 0 to 1000) or his drink (a string of capital Latin letters from 1 to 100 in length). It is guaranteed that the input data does not contain spaces and other unnecessary separators.
Only the drinks from the list given above should be considered alcohol.
第一行包含一个整数 n(1≤n≤100),表示酒吧顾客的数量。接下来有 n 行,每行描述一位访客。每行要么包含其年龄(一个介于 0 到 1000 之间的整数),要么包含其饮品(一个由大写拉丁字母组成的字符串,长度为 1 到 100)。保证输入数据中不包含空格及其他不必要的分隔符。
仅上述列表中所列的饮品才被视为含酒精饮品。
输出格式
Print a single number which is the number of people Vasya should check to guarantee the law enforcement.
输出一个数字,表示瓦西娅为确保执法而需要检查的人数。
输入输出样例
输入#1
5 18 VODKA COKE 19 17
输出#1
2
说明/提示
In the sample test the second and fifth clients should be checked.
在样例测试中,应检查第二个和第五个客户端。
输入解题思路,AI测评打分。不知道怎么写?