Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- struct Node;
- Class HashTable;
- int main () {
- HashTable table;
- int n;
- cin >> n;
- for (int i = 1; i <= n; ++i) {
- string s;
- cin >> s;
- table.insert(s);
- }
- int k;
- cin >> k;
- while (k--) {
- string s;
- cin >> s;
- cout << (table.find(s) ? "YES" : "NO");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment