Language: C++

#include <iostream>
#include <stdio.h>
using namespace std;

//static const int M = 1000000;
static const int M = 1046527;  //?´???°????????¶
//static const int M = 83;  //?´???°????????¶
static const int Q = 7;
static const int MAX_OP_LEN = 7; //?????????????????????
static const int MAX_STR_LEN = 13; //?????????????????????

//string dic[M] = {""};
char H[M][MAX_STR_LEN];
int c_collision = 0;

int convert_str(char *str);
int h(int key);
int g(int key);
void linerProving_insert(int num, char* str); //?????¢??°??????
int linerProving_find(int num, char* str); //?????¢??°??????
void doubleHashing_insert(int num, char* str); //?????????????????\???
int doubleHashing_find(int num, char* str); //?????????????????\???

int main(){
	int n, ans, num;
	char op[MAX_OP_LEN], word[MAX_STR_LEN];

	//???????????\????????????????????????
	memset(H, '\0', sizeof(H));

	cin >> n;
	while (n > 0) {
		scanf("%s%s", op, word);
//		cout << op << ' ' << word << endl; break;

		// printf("%s\n", op);
		// printf("%s\n", word);

		num = convert_str(word);

		if ( strncmp(op, "insert", MAX_OP_LEN) == 0 ) {
//			cout << "insert : " << word << " : " << num << endl;
			doubleHashing_insert(num, word);
		}
		else {
//			cout << "find : " << word << " : " << num << endl;
			if (doubleHashing_find(num, word))
				cout << "yes" << endl;
			else
				cout << "no" << endl;
		}
		n--;
	}

//	cout << "collision = " << c_collision << endl;
	return 0;
}

int convert_str(char *str) {
	int num;
	//??????????????°????????????
	num = 0;
	for (int i = 0; i < MAX_STR_LEN; i++) {
//		printf("str[%d] = %c\n", i, str[i]);
		switch (str[i]) {
		case '\0' :
			break;
		case 'A' :
			num += 1 * 4 ^ i;
			break;
		case 'C' :
			num += 2 * 4 ^ i;
			break;
		case 'G' :
			num += 3 * 4 ^ i;
			break;
		case 'T' :
			num += 4 * 4 ^ i;
			break;
		}
	}
	return num;
}

int h(int key) {
	return key % M;
}

int g(int key) {
	return Q - (h(key) % Q);
}

//?????????????????\???
void doubleHashing_insert(int num, char* str){
	int idx, j;

	for (j = 0; j < M; j++) {
		idx = (h(num) + j * g(num)) % M;

		//?????§?????????????????????????????°???????????????????????????
		if ( strncmp(str, H[idx], MAX_STR_LEN) == 0 )
			return;
		else if (strlen(H[idx]) == 0)
			break;
//		c_collision++;
	}
	strcpy(H[idx], str);
}

//?????????????????\???
int doubleHashing_find(int num, char* str){
	int idx, j;

	for (j = 0; j < M; j++) {
		idx = (h(num) + j * g(num)) % M;

		// printf("idx = %d\n", idx);
		// cout << str << endl;
		// cout << H[idx] << endl;
		if ( strncmp(str, H[idx], MAX_STR_LEN) == 0 )
			return 1;
		else if (strlen(H[idx]) == 0)
			return 0;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'memset' was not declared in this scope
   29 |         memset(H, '\0', sizeof(H));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <stdio.h>
a.cc:41:22: error: 'strncmp' was not declared in this scope
   41 |                 if ( strncmp(op, "insert", MAX_OP_LEN) == 0 ) {
      |                      ^~~~~~~
a.cc:41:22: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'void doubleHashing_insert(int, char*)':
a.cc:101:22: error: 'strncmp' was not declared in this scope
  101 |                 if ( strncmp(str, H[idx], MAX_STR_LEN) == 0 )
      |                      ^~~~~~~
a.cc:101:22: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:103:26: error: 'strlen' was not declared in this scope
  103 |                 else if (strlen(H[idx]) == 0)
      |                          ^~~~~~
a.cc:103:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:107:9: error: 'strcpy' was not declared in this scope
  107 |         strcpy(H[idx], str);
      |         ^~~~~~
a.cc:107:9: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int doubleHashing_find(int, char*)':
a.cc:120:22: error: 'strncmp' was not declared in this scope
  120 |                 if ( strncmp(str, H[idx], MAX_STR_LEN) == 0 )
      |                      ^~~~~~~
a.cc:120:22: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:122:26: error: 'strlen' was not declared in this scope
  122 |                 else if (strlen(H[idx]) == 0)
      |                          ^~~~~~
a.cc:122:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'