CF855A.Tom Riddle's Diary
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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 < i, otherwise, output "NO" (without quotes).
哈利·波特正在执行一项摧毁伏地魔魂器的任务。他在密室中遇到的第一个魂器是汤姆·里德尔的日记。当时这本日记在金妮手中,并强迫她打开了密室。哈利想要弄清曾经持有过这本日记的所有不同人物,以确保他们没有受到其影响。
他按时间顺序获得了曾持有该日记的 n 个人的名字。你需要对每个人判断:此人是否曾在之前某个时刻持有过该日记。
形式化地,对于第 i 行中的名字 si,若存在某个下标 j 满足 si=sj 且 j<i,则输出 "YES"(不带引号);否则输出 "NO"(不带引号)。
输入格式
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.
输入的第一行包含一个整数 n(1≤n≤100)—— 表示列表中名字的数量。
接下来的 n 行,每行包含一个字符串 si,由小写英文字母组成。每个字符串的长度在 1 到 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).
输出 n 行,每行包含 "YES" 或 "NO"(不带引号),具体取决于该字符串此前是否已在数据流中出现过。
每个字母可使用大写或小写形式输出。
输入输出样例
输入#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 < i, which means that answer for i = 5 is "YES".
在测试用例 1 中,对于 i=5,存在 j=3,使得 si=sj 且 j<i,这意味着 i=5 的答案为 “YES”。
输入解题思路,AI测评打分。不知道怎么写?