301951: CF370B. Berland Bingo

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Berland Bingo

题意翻译

#### 题目描述 袋子里有 $100$ 个球,编号从 $1$ 到 $100$ 。有 $n$ 个人参与游戏,每人手上都有不超过 $100$ 张卡片,每张卡片上有一个不超过 $100$ 的正整数,**不同的两个人的卡片上的数字一定不同**。现在依次从袋子里取出这些球,每取出一个球,所有人就把数字跟这个球编号相同的卡片扔掉。只要一个人收手的卡片没有了,他就获胜,特别的,如果有多人同时没有卡片了,那么这些人都算输。 #### 输入解释: 第一行仅有一个正整数 $n (1\leq n\leq 100)$,表示参与游戏的人数,接下来的 $n$ 行,每行描述一名游戏者拥有卡片上的数字,每行的第一个数 $m_i (1\leq m_i \leq 100)$ 表示该名游戏者拥有卡片的数量,之后是 $m_i$ 个整数 $a_{i,1},a_{i,2},a_{i,3},…,a_{i,m_i}$ $(1\leq a_{i,k} \leq 100)$ 依次表示第 $i$ 名游戏者拥有各张卡片上的数字,数据保证每个人所有卡片上的数字不同。 #### 输出解释: 共有 $n$ 行,每行包含 `YES` 或 `NO`, 依次对用 $n$ 个游戏者的输赢状态, `YES` 表示赢了, `NO` 表示输了。 判断输赢的办法:这个人可否通过设计拿球的顺序以来保证自己赢。

题目描述

Lately, a national version of a bingo game has become very popular in Berland. There are $ n $ players playing the game, each player has a card with numbers. The numbers on each card are distinct, but distinct cards can have equal numbers. The card of the $ i $ -th player contains $ m_{i} $ numbers. During the game the host takes numbered balls one by one from a bag. He reads the number aloud in a high and clear voice and then puts the ball away. All participants cross out the number if it occurs on their cards. The person who crosses out all numbers from his card first, wins. If multiple people cross out all numbers from their cards at the same time, there are no winners in the game. At the beginning of the game the bag contains 100 balls numbered 1 through 100, the numbers of all balls are distinct. You are given the cards for each player. Write a program that determines whether a player can win the game at the most favorable for him scenario or not.

输入输出格式

输入格式


The first line of the input contains integer $ n $ ( $ 1<=n<=100 $ ) — the number of the players. Then follow $ n $ lines, each line describes a player's card. The line that describes a card starts from integer $ m_{i} $ ( $ 1<=m_{i}<=100 $ ) that shows how many numbers the $ i $ -th player's card has. Then follows a sequence of integers $ a_{i,1},a_{i,2},...,a_{i,mi} $ ( $ 1<=a_{i,k}<=100 $ ) — the numbers on the $ i $ -th player's card. The numbers in the lines are separated by single spaces. It is guaranteed that all the numbers on each card are distinct.

输出格式


Print $ n $ lines, the $ i $ -th line must contain word "YES" (without the quotes), if the $ i $ -th player can win, and "NO" (without the quotes) otherwise.

输入输出样例

输入样例 #1

3
1 1
3 2 4 1
2 10 11

输出样例 #1

YES
NO
YES

输入样例 #2

2
1 1
1 1

输出样例 #2

NO
NO

Input

题意翻译

#### 题目描述 袋子里有 $100$ 个球,编号从 $1$ 到 $100$ 。有 $n$ 个人参与游戏,每人手上都有不超过 $100$ 张卡片,每张卡片上有一个不超过 $100$ 的正整数,**不同的两个人的卡片上的数字一定不同**。现在依次从袋子里取出这些球,每取出一个球,所有人就把数字跟这个球编号相同的卡片扔掉。只要一个人收手的卡片没有了,他就获胜,特别的,如果有多人同时没有卡片了,那么这些人都算输。 #### 输入解释: 第一行仅有一个正整数 $n (1\leq n\leq 100)$,表示参与游戏的人数,接下来的 $n$ 行,每行描述一名游戏者拥有卡片上的数字,每行的第一个数 $m_i (1\leq m_i \leq 100)$ 表示该名游戏者拥有卡片的数量,之后是 $m_i$ 个整数 $a_{i,1},a_{i,2},a_{i,3},…,a_{i,m_i}$ $(1\leq a_{i,k} \leq 100)$ 依次表示第 $i$ 名游戏者拥有各张卡片上的数字,数据保证每个人所有卡片上的数字不同。 #### 输出解释: 共有 $n$ 行,每行包含 `YES` 或 `NO`, 依次对用 $n$ 个游戏者的输赢状态, `YES` 表示赢了, `NO` 表示输了。 判断输赢的办法:这个人可否通过设计拿球的顺序以来保证自己赢。

加入题单

算法标签: