Tom Riddle's Diary

题意翻译

哈利波特的任务是摧毁魂器。他在密室遇到的第一个魂器是汤姆·里德尔的日记。日记和金妮在一起,迫使她打开密室。哈利想知道曾经有过日记的不同的人,以确保他们不受日记的影响。 他有n个把日记整理好的人的名字。你需要知道,他(她)以前是否拥有日记。 在输入名字的列表中。如果这个名字曾经出现过,则输出“YES”(没有引号)。否则,输出“NO”(没有引号)。 ## 输入输出格式 输入格式: 第一行输入包含一个整数n ( 1<=n<=100),表示的是名单中一共有n个名字。 接下来n行,每一行都包含一个字符串$S_i$,它由小写英文字母组成。每个字符串的长度介于1和100。 输出格式: 一共输出n行,每一行包含“YES”或“NO”(没有引号),这取决于第i个名字是否与前面i-1个名字有重复。 您可以在任何情况下(上或下)输出每个字母。 ## 输入输出样例 **输入样例#1:** ```cpp 6 tom lucius ginny harry ginny harry ``` **输出样例#1:** ```cpp NO NO NO NO YES YES ``` **输入样例#2:** ```cpp 3 a a a ``` **输出样例#2:** ```cpp NO YES YES ``` 在输入样例1中,为i=5有存在j=3使$S_i$和$S_j$相同,这意味着i=5就是“YES”

题目描述

Harry Potter is on a mission to destroy You-Know-Who's Horcruxes. The first Horcrux that he encountered in the Chamber of Secrets is Tom Riddle's diary. The diary was with Ginny and it forced her to open the Chamber of Secrets. Harry wants to know the different people who had ever possessed the diary to make sure they are not under its influence. He has names of $ n $ people who possessed the diary in order. You need to tell, for each person, if he/she possessed the diary at some point before or not. Formally, for a name $ s_{i} $ in the $ i $ -th line, output "YES" (without quotes) if there exists an index $ j $ such that $ s_{i}=s_{j} $ and $ j&lt;i $ , otherwise, output "NO" (without quotes).

输入输出格式

输入格式


First line of input contains an integer $ n $ ( $ 1<=n<=100 $ ) — the number of names in the list. Next $ n $ lines each contain a string $ s_{i} $ , consisting of lowercase English letters. The length of each string is between $ 1 $ and $ 100 $ .

输出格式


Output $ n $ lines each containing either "YES" or "NO" (without quotes), depending on whether this string was already present in the stream or not. You can print each letter in any case (upper or lower).

输入输出样例

输入样例 #1

6
tom
lucius
ginny
harry
ginny
harry

输出样例 #1

NO
NO
NO
NO
YES
YES

输入样例 #2

3
a
a
a

输出样例 #2

NO
YES
YES

说明

In test case $ 1 $ , for $ i=5 $ there exists $ j=3 $ such that $ s_{i}=s_{j} $ and $ j&lt;i $ , which means that answer for $ i=5 $ is "YES".