fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >> n;
  7. set<string> stars;
  8. while(n--) {
  9. string x;
  10. cin >> x;
  11. if(stars.count(x)!=0) cout << "Yes ";
  12. else {
  13. cout << "No ";
  14. stars.insert(x);
  15. }
  16. }
  17. }
Success #stdin #stdout 0s 15240KB
stdin
5 Geeks Hello Great Geeks Hello
stdout
No No No Yes Yes