Language: C++

#define M 5070721
#define NIL (-1)
#define L 14
typedef long long ll;
char H[M][L];
 
int getChar(char ch) {
  if(ch == 'A') return 1;
  else if(ch == 'C') return 2;
  else if(ch == 'G') return 3;
  else if(ch == 'T') return 4;
  else return 0;
}
 
ll getKey(char str[]) {
  ll sum = 0, p = 1;
  int len = strlen(str);
  for(int i = 0; i < len; i++) {
    sum += p * (getChar(str[i]));
    p *= 5;
  }
  return sum;
}
 
int h1(int key){
  return key % M;
}
 
int h2(int key){
  return 1 + (key % (M-1));
}
 
int find(char str[]){
  ll key, i, h;
  key = getKey(str);
  for(i = 0; ; i++) {
    h = (h1(key) + i * h2(key)) % M;
    if(strcmp(H[h], str) == 0) {
      return 1;
    } else if(strlen(H[h]) == 0) {
      return 0;
    }
  }
  return 0;
}
 
int insert(char str[]) {
  ll key, h;
  key = getKey(str);
  for(ll i = 0;; i++){
    h = (h1(key) + i * h2(key)) % M;
    if(strcmp(H[h], str) == 0) {
      return 1;
    } else if(strlen(H[h]) == 0) {
      strcpy(H[h], str);
      return 0;
    }
  }
  return 0;
}

int main(void){
  int N;
  char str[L], com[9];
  for(int i = 0; i < M; i++) {
    H[i][0]='\0';
  }

  scanf("%d", &N);
  for(int i=0;i<N;i++){
    scanf("%s %s", com, str);
    if(com[0] == 'i') {
      insert(str);
    }else{
      if(find(str)) {
        cout << "yes" << endl;
      }else{
        cout << "no" << endl;
      }
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'll getKey(char*)':
a.cc:17:13: error: 'strlen' was not declared in this scope
   17 |   int len = strlen(str);
      |             ^~~~~~
a.cc:1:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | #define M 5070721
a.cc: In function 'int find(char*)':
a.cc:38:8: error: 'strcmp' was not declared in this scope
   38 |     if(strcmp(H[h], str) == 0) {
      |        ^~~~~~
a.cc:38:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:40:15: error: 'strlen' was not declared in this scope
   40 |     } else if(strlen(H[h]) == 0) {
      |               ^~~~~~
a.cc:40:15: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int insert(char*)':
a.cc:52:8: error: 'strcmp' was not declared in this scope
   52 |     if(strcmp(H[h], str) == 0) {
      |        ^~~~~~
a.cc:52:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:54:15: error: 'strlen' was not declared in this scope
   54 |     } else if(strlen(H[h]) == 0) {
      |               ^~~~~~
a.cc:54:15: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:55:7: error: 'strcpy' was not declared in this scope
   55 |       strcpy(H[h], str);
      |       ^~~~~~
a.cc:55:7: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int main()':
a.cc:69:3: error: 'scanf' was not declared in this scope
   69 |   scanf("%d", &N);
      |   ^~~~~
a.cc:76:9: error: 'cout' was not declared in this scope
   76 |         cout << "yes" << endl;
      |         ^~~~
a.cc:76:26: error: 'endl' was not declared in this scope
   76 |         cout << "yes" << endl;
      |                          ^~~~
a.cc:78:9: error: 'cout' was not declared in this scope
   78 |         cout << "no" << endl;
      |         ^~~~
a.cc:78:25: error: 'endl' was not declared in this scope
   78 |         cout << "no" << endl;
      |                         ^~~~