Al3XS0n

Untitled

Sep 21st, 2020
737
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. struct Node;
  7. Class HashTable;
  8.  
  9. int main () {
  10.     HashTable table;
  11.     int n;
  12.     cin >> n;
  13.     for (int i = 1; i <= n; ++i) {
  14.         string s;
  15.         cin >> s;
  16.         table.insert(s);
  17.     }
  18.     int k;
  19.     cin >> k;
  20.     while (k--) {
  21.         string s;
  22.         cin >> s;
  23.         cout << (table.find(s) ? "YES" : "NO");
  24.     }
  25.     return 0;
  26. }
RAW Paste Data