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 hash_Insert(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::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::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::hash_Insert(std::string)':
a.cc:52:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   52 |         if (data[hashed_Kay] == "" or data[hashed_Kay] == str)
      |                 ^
a.cc:52:43: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   52 |         if (data[hashed_Kay] == "" or data[hashed_Kay] == str)
      |                                           ^
a.cc:55:9: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   55 |     data[hashed_Kay] = str;
      |         ^
a.cc: In member function 'bool Dictionary::hash_Find(std::string)':
a.cc:66:17: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   66 |         if (data[hashed_Kay] == str)
      |                 ^
a.cc:68:22: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   68 |         else if (data[hashed_Kay].length() == 0)
      |                      ^