http://codeforces.com/problemset/problem/855/A
给出一个字符串,如果之前出现过,则输出yes否则输出no,用map很简单。
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
while(cin>>n)
{
map <string,int> a;
a.clear();
int i;
string s;
for(i=1;i<=n;i++)
{
cin>>s;
if(a[s]==0){
cout<<"NO"<<endl;
a[s]=1;
}
else cout<<"YES"<<endl;
}
}
return 0;
}