QOJ.ac

QOJ

実行時間制限: 1 s メモリ制限: 1024 MB 満点: 100

#3492. 豌豆汤与煎饼

統計

作为一个瑞典人,你对传统的周四午餐——豌豆汤和煎饼有着深厚的感情。事实上,你非常喜欢它,只要有它供应,你就会把它当作任何一顿饭来吃。你每天都会查看所有你最喜欢的餐厅的菜单,看看是否有这种组合,并意识到你可以用一个程序更轻松地完成这项工作。给定一份餐厅菜单列表,请决定去哪里吃饭。

输入格式

输入的第一行包含一个数字 $n$ ($1 \le n \le 10$),表示餐厅的数量。接下来是 $n$ 个餐厅的菜单。每个菜单以一行包含数字 $k$ ($1 \le k \le 10$) 开头,表示当天的菜单项数量。菜单的其余部分包含 $k+1$ 行,每行包含一个最多 100 个字符的非空字符串。这些行中的第一行是餐厅名称,其余的是菜单项。字符串仅由小写字母 ‘a’-‘z’ 和空格组成,并且总是以字母开头和结尾。所有餐厅名称都是唯一的。

输出格式

输出一行。如果至少有一家餐厅同时提供 “pea soup” 和 “pancakes” 作为菜单项,则输出这些餐厅中第一家餐厅的名称(按餐厅在输入中出现的顺序)。否则,输出 “Anywhere is fine I guess”。

样例

输入 1

2
2
q
potatoes
salad
3
nymble
pancakes
pea soup
punsch

输出 1

nymble

输入 2

4
2
asian wok house
paa soup
pancakes
2
kebab kitchen
pea soup
pancakes
2
la campus
tasty pea soup
pancakes
3
slime stand
slime
pea soup and pancakes
slime

输出 2

Anywhere is fine I guess

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.