criyle/codenet-compile-errors huggingface dataset:
Language: C

#include<stdio.h>
#include<string.h>

#define M 17000000/* your task*/
#define L 14

char H[M][L]; /* Hash Table */

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;
}

/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key){ return key%M; }
int h2(int key){ return (key+1)%(M-1); }

int find(char str[]){
  /* your task */ 
  int ans1,ans2,clu,ansC,i=0;
  long long key;
  
  key=getKey(str);
  ans1=h1(key);
  ans2=h2(key);
  
  while(1){
    clu=(ans2*i+ans1)%M;
    ansC=strcmp(str,H[clu]);
    if(ansC==0) return 1;
    if(H[clu][0]=='\0'||i==M) return 0;
    i++;
  }
}

int insert(char str[]){
  /* your task */  
  int ans1,ans2,clu,i=0;
  long long key;
  
  key=getKey(str);
  ans1=h1(key);
  ans2=h2(key);
  
  while(1){
    clu=(ans2*i+ans1)%M;
    if(H[clu][0]=='\0'){
      break;
    }
    i++;
  }
  strcpy(H[clu],str);
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#include<string.h>

#define M 1000033
#define L 14

char H[M][L]; 
/* Hash Table */

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;
}

/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); 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[]){
int k=getKey(str);
while(H[k]  != '\0'){

  if( strcmp(str,H[h1(k)]) == 0 ){
return 1;
}

k+=h2[k];
if(k>=M)k=M-k;

}

int insert(char str[]){
  int k=getKey(str);

  while (1){
    if( H[k][0] == '\0' ){
      strcpy(H[k],str);
      return 1;
    }
    k+=h2(getKey(str));
    if(k>=M)k=M-k;
  }

}

int main(){
    int i, n, h;
    char str[L], com[9];
    for ( i = 0; i < M; i++ ) H[i][0] = '\0';
    
    scanf("%d", &n);
    
    for ( i = 0; i < n; i++ ){
	scanf("%s %s", com, str);
	
	if ( com[0] == 'i' ){
	    insert(str);
	} else {
	    if (find(str)){
		printf("yes\n");
	    } else {
		printf("no\n");
	    }
	}
    }

    return 0;
}

Compiler output:
main.c: In function 'find':
main.c:32:13: warning: comparison between pointer and zero character constant [-Wpointer-compare]
   32 | while(H[k]  != '\0'){
      |             ^~
main.c:32:7: note: did you mean to dereference the pointer?
   32 | while(H[k]  != '\0'){
      |       ^
main.c:38:6: error: subscripted value is neither array nor pointer nor vector
   38 | k+=h2[k];
      |      ^
main.c:79:1: error: expected declaration or statement at end of input
   79 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#define M 1000000
#define L 14

char H[M][L];
int serch[M],n=0;

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;
}

int getKey(char str[]){
  int sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

void insert(char str[]){
  strcpy(H[n],str);
  
  serch[n]=getKey(H[n]);
  n++;
}

int find(char str[]){
  int i,sum;
  
  for(i=0;i<n;i++){
    if(serch[i]==getKey(str))return 1;
  }
  return 0;
}

int main(){
  int i, n, h;
    char str[L], com[9];
    for ( i = 0; i < M; i++ ) H[i][0] = '\0';
    
    scanf("%d", &n);
    
    for ( i = 0; i < n; i++ ){
      scanf("%s %s", com, str);
      
      if ( com[0] == 'i' ){
	insert(str);
      } 
      else {
	if (find(str)==1){
	  printf("yes\n");
	} 
	else (find(str)==0){
	  printf("no\n");
	}
      }
    }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:58:28: error: expected ';' before '{' token
   58 |         else (find(str)==0){
      |                            ^
      |                            ;
Language: C

#include<stdio.h>
#include<string.h>

#define M 1100000
#define L 14

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 ( ch == 'T') return 4;
}
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); 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[]){
  long long trip; 
  int i = 0;
  long long sum = getKey(str);

  while(1){
    trip = (h1(sum)+ i * h2(sum)) % M;
    if(strcmp(H[trip], str) == 0) return 1;
    if(H[trip][0] == '\0') return 0;
    i++;
  }
  return 0;
}

void insert(char str[]){
  int  i = 0;
  long long ago;
  long long sum = getKey(str);

  while{
   ago = (h1(sum)+ i * h2(sum)) % M;
    if(H[ago][0] == '\0' || strcmp(H[ago],str) == 0){
      strcpy(H[ago], str);
      break;
    }
    i++;
  }
}

int main(){
    int i, n, h;
    char str[L], com[9];
    for ( i = 0; i < M; i++ ) H[i][0] = '\0';
    scanf("%d", &n);
    for ( i = 0; i < n; i++ ){
	scanf("%s %s", com, str);
	if ( com[0] == 'i' ){
	    insert(str);
	} else {
	    if (find(str)){
		printf("yes\n");
	    } else {
		printf("no\n");
	    }
	}
    }
    return 0;
}

Compiler output:
main.c: In function 'getChar':
main.c:13:20: error: expected ';' before 'return'
   13 |   else ( ch == 'T') return 4;
      |                    ^~~~~~~
      |                    ;
main.c: In function 'insert':
main.c:46:8: error: expected '(' before '{' token
   46 |   while{
      |        ^
      |        (
Language: C

#include<stdio.h>
#include<string.h>
#define M 1000000
#define NTL (-1)
#define L 14
 
char H[M][L]; /* Hash Table */
int count=0,k=0;
long long search[M];
 
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;
}
 
/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}
 
int h1(int key){ return getKey(H[key]); }
	int h2(int key){ return getKey(H[key]); }
 
int find(char str[]){
  int i,j;
  i=0;
  while(i!=M){
     
 
  	 //   if( strcmp(H[j],str)==0) return 1;
    if(H[i][0]==str[0] &&search[i]==getKeyy(str) ) return 1;     
  	
  	else i++;
     
  }
  return NTL;
   
}
 
int insert(char str[]){
  while(k!=M){   
    if(H[k][0]=='\0'){     
      strcpy(H[k],str);
       search[k]=getKey(str);
      k++:
    	return 0;
}
 
 
    else k++;
  }
  return NTL;
}
 
int main(){
  int i, n, h;
  char str[L], com[9];
  for ( i = 0; i < M; i++ ) H[i][0] = '\0';
   
  scanf("%d", &n);
   
  for ( i = 0; i < n; i++ ){
    scanf("%s %s", com, str);
     
    if ( com[0] == 'i' ){
      insert(str);
    } else {
      if (find(str)==1){
        printf("yes\n");
      } else {
        printf("no\n");
      }
    }
  }
   
  return 0;
}

Compiler output:
main.c: In function 'find':
main.c:38:37: error: implicit declaration of function 'getKeyy'; did you mean 'getKey'? [-Wimplicit-function-declaration]
   38 |     if(H[i][0]==str[0] &&search[i]==getKeyy(str) ) return 1;
      |                                     ^~~~~~~
      |                                     getKey
main.c: In function 'insert':
main.c:52:10: error: expected ';' before ':' token
   52 |       k++:
      |          ^
      |          ;
Language: C

#include<stdio.h>
#include<string.h>
#define M 1000000
#define NTL (-1)
#define L 14
 
char H[M][L]; /* Hash Table */
int count=0,k=0;
long long search[M];
 
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;
}
 
/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}
 
int h1(int key){ return getKey(H[key]); }
	int h2(int key){ return getKey(H[key]); }
 
int find(char str[]){
  int i,j;
  i=0;
  while(i!=M){
     
 
  	 //   if( strcmp(H[j],str)==0) return 1;
    if(H[i][0]==str[0] &&search[i]==getKey(str) ) return 1;     
  	
  	else i++;
     
  }
  return NTL;
   
}
 
int insert(char str[]){
  while(k!=M){   
    if(H[k][0]=='\0'){     
      strcpy(H[k],str);
       search[k]=getKey(str);
      k++:
    	return 0;
}
 
 
    else k++;
  }
  return NTL;
}
 
int main(){
  int i, n, h;
  char str[L], com[9];
  for ( i = 0; i < M; i++ ) H[i][0] = '\0';
   
  scanf("%d", &n);
   
  for ( i = 0; i < n; i++ ){
    scanf("%s %s", com, str);
     
    if ( com[0] == 'i' ){
      insert(str);
    } else {
      if (find(str)==1){
        printf("yes\n");
      } else {
        printf("no\n");
      }
    }
  }
   
  return 0;
}

Compiler output:
main.c: In function 'insert':
main.c:52:10: error: expected ';' before ':' token
   52 |       k++:
      |          ^
      |          ;
Language: C

#include<stdio.h>
#include<string.h>
#define M 1000000
#define NTL (-1)
#define L 14
  
char H[M][L]; /* Hash Table */
int count=0,k=0;
long long search[M];
  
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;
}
  
/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}
  
int h1(int key){ return getKey(H[key]); }
    int h2(int key){ return getKey(H[key]); }
  
int find(char str[]){
  int i,j;
  i=0;
  while(i!=M){
      
  
     //   if( strcmp(H[j],str)==0) return 1;
    //if(H[i][0]==str[0]){
    	if(H[i][0]==str[0]){
    		if(search[i]==getKey(str) ) return 1;     
    //}
    	else i++;
    else i++;
      
  }
  return NTL;
    
}
  
int insert(char str[]){
       strcpy(H[k],str);
       search[k]=getKey(str);
      k++;
        return 0; 
}
  
int main(){
  int i, n, h;
  char str[L], com[9];
  for ( i = 0; i < M; i++ ) H[i][0] = '\0';
    
  scanf("%d", &n);
    
  for ( i = 0; i < n; i++ ){
    scanf("%s %s", com, str);
      
    if ( com[0] == 'i' ){
      insert(str);
    } else {
      if (find(str)==1){
        printf("yes\n");
      } else {
        printf("no\n");
      }
    }
  }
    
  return 0;
}

Compiler output:
main.c: In function 'find':
main.c:43:5: error: expected '}' before 'else'
   43 |     else i++;
      |     ^~~~
Language: C

#include<stdio.h>
#include<string.h>

#define M 1000000
#define L 14

char H[M][L]; /* Hash Table */

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;
}

/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key){
  key = key%M;
  return key;
}
int h2(int key){
  key = 1+key%(M-1);
  return key;
}

int find(char str[]){
  long long sum,key2,i;
  sum = getKey(str);
  for(i=0;i<20;i++){
    key2=(h1(sum)+i*h2(sum))%M;
    if(strcmp(H[key2],str)==0)return 1;
    else if(strlen(H[key2]==0)return 0;
  }
  return 0;
}

int insert(char str[]){
  long long sum,key2,i;
  sum = getKey(str);
  for(i=0;i<20;i++){
    key2=(h1(sum)+i*h2(sum))%M;
    if(strcmp(H[key2],str)==0)return 1;
    if(strlen(H[key2])==0){
      strcpy(H[key2],str);
      return 0;
    }
  }
}

int main(){
  int i, n, h;
  char str[L], com[9];
  for ( i = 0; i < M; i++ ) H[i][0] = '\0';
  
  scanf("%d", &n);
  
  for ( i = 0; i < n; i++ ){
    scanf("%s %s", com, str);
    
    if ( com[0] == 'i' ){
      insert(str);
    } else {
      if (find(str)){
	printf("yes\n");
      } else {
	printf("no\n");
      }
    }
  }
  
  return 0;
}

Compiler output:
main.c: In function 'find':
main.c:41:27: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   41 |     else if(strlen(H[key2]==0)return 0;
      |                    ~~~~~~~^~~
      |                           |
      |                           int
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'int'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c:41:31: error: expected ')' before 'return'
   41 |     else if(strlen(H[key2]==0)return 0;
      |            ~                  ^~~~~~
      |                               )
main.c:42:3: error: expected expression before '}' token
   42 |   }
      |   ^
Language: C

#include<stdio.h>
#include<string.h>
 
#define M 1000005
#define L 14
 
char HS[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;
}
 

long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); 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[]){

  long long fin;
  int i = 0;
  long long sum = getKey(str); 

  while(1){
    fin = (h1(sum) + h2(sum)*i) %M;
    if(strcmp(H[fin],str) == 0) return 1;
    if(HS[fin][0] == '\0') return 0;
    i++;
  }

  return 0;

}
 
void insert(char str[]){
 
 int  i = 0;
  long long ser;
  long long sum = getKey(str);
  
  while(1){
    ser = (h1(sum) + h2(sum) *i) %M;
    if(H[ser][0] == '\0' || strcmp(H[ser],str) == 0){
      strcpy(HS[ser],str);
      break;
    }

    i++;
  }

}
 
int main(){
    int i, n, h;
    char str[L], com[9];
    for ( i = 0; i < M; i++ ) HS[i][0] = '\0';
     
    scanf("%d", &n);
     
    for ( i = 0; i < n; i++ ){
    scanf("%s %s", com, str);
     
    if ( com[0] == 'i' ){
        insert(str);
    } 
    else {
        if (find(str)){
        printf("yes\n");
        } else {
        printf("no\n");
        }
    }
 }
 
    return 0;
}

Compiler output:
main.c: In function 'find':
main.c:37:15: error: 'H' undeclared (first use in this function)
   37 |     if(strcmp(H[fin],str) == 0) return 1;
      |               ^
main.c:37:15: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'insert':
main.c:54:8: error: 'H' undeclared (first use in this function)
   54 |     if(H[ser][0] == '\0' || strcmp(H[ser],str) == 0){
      |        ^
Language: C

#include<stdio.h>
#include<stdlib.h>

void insert();
int find();   
int conv(char);

typedef struct Node* Nodepointer;

struct Node{
  Nodepointer next[5];
}; 

Nodepoointer makeNode();

int conv(char c){
  if(c == '\0') return 0;
  else if(c == 'A') return 1;
  else if(c == 'C') return 2;
  else if(c == 'G') return 3;
  else if(c == 'T') return 4;
  else return -1;
}

Nodepointer makeNode(){
  int i;
  Nodepointer p;
  p = malloc(sizeof(struct Node));
  for(i=0 ; i<5 ; ++i) p->next[i] = NULL;
  return p;
}

main(){
  int n,i;
  char str[100],order[100];
  Nodepointer head;

  head = makeNode();

  scanf("%d",&n);

  for(i=0 ; i<n ; i++){
    scanf("%s %s",order,str);

    if(order[0] == 'i'){
      insert(head,str);
    }
    else{
      if(find(head,str)) printf("yes\n");
      else printf("no\n");
    }
  }
  return 0;
}

Compiler output:
main.c:14:1: error: unknown type name 'Nodepoointer'; did you mean 'Nodepointer'?
   14 | Nodepoointer makeNode();
      | ^~~~~~~~~~~~
      | Nodepointer
main.c:25:13: error: conflicting types for 'makeNode'; have 'struct Node *()'
   25 | Nodepointer makeNode(){
      |             ^~~~~~~~
main.c:14:14: note: previous declaration of 'makeNode' with type 'int()'
   14 | Nodepoointer makeNode();
      |              ^~~~~~~~
main.c:33:1: error: return type defaults to 'int' [-Wimplicit-int]
   33 | main(){
      | ^~~~
Language: C


      return j;

    }
 
    else i++;
    if(i==M)break;
    
  }
    

}

int main(){
    int i, n, h;
    char str[L], com[9];
    /*hashtable syokika*/
    for ( i = 0; i < M; i++ ) H[i][0] = '\0';
    
    scanf("%d", &n);
    
    for ( i = 0; i < n; i++ ){
	scanf("%s %s", com, str);
	
	if ( com[0] == 'i' ){
	    insert(str);
	}
	else {
	    if (find(str)){
	      
		printf("yes\n");
	    } 
	    else {
	      
		printf("no\n");
	    }
	}
    }

    return 0;
}

Compiler output:
main.c:2:7: error: expected identifier or '(' before 'return'
    2 |       return j;
      |       ^~~~~~
main.c:4:5: error: expected identifier or '(' before '}' token
    4 |     }
      |     ^
main.c:6:5: error: expected identifier or '(' before 'else'
    6 |     else i++;
      |     ^~~~
main.c:7:5: error: expected identifier or '(' before 'if'
    7 |     if(i==M)break;
      |     ^~
main.c:9:3: error: expected identifier or '(' before '}' token
    9 |   }
      |   ^
main.c:12:1: error: expected identifier or '(' before '}' token
   12 | }
      | ^
main.c: In function 'main':
main.c:16:14: error: 'L' undeclared (first use in this function)
   16 |     char str[L], com[9];
      |              ^
main.c:16:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:22: error: 'M' undeclared (first use in this function)
   18 |     for ( i = 0; i < M; i++ ) H[i][0] = '\0';
      |                      ^
main.c:18:31: error: 'H' undeclared (first use in this function)
   18 |     for ( i = 0; i < M; i++ ) H[i][0] = '\0';
      |                               ^
main.c:20:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   20 |     scanf("%d", &n);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | 
main.c:20:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   20 |     scanf("%d", &n);
      |     ^~~~~
main.c:20:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:26:13: error: implicit declaration of function 'insert' [-Wimplicit-function-declaration]
   26 |             insert(str);
      |             ^~~~~~
main.c:29:17: error: implicit declaration of function 'find' [-Wimplicit-function-declaration]
   29 |             if (find(str)){
      |                 ^~~~
main.c:31:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   31 |                 printf("yes\n");
      |                 ^~~~~~
main.c:31:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:31:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:31:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:35:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   35 |                 printf("no\n");
      |                 ^~~~~~
main.c:35:17: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include <string>
#include <iostream>
#include <array>

constexpr const int M = 1000003;
constexpr const int StrSize = 12;

std::array<std::string, M> dictionary;

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;
    }
    return 0;
}

int GetKey( std::string str ){
    int sum = 0;
    int p = 1;
    for ( int i = 0; i < str.size; ++i ){
        sum += p * GetChar( str[i] );
        p *= 5;
    }
    return sum;
}

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

int HashFunc2( int key ){
    return 1 + key % ( M - 1 ); 
}

int DoubleHashFunc( int key, int i ){
    return ( HashFunc1(key) + i * HashFunc2(key) ) % M;
}

void Insert( std::string word ){
    int i = 0;
    int key = GetKey(word);
    for( int hash = ( HashFunc1(key) + i * HashFunc2(key) ) % M; i < M; ++i ){
        if( dictionary[hash] != word ){
            dictionary[hash] = word;
            break;
        }
    }
}

void Find( std::string word ){
    int i = 0;
    int key = GetKey(word);
    while( true ){
        int hash = ( HashFunc1(key) + i * HashFunc2(key) ) % M;
        if( dictionary[hash] == word ){
            std::cout << "yes" << "\n";
            return;
        }else if( dictionary[hash].empty() || i >= M ){
            std::cout << "no" << "\n";
            return;
        }else{
            ++i;
        }
    }
}

int main(){
    std::cin.tie(0);
    int n;
    std::cin >> n;

    std::string command("");
    std::string word("");

    for( int i = 0; i < n; ++i){
        std::cin >> command >> word;
        // for( int i = 0; word.size() < StrSize; ++i ){
        //     word += ' ';
        // }
        if( command[0] == 'i' ){
            Insert( word );
        }else if( command[0] == 'f' ){
            Find( word );
        }
    }
}


Compiler output:
a.cc: In function 'int GetKey(std::string)':
a.cc:26:30: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   26 |     for ( int i = 0; i < str.size; ++i ){
      |                          ~~~~^~~~
      |                                  ()
Language: C++

#include<cstdio>

class Dictionary {
private:
	char words[100000][15];
	int num_words = 0;
	int wordscmp(char*, char*); // > 1
public:
	void insert(char*);
	void find(char*);
};

void Dictionary::insert(char* word)
{
	int index, k, flag = 0, i = 0;
	for (index = num_words; index > 0; index--)
	{
		for (int j = 0; words[index - 1][j] != '\0' || word[j] != '\0' || flag = 1; j++)
		{
			k = 0;
			if (words[index - 1][j] > word[j])
			{
				while (words[index - 1][k] != '\0')
				{
					words[index][k] = words[index - 1][k];
					k++;
				}
				words[index][k] = '\0';
				break;
			}
			else if (words[index - 1][j] < word[j])
			{
				flag = 1;
				break;
			}
		}
		if (flag)
			break;
	}
	num_words++;
	while (word[i] != '\0')
	{
		words[index][i] = word[i];
		i++;
	}
	words[index][i] = '\0';
	for (int i = 0; i < num_words; i++)
	    printf("%s ", words[i]);
	printf("\n");
	return;
}

void Dictionary::find(char* word)
{
	int right, left = 0, mid;
	right = num_words;
	while (left < right)
	{
		mid = (left + right) / 2;
		switch (wordscmp(word, words[mid]))
		{
		case 1:
			left = mid + 1;
			break;
		case 0:
			printf("yes\n");
			return;
		default:
			right = mid;
			break;
		}
	}
	printf("no\n");
	return;
}

int Dictionary::wordscmp(char* a, char* b)
{
	for (int i = 0; a[i] != '\0' || b[i] != '\0'; i++)
	{
		if (a[i] < b[i])
			return -1;
		else if (a[i] > b[i])
			return 1;
	}
	return 0;
}

int main()
{
	int n;
	char ctmp[15];
	Dictionary dic;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%s", ctmp);
		switch (ctmp[0])
		{
		case 'i':
			scanf("%s", ctmp);
			dic.insert(ctmp);
			break;
		default:
			scanf("%s", ctmp);
			dic.find(ctmp);
			break;
		}
	}
	return 0;
}


Compiler output:
a.cc: In member function 'void Dictionary::insert(char*)':
a.cc:18:80: error: lvalue required as left operand of assignment
   18 |                 for (int j = 0; words[index - 1][j] != '\0' || word[j] != '\0' || flag = 1; j++)
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

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

#define L 12
#define M 1046527
#define NIL "Z"

char hash_table[M][L + 1];

int h_1(int num){
    return (num * 2 + 1) % (M - 2);
}

int h_2(int num){
    return (num * 3 + 1) % (M - 4);
}

int H_k(int num, int k){
   return (h_1(num) + h_2(num) * k) % M;
}

int char_to_num(char c){
    if(c == 'A'){
        return 1;
    }else if(c == 'C'){
        return 2;
    }else if(c == 'G'){
        return 3;
    }else{
        return 4;
    }
}

int str_to_num(char* str){
    int index = 0;
    int value = 0;

    while(str[index]){
        value += char_to_num(str[index]) * pow(4, index);
        index++;
    }

    return value;
}

void insert_(char* str){
    int hash_num = str_to_num(str);
    int k = 1;
    while(strcmp(hash_table[H_k(hash_num, k)], NIL)){
        k++;
    }
    strcpy(hash_table[H_k(hash_num, k)], str);
}

void find_(char* str){
    int hash_num = str_to_num(str);
    int k = 1;
    while(strcmp(hash_table[H_k(hash_num, k)], NIL)){
        if(!strcmp(hash_table[H_k(hash_num, k)], str)){
            printf("yes\n");
            return;
        }
        k++;
    }
    printf("no\n");
    return;
}

void init(){
    for(int i = 0; i < M; i++){
        strcpy(hash_table[i], NIL);
    }
}


int main(void){
    init();

    int n;
    scanf("%d", &n);

    for(int i = 0; i < n; i++){
        char buf1[100];
        char buf2[100];
        scanf("%s %s", buf1, buf2);
        if(!strcmp(buf1, "insert")){
            insert_(buf2);
        }else if (!strcmp(buf1, "find")){
            find_(buf2);
        }
    }
}



Compiler output:
a.cc: In function 'void insert_(char*)':
a.cc:51:11: error: 'strcmp' was not declared in this scope
   51 |     while(strcmp(hash_table[H_k(hash_num, k)], NIL)){
      |           ^~~~~~
a.cc:4:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <math.h>
  +++ |+#include <cstring>
    4 | using namespace std;
a.cc:54:5: error: 'strcpy' was not declared in this scope
   54 |     strcpy(hash_table[H_k(hash_num, k)], str);
      |     ^~~~~~
a.cc:54:5: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'void find_(char*)':
a.cc:60:11: error: 'strcmp' was not declared in this scope
   60 |     while(strcmp(hash_table[H_k(hash_num, k)], NIL)){
      |           ^~~~~~
a.cc:60:11: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'void init()':
a.cc:73:9: error: 'strcpy' was not declared in this scope
   73 |         strcpy(hash_table[i], NIL);
      |         ^~~~~~
a.cc:73:9: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int main()':
a.cc:88:13: error: 'strcmp' was not declared in this scope
   88 |         if(!strcmp(buf1, "insert")){
      |             ^~~~~~
a.cc:88:13: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define INF 0x3f3f3f3f
#define NIL -1
#define M 1000003
__int64 T[M+1];
void trans(char *s){
    for(int i = 0; i < strlen(s); i++){
        if(s[i] == 'A') s[i] = '1';
        else if(s[i] == 'C') s[i] = '2';
        else if(s[i] == 'G') s[i] = '3';
        else if(s[i] == 'T') s[i] = '4';
    }
}
__int64 stringToInt(char s[]){
    __int64 t = 0;
    __int64 p = 1;
    for(int i = strlen(s)-1; i >= 0; i--){
        t += (s[i]-'0')*p;
        p *= 10;
    }
    return t;
}
void insert(__int64 c){
    T[c] = 1;
}
int find(__int64 d){
    if(T[d] == NIL){
        return -1;
    }
    else{
        return 1;
    }
}
int main(){
    for(int i = 0; i < M; i++) T[i] = NIL;

    int n;
    scanf("%d", &n);
    while(n--){
        char a[10], b[13];
        scanf("%s %s", a, b);
        if(a[0] == 'i'){
            trans(b);
            __int64 c = stringToInt(b);
            insert(c);
        }
        else{
            trans(b);
            __int64 d = stringToInt(b);
            if(find(d) != -1){
                printf("yes\n");
            }
            else{
                printf("no\n");
            }
        }
    }

    return 0;
}


Compiler output:
a.cc:7:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    7 | __int64 T[M+1];
      | ^~~~~~~
      | __int64_t
a.cc:16:1: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | __int64 stringToInt(char s[]){
      | ^~~~~~~
      | __int64_t
a.cc:25:6: error: variable or field 'insert' declared void
   25 | void insert(__int64 c){
      |      ^~~~~~
a.cc:25:13: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   25 | void insert(__int64 c){
      |             ^~~~~~~
      |             __int64_t
a.cc:28:10: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   28 | int find(__int64 d){
      |          ^~~~~~~
      |          __int64_t
a.cc: In function 'int main()':
a.cc:37:32: error: 'T' was not declared in this scope
   37 |     for(int i = 0; i < M; i++) T[i] = NIL;
      |                                ^
a.cc:46:13: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   46 |             __int64 c = stringToInt(b);
      |             ^~~~~~~
      |             __int64_t
a.cc:47:20: error: 'c' was not declared in this scope
   47 |             insert(c);
      |                    ^
a.cc:47:13: error: 'insert' was not declared in this scope
   47 |             insert(c);
      |             ^~~~~~
a.cc:51:13: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   51 |             __int64 d = stringToInt(b);
      |             ^~~~~~~
      |             __int64_t
a.cc:52:21: error: 'd' was not declared in this scope
   52 |             if(find(d) != -1){
      |                     ^
a.cc:52:22: error: 'find' cannot be used as a function
   52 |             if(find(d) != -1){
      |                      ^
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define INF 0x3f3f3f3f
#define NIL -1
#define M 1000003
long long T[M+1];
void trans(char *s){
    for(int i = 0; i < strlen(s); i++){
        if(s[i] == 'A') s[i] = '1';
        else if(s[i] == 'C') s[i] = '2';
        else if(s[i] == 'G') s[i] = '3';
        else if(s[i] == 'T') s[i] = '4';
    }
}
long longstringToInt(char s[]){
    long longt = 0;
    long longp = 1;
    for(int i = strlen(s)-1; i >= 0; i--){
        t += (s[i]-'0')*p;
        p *= 10;
    }
    return t;
}
void insert(long longc){
    T[c] = 1;
}
int find(long longd){
    if(T[d] == NIL){
        return -1;
    }
    else{
        return 1;
    }
}
int main(){
    for(int i = 0; i < M; i++) T[i] = NIL;

    int n;
    scanf("%d", &n);
    while(n--){
        char a[10], b[13];
        scanf("%s %s", a, b);
        if(a[0] == 'i'){
            trans(b);
            long longc = stringToInt(b);
            insert(c);
        }
        else{
            trans(b);
            long longd = stringToInt(b);
            if(find(d) != -1){
                printf("yes\n");
            }
            else{
                printf("no\n");
            }
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'long int longstringToInt(char*)':
a.cc:20:9: error: 't' was not declared in this scope
   20 |         t += (s[i]-'0')*p;
      |         ^
a.cc:20:25: error: 'p' was not declared in this scope
   20 |         t += (s[i]-'0')*p;
      |                         ^
a.cc:23:12: error: 't' was not declared in this scope
   23 |     return t;
      |            ^
a.cc: In function 'void insert(long int)':
a.cc:26:7: error: 'c' was not declared in this scope
   26 |     T[c] = 1;
      |       ^
a.cc: In function 'int find(long int)':
a.cc:29:10: error: 'd' was not declared in this scope
   29 |     if(T[d] == NIL){
      |          ^
a.cc: In function 'int main()':
a.cc:46:26: error: 'stringToInt' was not declared in this scope; did you mean 'longstringToInt'?
   46 |             long longc = stringToInt(b);
      |                          ^~~~~~~~~~~
      |                          longstringToInt
a.cc:47:20: error: 'c' was not declared in this scope
   47 |             insert(c);
      |                    ^
a.cc:51:26: error: 'stringToInt' was not declared in this scope; did you mean 'longstringToInt'?
   51 |             long longd = stringToInt(b);
      |                          ^~~~~~~~~~~
      |                          longstringToInt
a.cc:52:21: error: 'd' was not declared in this scope
   52 |             if(find(d) != -1){
      |                     ^
a.cc: In function 'int find(long int)':
a.cc:35:1: warning: control reaches end of non-void function [-Wreturn-type]
   35 | }
      | ^
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define INF 0x3f3f3f3f
#define NIL (-1)
//#define M 1000003
#define M 16777333
using namespace std;
int T[M+1];
void trans(char *s){
    for(int i = 0; i < strlen(s); i++){
        if(s[i] == 'A') s[i] = '0';
        else if(s[i] == 'C') s[i] = '1';
        else if(s[i] == 'G') s[i] = '2';
        else if(s[i] == 'T') s[i] = '3';
    }
}
int stringToInt(char s[]){
    int t = 0;
    int p = 1;
    for(int i = strlen(s)-1; i >= 0; i--){
        t += (s[i]-'0')*p;
        p *= 4;
    }
    return t;
}
int h1(int a){
    return (int)(a % M);
}
int h2(int a){
    return 1+(int)(a % (M-1));
}
int h(int a, int i){
    return (h1(a) + i * h2(a))%M;
}

void insert(int c){
    int i = 0;
    while(true){
        int temp = h(c, i);
        if(T[temp] == NIL){
            T[temp] = c;
            i++;
            return ;
        }

    }
}
int find(int d){
    int i = 0;
    while(true){
        int temp = h(d, i);
        if(T[temp] == NIL){
            return -1;
        }
        else if(T[temp] == d){
            return 1;
        }
        else{
            i++;
            if(i >= M) return -1;
        }
    }
}
int main(){
    for(int i = 0; i < M; i++) T[i] = NIL;

    int n;
    scanf("%d", &n);
    while(n--){
        char a[10], b[14];
        scanf("%s %s", a, b);
        if(a[0] == 'i'){
            trans(b);
            int c = stringToInt(b);
            insert(c);


Compiler output:
a.cc: In function 'int main()':
a.cc:76:23: error: expected '}' at end of input
   76 |             insert(c);
      |                       ^
a.cc:73:24: note: to match this '{'
   73 |         if(a[0] == 'i'){
      |                        ^
a.cc:76:23: error: expected '}' at end of input
   76 |             insert(c);
      |                       ^
a.cc:70:15: note: to match this '{'
   70 |     while(n--){
      |               ^
a.cc:76:23: error: expected '}' at end of input
   76 |             insert(c);
      |                       ^
a.cc:65:11: note: to match this '{'
   65 | int main(){
      |           ^
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 1046527

class Dictionary{
    private:
        vector<string> data;
        map<int, string> m;
    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(10, 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(m[hashed_Kay] == "") break;
    }
    m[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(m[hashed_Kay] == str) return true;
        else if(m[hashed_Kay].length() == 0) return false;
    }
}

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

    int n;
    cin >> n;

    string op;
    string word;
    Dictionary dic;
    
    REP(_, n){
        cin >> op;
        cin >> 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: In function 'int main()':
a.cc:88:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   88 |         if (op[0] == "i") dic.hash_Insert(word);
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 1046527

class Dictionary{
    private:
        vector<string> data;
        map<int, string> m;
    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(10, 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(m[hashed_Kay] == "") break;
    }
    m[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(m[hashed_Kay] == str) return true;
        else if(m[hashed_Kay].length() == 0) return false;
    }
}

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

    int n;
    cin >> n;

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

   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:88:19: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   88 |         if (op[0] == "i") dic.insert(word);
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 1046527

class Dictionary{
    private:
        vector<string> data;
        map<int, string> m;
    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(10, 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(m[hashed_Kay] == "" && m[hashed_Kay] == str) break;
    }
    m[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(m[hashed_Kay] == str) return true;
        else if(m[hashed_Kay].length() == 0) return false;
    }
}

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

    int n;
    cin >> n;

    string op;
    string word;
    
    REP(_, n){
        cin >> op;
        cin >> 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: In function 'int main()':
a.cc:87:27: error: 'dic' was not declared in this scope; did you mean 'div'?
   87 |         if (op[0] == 'i') dic.hash_Insert(word);
      |                           ^~~
      |                           div
a.cc:88:17: error: 'dic' was not declared in this scope; did you mean 'div'?
   88 |         else if(dic.hash_Find(word)) cout << "yes" << "\n";
      |                 ^~~
      |                 div
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
map<int, string> m;

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

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

void 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(m[hashed_Kay] == "" or m[hashed_Kay] == str) break;
    }
    m[hashed_Kay] = str;
}


bool 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(m[hashed_Kay] == str) return true;
        else if(m[hashed_Kay].length() == 0) return false;
    }
}

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

    int n;
    cin >> n;

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

   
}


Compiler output:
a.cc:20:5: error: expected unqualified-id before ':' token
   20 | int :hash_1(int kay){ return kay%M; }
      |     ^
a.cc:21:5: error: expected unqualified-id before ':' token
   21 | int :hash_2(int kay){ return 1+(kay%(M-1)); }
      |     ^
a.cc: In function 'void hash_Insert(std::string)':
a.cc:36:22: error: 'hash_1' was not declared in this scope
   36 |         hashed_Kay = hash_1(kay) + i*hash_2(kay);
      |                      ^~~~~~
a.cc:36:38: error: 'hash_2' was not declared in this scope
   36 |         hashed_Kay = hash_1(kay) + i*hash_2(kay);
      |                                      ^~~~~~
a.cc: In function 'bool hash_Find(std::string)':
a.cc:48:22: error: 'hash_1' was not declared in this scope
   48 |         hashed_Kay = hash_1(kay) + i*hash_2(kay);
      |                      ^~~~~~
a.cc:48:38: error: 'hash_2' was not declared in this scope
   48 |         hashed_Kay = hash_1(kay) + i*hash_2(kay);
      |                                      ^~~~~~
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

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

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

void hash_Insert(string str, string data[])
{
    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] == "0" or data[hashed_Kay] == str)
            break;
    }
    data[hashed_Kay] = str;
}

bool hash_Find(string str, string data[])
{
    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] == "0")
            return false;
    }
}

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

    int n;
    cin >> n;

    string op, word;
    data[1000000];

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


Compiler output:
a.cc: In function 'int main()':
a.cc:70:9: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   70 |     data[1000000];
      |         ^
a.cc:76:24: error: cannot resolve overloaded function 'data' based on conversion to type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'}
   76 |             hash_Insert(word, data);
      |             ~~~~~~~~~~~^~~~~~~~~~~~
a.cc:77:27: error: cannot resolve overloaded function 'data' based on conversion to type 'std::string*' {aka 'std::__cxx11::basic_string<char>*'}
   77 |         else if (hash_Find(word, data))
      |                  ~~~~~~~~~^~~~~~~~~~~~