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

#include <array>
#include <iostream>
#include <map>

#define M 1046527
#define L 14

const std::map<char, int> charint{
    {'A', 1},
    {'C', 2},
    {'G', 3},
    {'T', 4},
};

int getChar(char ch) { return charint.at(ch); }

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

struct Dict {
  std::array<std::string, M> v{};

  bool insert(char item[]) {
    auto key = h1(getKey(item));
    if (item[0] != '\0') {
      v[key] = item;
      return true;
    }
    for (int i = 0; i < M; i++) {
      key = h2(getKey(item));
      if (item[0] != '\0') {
        v[key] = item;
        return true;
      }
    }
    return false;
  }

  bool find(char item[]) { return v[getKey(item)] == item; }

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

int main() {
  int n;
  std::cin >> n;

  char cmd[7];
  char data[L];
  Dict *d = new Dict{};
  for (int i = 0; i < n; i++) {
    std::cin >> cmd >> data;
    if (cmd[0] == 'i') {
      d->insert(data);
    } else {
      std::cout << (d->find(data) ? "yes" : "no") << std::endl;
    }
  }
}



Compiler output:
a.cc: In function 'long long int getKey(char*)':
a.cc:19:36: error: 'strlen' is not a member of 'std'; did you mean 'mbrlen'?
   19 |   for (std::size_t i = 0; i < std::strlen(str); ++i) {
      |                                    ^~~~~~
      |                                    mbrlen
Language: C++

#include<iostream>
#include<map>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    map<string, int>m;
    int q;
    cin>>q;
    while(q--){
        string command, str;
        cin>>command>>str;
        if(commant=="insert"){
            m[str]=1;
        }
        else if(command=="find"){
            map<string, int>::iterator itr=m.map(str);
            if(itr==m.end())
                cout<<"no"<<endl;
            else
                cout<<"yes"<<endl;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: 'commant' was not declared in this scope; did you mean 'command'?
   12 |         if(commant=="insert"){
      |            ^~~~~~~
      |            command
a.cc:16:46: error: invalid use of 'std::map<std::__cxx11::basic_string<char>, int>::map'
   16 |             map<string, int>::iterator itr=m.map(str);
      |                                              ^~~
Language: C++

#include<iostream>
#include<map>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    map<string, int>m;
    int q;
    cin>>q;
    while(q--){
        string command, str;
        cin>>command>>str;
        if(command=="insert"){
            m[str]=1;
        }
        else if(command=="find"){
            map<string, int>::iterator itr=m.map(str);
            if(itr==m.end())
                cout<<"no"<<endl;
            else
                cout<<"yes"<<endl;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:46: error: invalid use of 'std::map<std::__cxx11::basic_string<char>, int>::map'
   16 |             map<string, int>::iterator itr=m.map(str);
      |                                              ^~~
Language: C++

#include<cstdio>
#include<string>
#include<vector>
using namespace std;

int find(vector<string> a, string str) {
	for (vector<string>::iterator j = a.begin(); j != a.end(); j++) {
		if (*j == str) {
			return 1;
		}
	}
	return 0;
}

int main(void) {
	int num;
	char command[8];
	char str[13];
	vector<string> a;

	scanf_s("%d", &num);
	for (int i = 0; i < num; i++) {
		scanf_s("%s", command);
		scanf_s("%s", str);
		if (command[0] == 'i') {
			a.push_back(str);
		} else {
			if (find(a, str)) {
				printf("yes\n");
			} else {
				printf("no\n");
			}
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   21 |         scanf_s("%d", &num);
      |         ^~~~~~~
      |         scanf
Language: C++

#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
#define M 1046527
#define NIL (-1)
#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 return 4;
}

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

int main(void) {
	int n, h;
	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)) {
				printf("yes\n");
			} else {
				printf("no\n");
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'long long int getKey(char*)':
a.cc:21:29: error: 'strlen' was not declared in this scope
   21 |         for (int i = 0; i < strlen(str); i++) {
      |                             ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<algorithm>
  +++ |+#include <cstring>
    5 | using namespace std;
a.cc: In function 'int find(char*)':
a.cc:36:21: error: 'strcmp' was not declared in this scope
   36 |                 if (strcmp(H[h], str) == 0)return 1;
      |                     ^~~~~~
a.cc:36:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:37:26: error: 'strlen' was not declared in this scope
   37 |                 else if (strlen(H[h]) == 0)return 0;
      |                          ^~~~~~
a.cc:37:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int insert(char*)':
a.cc:47:21: error: 'strcmp' was not declared in this scope
   47 |                 if (strcmp(H[h], str) == 0)return 1;
      |                     ^~~~~~
a.cc:47:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:48:26: error: 'strlen' was not declared in this scope
   48 |                 else if (strlen(H[h]) == 0) {
      |                          ^~~~~~
a.cc:48:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:49:25: error: 'strcpy' was not declared in this scope
   49 |                         strcpy(H[h], str);
      |                         ^~~~~~
a.cc:49:25: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
#define M 1046527
#define NIL (-1)
#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 if (ch == 'T') return 4;
	else return 0;
}

long long getKey(char str[]) {
	long long sum = 0, p = 1;
	for (int 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 key, h;
	key = getKey(str);
	for (int 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[]) {
	printf("kfdsj");
	long long key, h;
	key = getKey(str);
	for (int 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_s(H[h], str);
			return 0;
		}
	}
	return 0;
}

int main(void) {
	int n, h;
	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)) {
				printf("yes\n");
			} else {
				printf("no\n");
			}
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'long long int getKey(char*)':
a.cc:22:29: error: 'strlen' was not declared in this scope
   22 |         for (int i = 0; i < strlen(str); i++) {
      |                             ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<algorithm>
  +++ |+#include <cstring>
    5 | using namespace std;
a.cc: In function 'int find(char*)':
a.cc:37:21: error: 'strcmp' was not declared in this scope
   37 |                 if (strcmp(H[h], str) == 0)return 1;
      |                     ^~~~~~
a.cc:37:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:38:26: error: 'strlen' was not declared in this scope
   38 |                 else if (strlen(H[h]) == 0)return 0;
      |                          ^~~~~~
a.cc:38:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int insert(char*)':
a.cc:49:21: error: 'strcmp' was not declared in this scope
   49 |                 if (strcmp(H[h], str) == 0)return 1;
      |                     ^~~~~~
a.cc:49:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:50:26: error: 'strlen' was not declared in this scope
   50 |                 else if (strlen(H[h]) == 0) {
      |                          ^~~~~~
a.cc:50:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:51:25: error: 'strcpy_s' was not declared in this scope
   51 |                         strcpy_s(H[h], str);
      |                         ^~~~~~~~
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>
#define N 3001553

using namespace std;
char **hs;

int dd(char d){
	switch(d){
		case 'A':
		return 2;

		case 'C':
		return 3;
		
		case 'T':
		return 4;
		
		case 'G':
		return 5;
	}
	return 1;
}

int ids(char *c){
	int id = 1;
	int pos = 0;
	while(1){
		id *= 6
		if(c[pos] == '\0') break;
		id = id*dd(c[pos])%N;
		pos++;
	}
	return id;
}

void init(){
	hs = new char*[N];
	for(int i=0;i<N;i++){
		hs[i] = new char[20];
		hs[i][0] = '?';
	}
}
void end(){
	for(int i=0;i<N;i++){
		free(hs[i]);
	}
	free(hs);
}
int h1(int key){
	return key%N;
}
int h2(int key){
	return 1+key%(N-1);
}
int h(int key, int i){
	return (h1(key)+i*h2(key))%N;
}

int insert(char *c){
	int i=0;
	int key = ids(c);
	while(true){
		int j = h(key, i);
		if(hs[j][0] == '?'){
			strcpy(hs[j], c);
			return j;
		} else {
			i = i+1;
		}
	}
}

bool search(char* c){
	int i=0;
	int key = ids(c);
	while(true){
		int j = h(key, i);
		if( strcmp(hs[j], c) == 0 ){
			return true;
		} else if( hs[j][0]=='?' || i>=N){
			return false;
		}
		i = i+1;
	}
}


int main(){
	init();
	int n;
	scanf("%d", &n);
	char in[9];
	char inn[14];
	for(int i=0;i<n;i++){
		scanf(" %s %s", in, inn);
		if(in[0] == 'i'){
			insert(inn);
		} else {
			if(search(inn)){
				printf("yes\n");
			} else {
				printf("no\n");
			}
		}
	}
	end();
	return 0;
}

Compiler output:
a.cc: In function 'int ids(char*)':
a.cc:30:24: error: expected ';' before 'if'
   30 |                 id *= 6
      |                        ^
      |                        ;
   31 |                 if(c[pos] == '\0') break;
      |                 ~~
Language: C++

#include<stdio.h>
#include<string.h>
 
#define M 6000
#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;
}
 

Compiler output:
a.cc: In function 'int getChar(char)':
a.cc:14:1: warning: control reaches end of non-void function [-Wreturn-type]
   14 | }
      | ^
/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 <bits/stdc++.h>
using namespace std;

class Hash {
private:
	static const int MOD = 1046527;
	
	int my_ctoi(char c) {
		if (c == 'A') return 0;
		if (c == 'C') return 1;
		if (c == 'G') return 2;
		if (c == 'T') return 3;
		return 4;
	}
	
	int getKey(const string& str) {
		int key = 0;
		size_t len = str.size();
		for (size_t i = 0; i < len; ++i) key = 5 * key + my_ctoi(str[i]);
		return key;
	}
	
	int hash1(int key) {
		return key % MOD;
	}
	
	int hash2(int key) {
		return 1 + (key % (MOD - 1));
	}
	
public:
	Hash() {}
	
	int getHash(const string& str, int collision_count) {
		int key = getKey(str);
		return (hash1(key) + collision_count * hash2(key)) % MOD;
	}
};

class Dictionary {
private:
	static const string NIL = "#";
	vector< string > table;
	
	Hash hash;
	
public:
	Dictionary() { table.assign(1046527, NIL); }
	
	void insert(string& str) {
		int collision_count = 0;
		
		while (1) {
			int hs = hash.getHash(str, collision_count);
			
			if (table[hs] == NIL) {
				table[hs] = str;
				break;
			} else {
				++collision_count;
			}
		}
	}
	
	bool find(string& str) {
		int collision_count = 0;
		
		while (1) {
			int hs = hash.getHash(str, collision_count);
			
			if (table[hs] == str) {
				return true;
			} else if (table[hs] == NIL) {
				return false;
			} else {
				++collision_count;
			}
		}
	}
};

int main() {
	Dictionary dict;
	
	int n;
	cin >> n;
	
	for (int i = 0; i < n; ++i) {
		string op, str;
		cin >> op >> str;
		
		if (op == "insert") {
			dict.insert(str);
		}
		
		if (op == "find") {
			if (dict.find(str)) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
}

Compiler output:
a.cc:42:29: error: in-class initialization of static data member 'const std::string Dictionary::NIL' of non-literal type
   42 |         static const string NIL = "#";
      |                             ^~~
a.cc:42:35: error: call to non-'constexpr' function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with <template-parameter-2-1> = std::allocator<char>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
   42 |         static const string NIL = "#";
      |                                   ^~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:646:7: note: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with <template-parameter-2-1> = std::allocator<char>; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' declared here
  646 |       basic_string(const _CharT* __s, const _Alloc& __a = _Alloc())
      |       ^~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int char2int(char ch) {
    if (ch == 'A') return 1;
    if (ch == 'C') return 2;
    if (ch == 'G') return 3;
    if (ch == 'T') return 4;
    return 0;
}

int string2hash(char str[]) {
    int length = strlen(str);
    int sum = 0;
    int phase = 1;
    for (int i = 0; i < length; ++i) {
        sum += phase * char2int(str[i]);
        phase *= 5;
    }
    return sum;
}

int find(char str[], int dict[]) {
    int hash = string2hash(str);
    if (dict[hash] == 1) return 1;
    else return 0;
}

void insert(char str[], int dict[]) {
    int hash = string2hash(str);
    if (dict[hash] == 0) dict[hash] = 1;
}

int dict[16777216] = {0};

int main() {

    int n;
    cin >> n;

    for (int i = 0; i < n; ++i) {
        char command[12];
        char str[12];
        cin >> command >> str;
        if (command[0] == 'i') {
            insert(str, dict);
        } else {
            if (find(str, dict) == 1) {
                cout << "yes" << endl;
            } else {
                cout << "no" << endl;
            }
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int string2hash(char*)':
a.cc:13:18: error: 'strlen' was not declared in this scope
   13 |     int length = strlen(str);
      |                  ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;

bool search(const vector<string> src, string str){
  int count = src.size();
  for (int i = 0; i < count; i++) {
    if (src[i] == str) {
        return true;
      }
    }
  return false;
}

/*
int asobi(){
  vector<string> a;
  string str = "a";
  a.push_back(str);
  str = "b";
  a.push_back(str);
  str = "c";
  a.push_back(str);

  return search(a, "b");
}
*/


int main(){
  //cout << asobi() << endl;
  string str1 = "insert";
  //string str2 = "find";
  string buf1, buf2;
  int count;
  cin >> count;
  vector<string> src;
  for (size_t i = 0; i < count; i++) {
    cin >> buf1 >> buf2;
    //insert?????¨????§???????
    if(buf1 == str1){
      src.push_back(buf2);
    //insert?????¨????????????
    //find?????¨????§???????
    else{ //find?????¨???
      if(search(src, buf2)) {
        cout <<"yes" << endl;
      }
      else{
        cout << "no" << endl;
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:5: error: expected '}' before 'else'
   46 |     else{ //find?????¨???
      |     ^~~~
a.cc:42:21: note: to match this '{'
   42 |     if(buf1 == str1){
      |                     ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
using namespace std;

bool search(const vector<string> src, string str){
  int count = src.size();
  for (int i = 0; i < count; i++) {
    if (src[i] == str) {
        return true;
      }
    }
  return false;
}

/*
int asobi(){
  vector<string> a;
  string str = "a";
  a.push_back(str);
  str = "b";
  a.push_back(str);
  str = "c";
  a.push_back(str);

  return search(a, "b");
}
*/

int main(){
  string str1 = "insert",str2 = "find";
  string buf1, buf2;
  size_t count;
  cin >> count;
  vector<string> src;
  for (size_t i = 0; i < count; i++) {
    cin >> buf1 >> buf2;
    if(buf1 == str1){
      src.push_back(buf2);
    }//insert????????????, find???????§?
    if(buf1 == str2){
      if(search(src, buf2)) {
        cout <<???"yes" << endl;
      }
      else{
        cout << "no" << endl;
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:16: error: expected primary-expression before '?' token
   43 |         cout <<???"yes" << endl;
      |                ^
a.cc:43:17: error: expected primary-expression before '?' token
   43 |         cout <<???"yes" << endl;
      |                 ^
a.cc:43:18: error: expected primary-expression before '?' token
   43 |         cout <<???"yes" << endl;
      |                  ^
a.cc:43:25: error: invalid operands of types 'const char [4]' and '<unresolved overloaded function type>' to binary 'operator<<'
   43 |         cout <<???"yes" << endl;
      |                   ~~~~~~^~~~~~~
a.cc:43:32: error: expected ':' before ';' token
   43 |         cout <<???"yes" << endl;
      |                                ^
      |                                :
a.cc:43:32: error: expected primary-expression before ';' token
a.cc:43:32: error: expected ':' before ';' token
   43 |         cout <<???"yes" << endl;
      |                                ^
      |                                :
a.cc:43:32: error: expected primary-expression before ';' token
a.cc:43:32: error: expected ':' before ';' token
   43 |         cout <<???"yes" << endl;
      |                                ^
      |                                :
a.cc:43:32: error: expected primary-expression before ';' token
Language: C++

#include <cstdio>
#include <iostream>

using namespace std;

const int M = 1046527;
const int NIL = -1;
const int L = 14;

char H[M][L];

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

long long getKey(char str[])
{
	long long sum = 0, p = 1;

	for (int 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 key, h;
	key = getKey(str);
	for (int 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;
	}
}

int insert(char str[])
{
	long long key, h;
	key = getKey(str);
	for (int i = 0;; ++i) {
		h = (h1(key) + i * h2(key));
		if (strcmp(H[h], str) == 0) return 1;
		else if (strlen(H[h]) == 0) {
			strcpy(H[h], str);
			return 0;
		}
	}
}

int main()
{
	for (int i = 0; i < M; ++i) H[i][0] = '\0';

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

	for (int i = 0; i < n; ++i) {
		char cmd[12];
		char wrd[12];
		scanf("%s %s", cmd, wrd);

		if (cmd[0] == 'i') {
			insert(wrd);
		} else {
			cout << (find(wrd) ? "yes" : "no") << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'long long int getKey(char*)':
a.cc:25:29: error: 'strlen' was not declared in this scope
   25 |         for (int i = 0; i < strlen(str); ++i) {
      |                             ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <iostream>
  +++ |+#include <cstring>
    3 | 
a.cc: In function 'int find(char*)':
a.cc:42:21: error: 'strcmp' was not declared in this scope
   42 |                 if (strcmp(H[h], str) == 0) return 1;
      |                     ^~~~~~
a.cc:42:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:43:26: error: 'strlen' was not declared in this scope
   43 |                 else if (strlen(H[h]) == 0) return 0;
      |                          ^~~~~~
a.cc:43:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int insert(char*)':
a.cc:53:21: error: 'strcmp' was not declared in this scope
   53 |                 if (strcmp(H[h], str) == 0) return 1;
      |                     ^~~~~~
a.cc:53:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:54:26: error: 'strlen' was not declared in this scope
   54 |                 else if (strlen(H[h]) == 0) {
      |                          ^~~~~~
a.cc:54:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:55:25: error: 'strcpy' was not declared in this scope
   55 |                         strcpy(H[h], str);
      |                         ^~~~~~
a.cc:55:25: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

import java.io.*;
import java.util.Arrays;
import java.util.HashSet;

class Main{
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		HashSet<String> list = new HashSet<String>();

		for ( int i = 0; i<n ; i++ ) {
			String[] str = (br.readLine()).split(" ");
			if (str[0].equals("insert")) {
				list.add(str[1]);
			}else if(str[0].equals("find")){
				if (list.contains(str[1])) {
					System.out.println("yes");
				}else{
					System.out.println("no");

				}
			}else{
				System.out.println("Error");
			}
		}

	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.*;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Arrays;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.HashSet;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:15: error: expected ':' before 'static'
    6 |         public static void main(String[] args) throws IOException{
      |               ^~~~~~~
      |               :
a.cc:6:33: error: 'String' has not been declared
    6 |         public static void main(String[] args) throws IOException{
      |                                 ^~~~~~
a.cc:6:42: error: expected ',' or '...' before 'args'
    6 |         public static void main(String[] args) throws IOException{
      |                                          ^~~~
a.cc:6:46: error: expected ';' at end of member declaration
    6 |         public static void main(String[] args) throws IOException{
      |                                              ^
      |                                               ;
a.cc:6:48: error: 'throws' does not name a type
    6 |         public static void main(String[] args) throws IOException{
      |                                                ^~~~~~
a.cc:28:2: error: expected ';' after class definition
   28 | }
      |  ^
      |  ;
Language: C++

#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <set>
#include <string>
using namespace std;

enum Command {
  INSERT,
  FIND
};

int main(){
  int n;
  int which_command;
  unordered_set<string> A;
  string word;
  cin >> n;
  for (int i=0; i<2*n; i++){
    cin >> word;
    if (word == "insert") {
        which_command = INSERT;
    } else if (word == "find") {
        which_command = FIND;
    } else {
      switch (which_command){
        case INSERT:
          A.insert(word);
          break;
        case FIND:
          if (A.count(word) > 0)
            cout << "yes" << endl;
          else
            cout << "no" << endl;
          break;
        default:
          break;
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:3: error: 'unordered_set' was not declared in this scope
   17 |   unordered_set<string> A;
      |   ^~~~~~~~~~~~~
a.cc:6:1: note: 'std::unordered_set' is defined in header '<unordered_set>'; this is probably fixable by adding '#include <unordered_set>'
    5 | #include <set>
  +++ |+#include <unordered_set>
    6 | #include <string>
a.cc:17:23: error: expected primary-expression before '>' token
   17 |   unordered_set<string> A;
      |                       ^
a.cc:17:25: error: 'A' was not declared in this scope
   17 |   unordered_set<string> A;
      |                         ^
Language: C++

#include <set>
#include <string>
#include <iostream>
using namespace std;

int n; // number of lines for input
typedef set<string> set_t; // define set of strings
set_t A; // Initialize A 
string command; // either insert or find
string word; // string to insert
int main() {
  cin >> n;
  for (int i=0; i<n; ++i) {
    cin >> command;
    if (command == "insert") {
      cin >> word;
      if (word.size() > 12) break;
      A.insert(word);
    }
    else if (command == "find") {
      cin >> word;
      if (A.count(word) == 1) cout << "yes" << endl;
      else cout << "no" << endl;
    }
    else break;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:26:4: error: expected '}' at end of input
   26 |   }
      |    ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <cstdlib>
#include <queue>
#include <vector>
#include <set>

using namespace std;
int main() {
	int n;
	cin >> n;
	set <string> set_t;
	set_t A;
		string s;
	while( n > 0 ) { 
		cin >> s;
		if ( s == "insert" ) {
			cin >> s;
			A.insert(s);
		}
		else
			if ( s == "find" ) {
			cin >> s;
				int m = A.count(s);
			if (m == 1) cout << "yes" << endl;
			else cout << "no" << endl;
		}
		n = n-1;
		}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected ';' before 'A'
   15 |         set_t A;
      |              ^~
      |              ;
a.cc:21:25: error: 'A' was not declared in this scope
   21 |                         A.insert(s);
      |                         ^
a.cc:26:41: error: 'A' was not declared in this scope
   26 |                                 int m = A.count(s);
      |                                         ^
Language: C++

#include <unordered_set>
#include <string>
#include <iostream>
using namespace std;

int main(){
  typedef set<string> set_t;
  set_t A;
  int n;
  cin >> n;
  string inst, word;
  for(int i=0; i<n; i++){
    cin >> inst >> word;
    if(inst == "insert"){
      A.insert(word);
    }
    else{
      int m = A.count(word);
      if(m==0)cout << "no" << endl;
      else cout << "yes" << endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:11: error: 'set' does not name a type
    7 |   typedef set<string> set_t;
      |           ^~~
a.cc:8:3: error: 'set_t' was not declared in this scope
    8 |   set_t A;
      |   ^~~~~
a.cc:15:7: error: 'A' was not declared in this scope
   15 |       A.insert(word);
      |       ^
a.cc:18:15: error: 'A' was not declared in this scope
   18 |       int m = A.count(word);
      |               ^
Language: C++

//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_C&lang=jp
#include <iostream>
#include <string>
#include <vector>
#include <set>
using namespace std;

int main(){
    std::set<string> dic;

    int count;
    cin >> count;

    string str1 = "insert",str2 = "find";
    string bufl, buf2;

    for(int i=0; i<count; i++){
        cin >> buf1 >> buf2;
        if(buf1 == str1){
            dic.insert(buf2);
          }
        if(buf1 == str2){
          if(dic.count(buf1) > 0) cout << "yes" << endl;
          else cout << "no" << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: 'buf1' was not declared in this scope; did you mean 'buf2'?
   18 |         cin >> buf1 >> buf2;
      |                ^~~~
      |                buf2
Language: C++

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {
	static final int A = 1;
	static final int C = 2;
	static final int G = 4;		
	static final int T = 8;
	public static void main(String[] args) throws NumberFormatException, IOException {
		
		//????????????????????????
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));

		
		//?????????
		int n = Integer.parseInt(bf.readLine());
		boolean[] hash = new boolean[1000000];
		
		for(int i=0;i<n;i++){
			String[] str =bf.readLine().split(" ");
			String command =str[0];
			String ch = str[1];
			
			if(command.equals("insert")){
				int count =0;
				for(int j=0;j<ch.length();j++){
					switch(ch.charAt(j)){
					case 'A':
						count+=A;
						break;
					case 'C':
						count+=C;
						break;
					case 'T':
						count+=T;
						break;
					case 'G':
						count+=G;
						break;
					}
				}
				hash[count]=true;
			}else{
				int count =0;
				for(int j=0;j<ch.length();j++){
					switch(ch.charAt(j)){
					case 'A':
						count+=A;
						break;
					case 'C':
						count+=C;
						break;
					case 'T':
						count+=T;
						break;
					case 'G':
						count+=G;
						break;
					}
				}
				if(hash[count]){
					System.out.println("yes");
				}else{
					System.out.println("no");
				}
			}
		}

	}

}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.IOException;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: expected unqualified-id before 'public'
    6 | public class Main {
      | ^~~~~~
Language: C++

#include <cmath>
#include <cstdio>
#include <string>
#include <vector>
 
using namespace std;
 
#define MAX_LETTERS  12
 
const char Alphabet[4] = "ACGT";

const int power[MAX_LETTERS + 1] = { 1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216 };
 
int cipher(string S)
{
    int Ans = 0;
    
    unsigned size_ = S.size()
 
    for (string::size_type i = 0; i < size_; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            if (Alphabet[j] == S[i])
            {
                Ans += power[size_ - i - 1] * j;
            }
        }
    }
 
    return Ans;
}
 
int main()
{
    vector<vector<bool> > D;
 
    unsigned n;
 
    for (int i = 0; i <= MAX_LETTERS; i++)
    {
        D.push_back(vector<bool>(power[i], false));
    }
 
    scanf("%d", &n);
 
    vector<string> W;
 
    vector<bool> F(n);
 
    for (vector<bool>::size_type i = 0; i < n; i++)
    {
        char S1[20], S2[20];
 
        scanf("%s%s", &S1, &S2);
 
        if (S1[0] == 'f')
        {
            F[i] = true;
        }
 
        W.push_back(S2);
    }
 
    for (vector<string>::size_type i = 0; i < n; i++)
    {
        if (F[i] == false)
        {
            D[W[i].size()][cipher(W[i])] = true;
        }
        else
        {
            printf("%s\n", (D[W[i].size()][cipher(W[i])] ? "yes" : "no"));
        }
    }
 
    return 0;
}

Compiler output:
a.cc:10:26: error: initializer-string for 'const char [4]' is too long [-fpermissive]
   10 | const char Alphabet[4] = "ACGT";
      |                          ^~~~~~
a.cc: In function 'int cipher(std::string)':
a.cc:20:5: error: expected ',' or ';' before 'for'
   20 |     for (string::size_type i = 0; i < size_; i++)
      |     ^~~
a.cc:20:35: error: 'i' was not declared in this scope
   20 |     for (string::size_type i = 0; i < size_; i++)
      |                                   ^
Language: C++

#include <cmath>
#include <cstdio>
#include <string>
#include <vector>
 
using namespace std;
 
#define MAX_LETTERS  12
 
const char Alphabet[5] = "ACGT";

const int power[MAX_LETTERS + 1] = { 1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216 };
 
int cipher(string S)
{
    int Ans = 0;
    
    unsigned size_ = S.size()
 
    for (string::size_type i = 0; i < size_; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            if (Alphabet[j] == S[i])
            {
                Ans += power[size_ - i - 1] * j;
            }
        }
    }
 
    return Ans;
}
 
int main()
{
    vector<vector<bool> > D;
 
    unsigned n;
 
    for (int i = 0; i <= MAX_LETTERS; i++)
    {
        D.push_back(vector<bool>(power[i], false));
    }
 
    scanf("%d", &n);
 
    vector<string> W;
 
    vector<bool> F(n);
 
    for (vector<bool>::size_type i = 0; i < n; i++)
    {
        char S1[20], S2[20];
 
        scanf("%s%s", &S1, &S2);
 
        if (S1[0] == 'f')
        {
            F[i] = true;
        }
 
        W.push_back(S2);
    }
 
    for (vector<string>::size_type i = 0; i < n; i++)
    {
        if (F[i] == false)
        {
            D[W[i].size()][cipher(W[i])] = true;
        }
        else
        {
            printf("%s\n", (D[W[i].size()][cipher(W[i])] ? "yes" : "no"));
        }
    }
 
    return 0;
}

Compiler output:
a.cc: In function 'int cipher(std::string)':
a.cc:20:5: error: expected ',' or ';' before 'for'
   20 |     for (string::size_type i = 0; i < size_; i++)
      |     ^~~
a.cc:20:35: error: 'i' was not declared in this scope
   20 |     for (string::size_type i = 0; i < size_; i++)
      |                                   ^
Language: C++

#include<iostream>
#include<string>
#include<cmath>
using namespace std;

string S,R;
char T[5]="ACGT";
int U,a,q;

int power[12]={1,4,16,64,256,1024,4096,16384,65536,262144,1048576,4194304};

bool V;

bool x1[4];
bool x2[16];
bool x3[64];
bool x4[256];
bool x5[1024];
bool x6[4096];
bool x7[16384];
bool x8[65536];
bool x9[262144];
bool x10[1048576];
bool x11[4194304];
bool x12[16777216];

void insert(){
	U=0;
	for(int i=0;i<S.size();i++){
		for(int j=0;j<4;j++){
			if(T[j]==S[i]){
				U += power[i]*j;
			}
		}
	}
	a=S.size();
	if(a==1){
		x1[U]=true;
	}
	if(a==2){
		x2[U]=true;
	}
	if(a==3){
		x3[U]=true;
	}
	if(a==4){
		x4[U]=true;
	}
	if(a==5){
		x5[U]=true;
	}
	if(a==6){
		x6[U]=true;
	}
	if(a==7){
		x7[U]=true;
	}
	if(a==8){
		x8[U]=true;
	}
	if(a==9){
		x9[U]=true;
	}
	if(a==10){
		x10[U]=true;
	}
	if(a==11){
		x11[U]=true;
	}
	if(a==12){
		x12[U]=true;
	}
}

void find(){
	U=0;
	V=false;
	for(int i=0;i<S.size();i++){
		for(int j=0;j<4;j++){
			if(T[j]==S[i]){
				U += power[i]*j;
			}
		}
	}
	a=S.size();
	if(a==1 && x1[U]==true){
		V=true;
	}
	if(a==2 && x2[U]==true){
		V=true;
	}
	if(a==3 && x3[U]==true){
		V=true;
	}
	if(a==4 && x4[U]==true){
		V=true;
	}
	if(a==5 && x5[U]==true){
		V=true;
	}
	if(a==6 && x6[U]==true){
		V=true;
	}
	if(a==7 && x7[U]==true){
		V=true;
	}
	if(a==8 && x8[U]==true){
		V=true;
	}
	if(a==9 && x9[U]==true){
		V=true;
	}
	if(a==10 && x10[U]==true){
		V=true;
	}
	if(a==11 && x11[U]==true){
		V=true;
	}
	if(a==12 && x12[U]==true){
		V=true;
	}
	if(V==true){
		cout<<"yes"<<endl;
	}
	else{
		cout<<"no"<<endl;
	}
}

int main(){
	memset(x1,false,sizeof(x1));
	memset(x2,false,sizeof(x2));
	memset(x3,false,sizeof(x3));
	memset(x4,false,sizeof(x4));
	memset(x5,false,sizeof(x5));
	memset(x6,false,sizeof(x6));
	memset(x7,false,sizeof(x7));
	memset(x8,false,sizeof(x8));
	memset(x9,false,sizeof(x9));
	memset(x10,false,sizeof(x10));
	memset(x11,false,sizeof(x11));
	memset(x12,false,sizeof(x12));
	cin>>q;
	for(int i=0;i<q;i++){
		cin>>R>>S;
		if(R=="insert"){
			insert();
		}
		if(R=="find"){
			find();
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:131:9: error: 'memset' was not declared in this scope
  131 |         memset(x1,false,sizeof(x1));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<cmath>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include <iostream>
#include <cstdio>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define MOD1 1000000007;
#define MOD2 1000007
using namespace std;
   
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/*  */
int dic_op(char str[14])
{
  int j;
  register int f = 1;
  register int g = 0;
  for(j = 0;;j++) {
    if(str[j] == 'A')
      g += f * 1;
    else if(str[j] == 'C')
      g += f * 2;
    else if(str[j] == 'G')
      g += f * 3;
    else if(str[j] == 'T')
      g += f * 4;
    else break;
    f *= 5;
  }
  return g; 
}
   
int main()
{
  register int i;
  register int n;
  static char dic[10000000];
  char op;
  char c;
  char str[13];
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%c",&op);
    while(scanf("%c") != ' ') {
       scanf("%c",&c);
    }
    scanf("%s",str);
    if(opstr[0] == 'i') {
      dic[dic_op(str)] = 1;
    }
    else if(opstr[0] == 'f') {
      if(dic[dic_op(str)] == 1)
        puts("yes");
      else
        puts("no");
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int dic_op(char*)':
a.cc:17:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |   register int f = 1;
      |                ^
a.cc:18:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |   register int g = 0;
      |                ^
a.cc: In function 'int main()':
a.cc:36:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   36 |   register int i;
      |                ^
a.cc:37:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   37 |   register int n;
      |                ^
a.cc:49:8: error: 'opstr' was not declared in this scope; did you mean 'str'?
   49 |     if(opstr[0] == 'i') {
      |        ^~~~~
      |        str
Language: C++

#include <iostream>
#include <cstdio>
#include <set>
using namespace std;




int main(){

  int n; cin >> n;
  set<string> s;
  for(int i=0; i<n; i++){
    string s1,s2;
    cin >> s1 >> s2;
    if(s1[0] == 'i') s.insert(s2);
    else{
      if(s.find(s2) == s.end()) printf("no\n");
      else printf("yes\n");
    }
  }

}
v

Compiler output:
a.cc:24:1: error: 'v' does not name a type
   24 | v
      | ^
Language: C++

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

#define M 1046527
#define NIL (-1)
#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 if(ch == 'T') {
    return 4;
  }
  else {
    return 0;
  }
}


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 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[]) {
  long long 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) {
      strcpy(H[h], str);
      return 0;
    }
  }
  return 0;
}

int main(void) {
  int i, n;
  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:
a.cc: In function 'long long int getKey(char*)':
a.cc:31:18: error: 'strlen' was not declared in this scope
   31 |   for(i = 0; i < strlen(str); i++) {
      |                  ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<string>
  +++ |+#include <cstring>
    3 | 
a.cc: In function 'int find(char*)':
a.cc:51:8: error: 'strcmp' was not declared in this scope
   51 |     if(strcmp(H[h], str) == 0) {
      |        ^~~~~~
a.cc:51:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:54:13: error: 'strlen' was not declared in this scope
   54 |     else if(strlen(H[h]) == 0){
      |             ^~~~~~
a.cc:54:13: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int insert(char*)':
a.cc:66:8: error: 'strcmp' was not declared in this scope
   66 |     if(strcmp(H[h], str) == 0) {
      |        ^~~~~~
a.cc:66:8: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:69:13: error: 'strlen' was not declared in this scope
   69 |     else if(strlen(H[h]) == 0) {
      |             ^~~~~~
a.cc:69:13: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:70:7: error: 'strcpy' was not declared in this scope
   70 |       strcpy(H[h], str);
      |       ^~~~~~
a.cc:70:7: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>
#include<algorithm>
#define M 1000003
using namespace std;

int strToInt(char c[]);
int generate(int t, int i);

int main() {
	int i, j, k, n, key, lib[M] = {};
	char com[7];
	cin >> n;
	for (i = 0; i < n; i++) {
		char c[13];
		cin >> com >> c;
		key = strToInt(c);
		k = 0;
		j = generate(key, k);
		if (com[0] == 'i') {
			while (1) {
				if (lib[j] == '\0') {
					lib[j] = key;
					break;
				} else k++;
			}
		} else if (com[0] == 'f') {
			while (1) {
				if (lib[j] == key) {
					cout << "yes\n";
					break;
				} else if (lib[j] == '\0' || k >= M){
					cout << "no\n";
					break;
				} else k++;
			}
		}
	}
	return 0;
}

int strToInt(char c[]) {
	int i = 0, ans = 0, tmp;
	while (c[i] != '\0') {
		switch (c[i]) {
		case 'A':
			tmp = 0;
			break;
		case 'T':
			tmp = 1;
			break;
		case 'G':
			tmp = 2;
			break;
		case 'C':
			tmp = 3;
			break;
		}
		ans += tmp * pow(4, i);
		i++;
	}
	return ans;
}

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

Compiler output:
a.cc: In function 'int strToInt(char*)':
a.cc:58:30: error: 'pow' was not declared in this scope
   58 |                 ans += tmp * pow(4, i);
      |                              ^~~
Language: C++

#include<iostream>
#include<cstdint>
#include<algorithm>
#define M 244140625
using namespace std;

int strToInt(char c[]);
int generate(int t, int i);

int main() {
	int i, j, k, n, key;
	uint32_t lib[M] = {};
	char com[7];
	cin >> n;
	for (i = 0; i < n; i++) {
		char c[14];
		cin >> com >> c;
		key = strToInt(c);
		k = 0;
		j = generate(key, k);
		if (com[0] == 'i') {
			while (1) {
				if (lib[j] == '\0') {
					lib[j] = key;
					break;
				} else k++;
			}
		} else if (com[0] == 'f') {
			while (1) {
				if (lib[j] == key) {
					cout << "yes\n";
					break;
				} else if (lib[j] == '\0' || k >= M){
					cout << "no\n";
					break;
				} else k++;
			}
		}
	}
	return 0;
}

int strToInt(char c[]) {
	int i = 0, ans = 0, tmp;
	while (c[i] != '\0') {
		switch (c[i]) {
		case 'A':
			tmp = 1;
			break;
		case 'T':
			tmp = 2;
			break;
		case 'G':
			tmp = 3;
			break;
		case 'C':
			tmp = 4;
			break;
		}
		ans += tmp * pow(5, i);
		i++;
	}
	return ans;
}

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

Compiler output:
a.cc: In function 'int strToInt(char*)':
a.cc:60:30: error: 'pow' was not declared in this scope
   60 |                 ans += tmp * pow(5, i);
      |                              ^~~
Language: C++

#include "iostream"
#include "string.h"

using namespace std;

static const int MAX = 1048576;

int makeKey( char str[12] ) {
	int key = 0, x;

	for (int i = 0; i < 9; i++) {
		if (str[i] == 'A') x = 0;
		else if (str[i] == 'C') x = 1;
		else if (str[i] == 'G') x = 2;
		else if (str[i] == 'T') x = 3;
		key = key * 4 + x;
	}
	return key * 4;
}

int main() {

	int lnum;
	char com[7], str[13];
	char dic[MAX][12];
	bool used[MAX];

	cin >> lnum;

	for (int i = 0; i < MAX; i++) {
		used[i] = false;
	}

	for (int i = 0; i < lnum; i++) {
		cin >> com;
		cin >> str;

		if (com[0] == 'i') {
			int k = makeKey(str);
			while (used[k]) {
				k += 11;
				if (k >= MAX) k -= MAX;
			}
			strcpy_s(dic[k], str);
			used[k] = true;
		}
		else if( com[0] == 'f' ){
			bool found = false;
			int k = makeKey(str);
			while (used[k]) {
				if (strcmp(str, dic[k]) == 0) {
					found = true;
					cout << "yes" << endl;
					break;
				}
				k += 11;
				if (k >= MAX) k -= MAX;
			}
			if (!found) cout << "no" << endl;
			
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:25: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
   44 |                         strcpy_s(dic[k], str);
      |                         ^~~~~~~~
      |                         strcpy