fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t; cin >> t;
  6. unordered_map<string,int> freq;
  7. while(t--){
  8. string n; cin >> n;
  9. if(freq.find(n) == freq.end()){
  10. cout << "NO\n";
  11. freq[n]++;
  12. }else cout << "YES\n";
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 5288KB
stdin
3
a
a
a
stdout
NO
YES
YES