Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

using namespace std;

#define M 1777771

class Dictionary
{
  private:
    vector<string> data(1000000);
  public:
    void insert(string str);
    void hash_Insert(string str);
    bool find(string str);
    bool hash_Find(string str);
    int get_Kay(string str);
    int hash_1(int kay);
    int hash_2(int kay);
};

int Dictionary::hash_1(int kay) { return kay % M; }
int Dictionary::hash_2(int kay) { return 1 + (kay % (M - 1)); }

int Dictionary::get_Kay(string str)
{
    int k = 0;
    REP(i, (int)str.length())
    {
        k += (int)str[i] * pow(5, i);
    }
    return k;
}

void Dictionary::insert(string str)
{
    if (!Dictionary::find(str))
        data.PB(str);
}
void Dictionary::hash_Insert(string str)
{
    int i = 0;
    int hashed_Kay;
    int kay = get_Kay(str);
    while (true)
    {
        hashed_Kay = hash_1(kay) + i * hash_2(kay);
        if (data[hashed_Kay] == "" or data[hashed_Kay] == str)
            break;
    }
    data[hashed_Kay] = str;
}

bool Dictionary::find(string str)
{
    if (std::find(ALL(data), str) != data.end())
        return true;
    else
        return false;
}
bool Dictionary::hash_Find(string str)
{
    int i = 0;
    int hashed_Kay;
    int kay = get_Kay(str);
    while (true)
    {
        hashed_Kay = hash_1(kay) + i * hash_2(kay);
        if (data[hashed_Kay] == str)
            return true;
        else if (data[hashed_Kay].length() == 0)
            return false;
    }
}

signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    string op, word;
    Dictionary dic;

    REP(_, n)
    {
        cin >> op >> word;
        if (op[0] == 'i')
            dic.hash_Insert(word);
        else if (dic.hash_Find(word))
            cout << "yes"
                 << "\n";
        else
            cout << "no"
                 << "\n";
    }
}


Compiler output:
a.cc:22:25: error: expected identifier before numeric constant
   22 |     vector<string> data(1000000);
      |                         ^~~~~~~
a.cc:22:25: error: expected ',' or '...' before numeric constant
a.cc: In member function 'void Dictionary::insert(std::string)':
a.cc:49:9: error: invalid use of member function 'std::vector<std::__cxx11::basic_string<char> > Dictionary::data(int)' (did you forget the '()' ?)
   49 |         data.PB(str);
      |         ^~~~
a.cc: In member function 'void Dictionary::hash_Insert(std::string)':
a.cc:59:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   59 |         if (data[hashed_Kay] == "" or data[hashed_Kay] == str)
      |                 ^
a.cc:59:43: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   59 |         if (data[hashed_Kay] == "" or data[hashed_Kay] == str)
      |                                           ^
a.cc:62:9: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   62 |     data[hashed_Kay] = str;
      |         ^
a.cc: In member function 'bool Dictionary::find(std::string)':
a.cc:67:23: error: invalid use of member function 'std::vector<std::__cxx11::basic_string<char> > Dictionary::data(int)' (did you forget the '()' ?)
   67 |     if (std::find(ALL(data), str) != data.end())
      |                       ^
a.cc:10:17: note: in definition of macro 'ALL'
   10 | #define ALL(a) (a).begin(), (a).end()
      |                 ^
a.cc:67:23: error: invalid use of member function 'std::vector<std::__cxx11::basic_string<char> > Dictionary::data(int)' (did you forget the '()' ?)
   67 |     if (std::find(ALL(data), str) != data.end())
      |                       ^
a.cc:10:30: note: in definition of macro 'ALL'
   10 | #define ALL(a) (a).begin(), (a).end()
      |                              ^
a.cc:67:38: error: invalid use of member function 'std::vector<std::__cxx11::basic_string<char> > Dictionary::data(int)' (did you forget the '()' ?)
   67 |     if (std::find(ALL(data), str) != data.end())
      |                                      ^~~~
a.cc:67:43: error: expected ')' before 'end'
   67 |     if (std::find(ALL(data), str) != data.end())
      |        ~                                  ^~~
      |                                           )
a.cc: In member function 'bool Dictionary::hash_Find(std::string)':
a.cc:80:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   80 |         if (data[hashed_Kay] == str)
      |                 ^
a.cc:82:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   82 |         else if (data[hashed_Kay].length() == 0)
      |                      ^
a.cc: In member function 'bool Dictionary::find(std::string)':
a.cc:71:1: warning: control reaches end of non-void function [-Wreturn-type]
   71 | }
      | ^