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

#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <stack>
#include <Vector>

using namespace std;
class dic
{
public:
	
	vector<string> S;
	void insert(string x);
	bool find(string x);
public:
	string ope;
	string  retrieval;
	dic();
};
dic::dic() {

}
void dic::insert(string x) {
	S.push_back(x);
}

bool dic::find(string x) {
	for (int i = 0; i < S.size(); i++) {
		if (S[i] == x) return true;
	}
	return false;
}


int main()
{

	int n;
	dic a;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a.ope;
		cin >> a.retrieval;
		if (a.ope == "insert")  a.insert(a.retrieval);
		else {
			if (a.find(a.retrieval)) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
	
	
	
	return 0;
}




Compiler output:
a.cc:7:10: fatal error: Vector: No such file or directory
    7 | #include <Vector>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <stack>
#include <Vector>

using namespace std;
class dic
{
public:
	
	vector<string> S;
	void insert(string x);
	bool find(string x);
public:
	string ope;
	string  retrieval;
	dic();
};
dic::dic() {

}
void dic::insert(string x) {
	S.push_back(x);
}

bool dic::find(string x) {
	for (int i = 0; i < S.size(); i++) {
		if (S[i] == x) return true;
	}
	return false;
}


int main()
{

	int n;
	dic a;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a.ope;
		cin >> a.retrieval;
		if (a.ope == "insert")  a.insert(a.retrieval);
		else {
			if (a.find(a.retrieval)) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
	
	
	
	return 0;
}



Compiler output:
a.cc:7:10: fatal error: Vector: No such file or directory
    7 | #include <Vector>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <stack>
#include <Vector>

using namespace std;
class dic
{
public:
	
	vector<string> S;
	void insert(string x);
	bool find(string x);
public:
	string ope;
	string  retrieval;
	dic();
};
dic::dic() {

}
void dic::insert(string x) {
	S.push_back(x);
}

bool dic::find(string x) {
	for (int i = 0; i < S.size(); i++) {
		if (S[i] == x) return true;
	}
	return false;
}


int main()
{

	int n;
	dic a;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a.ope;
		cin >> a.retrieval;
		if (a.ope == "insert")  a.insert(a.retrieval);
		else {
			if (a.find(a.retrieval)) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
	
	
	
	return 0;
}





Compiler output:
a.cc:8:10: fatal error: Vector: No such file or directory
    8 | #include <Vector>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <stack>
#include <Vector>

using namespace std;
class dic
{
public:
	
	string S[10000];
	
	void insert(string x);
	bool find(string x);
public:
	string ope;
	string  retrieval;
	dic();
private:
	int tail;
};
dic::dic() {
	tail = 0;
}
void dic::insert(string x) {
	S[tail] = x;
	tail++;
}

bool dic::find(string x) {
	for (int i = 0; i < tail; i++) {
		if (S[i] == x) return true;
	}
	return false;
}


int main()
{

	int n;
	dic a;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a.ope;
		cin >> a.retrieval;
		if (a.ope == "insert")  a.insert(a.retrieval);
		else {
			if (a.find(a.retrieval)) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
	
	
	
	return 0;
}





Compiler output:
a.cc:8:10: fatal error: Vector: No such file or directory
    8 | #include <Vector>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <stack>
#include <Vector>

using namespace std;
class dic
{
public:
	
	vector<string> S;
	void insert(string x);
	bool find(string x);
public:
	string ope;
	string  retrieval;
	dic();
};
dic::dic() {

}
void dic::insert(string x) {
	S.push_back(x);
}

bool dic::find(string x) {
	for (int i = 0; i < S.size(); i++) {
		if (S[i] == x) return true;
	}
	return false;
}


int main()
{

	int n;
	dic a;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a.ope;
		cin >> a.retrieval;
		if (a.ope == "insert")  a.insert(a.retrieval);
		else {
			if (a.find(a.retrieval)) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
	
	
	
	return 0;
}

int tail;
};
dic::dic() {
	tail = 0;
}
void dic::insert(string x) {
	S[tail] = x;
	tail++;
}

bool dic::find(string x) {
	for (int i = 0; i < tail; i++) {
		if (S[i] == x) return true;
	}
	return false;
}


int main()
{

	int n;
	dic a;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a.ope;
		cin >> a.retrieval;
		if (a.ope == "insert")  a.insert(a.retrieval);
		else {
			if (a.find(a.retrieval)) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
	
	
	
	return 0;
}





Compiler output:
a.cc:8:10: fatal error: Vector: No such file or directory
    8 | #include <Vector>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <stack>
#include <vector>

using namespace std;
class dic
{
public:
	
	vector<string> S;
	void insert(string x);
	bool find(string x);
public:
	string ope;
	string  retrieval;
	dic();
};
dic::dic() {

}
void dic::insert(string x) {
	S.push_back(x);
}

bool dic::find(string x) {
	for (int i = 0; i < S.size(); i++) {
		if (S[i] == x) return true;
	}
	return false;
}


int main()
{

	int n;
	dic a;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a.ope;
		cin >> a.retrieval;
		if (a.ope == "insert")  a.insert(a.retrieval);
		else {
			if (a.find(a.retrieval)) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
	
	
	
	return 0;
}

int tail;
};
dic::dic() {
	tail = 0;
}
void dic::insert(string x) {
	S[tail] = x;
	tail++;
}

bool dic::find(string x) {
	for (int i = 0; i < tail; i++) {
		if (S[i] == x) return true;
	}
	return false;
}


int main()
{

	int n;
	dic a;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a.ope;
		cin >> a.retrieval;
		if (a.ope == "insert")  a.insert(a.retrieval);
		else {
			if (a.find(a.retrieval)) cout << "yes" << endl;
			else cout << "no" << endl;
		}
	}
	
	
	
	return 0;
}





Compiler output:
a.cc:60:1: error: expected declaration before '}' token
   60 | };
      | ^
a.cc:61:1: error: redefinition of 'dic::dic()'
   61 | dic::dic() {
      | ^~~
a.cc:23:1: note: 'dic::dic()' previously defined here
   23 | dic::dic() {
      | ^~~
a.cc:64:6: error: redefinition of 'void dic::insert(std::string)'
   64 | void dic::insert(string x) {
      |      ^~~
a.cc:26:6: note: 'void dic::insert(std::string)' previously defined here
   26 | void dic::insert(string x) {
      |      ^~~
a.cc:69:6: error: redefinition of 'bool dic::find(std::string)'
   69 | bool dic::find(string x) {
      |      ^~~
a.cc:30:6: note: 'bool dic::find(std::string)' previously defined here
   30 | bool dic::find(string x) {
      |      ^~~
a.cc:77:5: error: redefinition of 'int main()'
   77 | int main()
      |     ^~~~
a.cc:38:5: note: 'int main()' previously defined here
   38 | int main()
      |     ^~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>

std::vector<std::string> dic;

void find(std::string str){
    auto result=std::find(dic.begin(),dic.end(),str);
    if(result==dic.end()) std::cout<<"no"<<std::endl;
    else std::cout<<"yes"<<std::endl;
}

void insert(std::string str){
    dic.push_back(str);
}
void exe(const std::string inst,const std::string str){
    switch(inst){
        case "insert":
            insert(str);
            break;
        case "find":
            find(str);
            break;
    }
    
}
int main(void){
    int n;
    std::string inst;
    std::string str;
    std::cin>>n;
    for(int i=0;i<n;i++){
        std::cin>>inst>>str;
        exe(inst,str);
    }

}


Compiler output:
a.cc: In function 'void find(std::string)':
a.cc:8:26: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)'
    8 |     auto result=std::find(dic.begin(),dic.end(),str);
      |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:8:26: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
    8 |     auto result=std::find(dic.begin(),dic.end(),str);
      |                 ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'void exe(std::string, std::string)':
a.cc:17:12: error: switch quantity not an integer
   17 |     switch(inst){
      |            ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>

void insert(const std::string& str,std::vector<std::string>& dctnry){
     dctnry.push_back(str);
}

void find(const std::string& str,const std::vector<std::string>& dctnry){
    auto it=std::find(dctnry.begin(),dctnry.end(),str);
    if(it==dctnry.end()) std::cout<<"no"<<std::endl;
    else std::cout<<"yes"<<std::endl;
}

int main(void){
    int n;
    std::vector<std::string> dctnry;
    std::string str,inst;
    std::cin>>n;
    for(int i=0;i<n;i++){
        std::cin>>inst>>str;
        switch(inst){
            case "insert":
                insert(str,dctnry);
                break;
            case "find":
                find(str,dctnry);
                break;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: switch quantity not an integer
   23 |         switch(inst){
      |                ^~~~
Language: C++

#include<iostream>
#include<set>
#include<string>
#include<algorithm>

void insert(const std::string& str,std::set<std::string>& dctnry){
     dctnry.insert(str);
}

void find(const std::string& str,const std::set<std::string>& dctnry){
    std::cout<<(dctnry.find(str)!=dctnry.end())?"yes":"no"<<std::endl;
}

int main(void){
    int n;
    std::set<std::string> dctnry;
    std::string str,inst;
    std::cin>>n;
    for(int i=0;i<n;i++){
        std::cin>>inst>>str;
        if(inst=="insert"){
                insert(str,dctnry);
        }else{
                find(str,dctnry);
        }
    }
}


Compiler output:
a.cc: In function 'void find(const std::string&, const std::set<std::__cxx11::basic_string<char> >&)':
a.cc:11:59: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<'
   11 |     std::cout<<(dctnry.find(str)!=dctnry.end())?"yes":"no"<<std::endl;
      |                                                       ~~~~^~~~~~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <time.h>
 
void find_str2(std::string str[], std::string str2, std::vector<std::string> *YorN, int k){
    int flag = 0;
    for(int i=0; i<k; i++){
        if(str[i] == str2){
            flag = 1;
            break;
        }
    }
    if(flag == 1){
        (*YorN).push_back("yes");
    }
    else{
        (*YorN).push_back("no");
    }
}
 
int main(){
    clock_t start = clock();
    int n;
    std::cin >> n;
 
    int k = 0;                      //str[n]の添え字
    std::string str[n];             //辞書
    std::vector<std::string> YorN;  //yes:1, no:0　を保持
    for(int i=0; i<n; i++){
        std::string str1, str2;     //str1:命令, str2:文字列
        std::cin >> str1;
        if(str1 == "insert"){
            std::cin >> str2;
            str[k] = str2;          //str2を辞書に追加
            k++;
        }
        else if(str1 == "find"){
            std::cin >> str2;
            find_str2(str, str2, &YorN, k);     //str2を辞書から探してYorNを更新
        }
    }
     
    int num = YorN.size();
    for(int i=0; i<num; i++){
        std::cout << YorN[i] << '\n';
    }
 
    clock_t end = clock();
    //std::cout << "Time of calculation:" << (double)(end-start)/CLOCKS_PER_SEC << ".sec\n";
 
    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:53:14: error: expected '}' at end of input
   53 |     return 0;
      |              ^
a.cc:23:11: note: to match this '{'
   23 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(){
    int n;
    cin >>n;
    string s;
    vector<string> ve;
    for(int i = 0; i < n; i++){
        cin >>s;
        if(s == "insert"){
            cin >>s;
            ve.push_back(s);
        }else if(s == "find"){
            cin >>s;
            for(int i = 0; i < ve.size(); i++){
                auto itr = find(ve.begin(), ve.end(), s);
                if(itr != ve.end()){
                    cout << "yes\n";
                }else{
                    cout << "no\n";
                }
            }
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:32: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)'
   19 |                 auto itr = find(ve.begin(), ve.end(), s);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:19:32: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   19 |                 auto itr = find(ve.begin(), ve.end(), s);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

string dict;

void insert(string str){
  dict = dict + " " + str;
}

string find(string str){
  if(strstr(dict.c_str(), str.c_str())) return "yes";
  return "no";
}

int main(){
  string command, str;
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>command;
    cin>>str;
    if(command == "insert") insert(str);
    else if(command == "find") cout<<find(str)<<endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'std::string find(std::string)':
a.cc:12:6: error: 'strstr' was not declared in this scope
   12 |   if(strstr(dict.c_str(), str.c_str())) return "yes";
      |      ^~~~~~
a.cc:2:1: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

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

string dict;

void insert(string str){
  dict = dict + " " + str;
}

string find(string str){
  if(strstr(dict.c_str(), str.c_str())) return "yes";
  return "no";
}

int main(){
  string command, str;
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>command;
    cin>>str;
    if(command == "insert") insert(str);
    else if(command == "find") cout<<find(str)<<endl;
  }
  return 0;
}




Compiler output:
a.cc: In function 'std::string find(std::string)':
a.cc:12:6: error: 'strstr' was not declared in this scope
   12 |   if(strstr(dict.c_str(), str.c_str())) return "yes";
      |      ^~~~~~
a.cc:2:1: note: 'strstr' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | #include<string>
Language: C++

#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;

#define row 1001333
#define col 20

char H[row][col];

ll h1(ll key){
	return key%row;
}

ll h2(ll key){
	return 1+(key%(row-1));
}

ll chtonum(char s){
	if(s=='A') return 1;
	if(s=='C') return 2;
	if(s=='G') return 3;
	if(s=='T') return 4;
	return 0;
}

ll get_key(char s[]){
	ll sum=0,p=1;
	int len=strlen(s);
	for(ll i=0;i<len;i++){
		sum+=p*chtonum(s[i]);
		p*=5;
	}
	return sum;
}

void insert(char s[]){
	ll key,h;
	key=get_key(s);
	ll i =0;
	while(1){
		h=(h1(key)+i*h2(key))%row;
		if(strcmp(H[h],s)==0) return ;//这个元素字典里已经有了
		else if (strlen(H[h])==0){
			strcpy(H[h], s);//如果该位置没有别的值，就把这个元素插进去
			return ;
		} 
		i++;//如果这个i对应的h的位置已经有元素了，那么继续寻找下一个i对应的位置
	}
}

bool find(char s[]){
	ll key,h;
	key=get_key(s);
	ll i=0;
	while(1){
		h=(h1(key)+i*h2(key))%row;
		if(strcmp(H[h],s)==0) return true;//如果找到了该元素
		i++;
	}
	return false;
}

int main (){
	int n;
	char a[20],b[20];
	for(int i = 0;i<row;i++) H[i][0]='\0'; //把数组初始化 方便比较
	scanf("%d",&n);
	for(int i =0;i<n;i++){
		cin>>a>>b;
		if(a[0]=='i') insert(b);
		else {
			if(find(b)) cout<<"yes"<<endl;
			else cout<<"no"<<endl;
		}
	}
	return 0;
}



Compiler output:
a.cc: In function 'll get_key(char*)':
a.cc:30:17: error: 'strlen' was not declared in this scope
   30 |         int len=strlen(s);
      |                 ^~~~~~
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 | #include <string>
a.cc: In function 'void insert(char*)':
a.cc:44:20: error: 'strcmp' was not declared in this scope
   44 |                 if(strcmp(H[h],s)==0) return ;//这个元素字典里已经有了
      |                    ^~~~~~
a.cc:44:20: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:45:26: error: 'strlen' was not declared in this scope
   45 |                 else if (strlen(H[h])==0){
      |                          ^~~~~~
a.cc:45:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:46:25: error: 'strcpy' was not declared in this scope
   46 |                         strcpy(H[h], s);//如果该位置没有别的值，就把这个元素插进去
      |                         ^~~~~~
a.cc:46:25: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'bool find(char*)':
a.cc:59:20: error: 'strcmp' was not declared in this scope
   59 |                 if(strcmp(H[h],s)==0) return true;//如果找到了该元素
      |                    ^~~~~~
a.cc:59:20: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#define _USE_MATH_DEFINES
using namespace std;
typedef long long ll;
double pi = 3.141592653589793;
ll mod = 1000000007;

int main() {
    int N;
    cin >> N;
    string order;
    string word
        set<string> s;
    for (int i = 0; i < N; i++) {
        cin >> order >> word;
        if (order == "insert") {
            s.insert(word);
        } else {
            int c = s.count(word);
            if (c == 1) {
                cout << "yes" << endl;
            } else {
                cout << "no" << endl;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: expected initializer before 'set'
   21 |         set<string> s;
      |         ^~~
a.cc:23:25: error: 'word' was not declared in this scope
   23 |         cin >> order >> word;
      |                         ^~~~
a.cc:25:13: error: 's' was not declared in this scope
   25 |             s.insert(word);
      |             ^
a.cc:27:21: error: 's' was not declared in this scope
   27 |             int c = s.count(word);
      |                     ^
Language: C++

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

#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(char()); 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));
    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) = key;
      return 0;
    }
  }
  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:
a.cc: In function 'long long int getKey(char*)':
a.cc:20:26: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   20 |   for ( i = 0; i < strlen(char()); i++ ) {
      |                    ~~~~~~^~~~~~~~
      |                          |
      |                          char
In file included from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc: In function 'int find(char*)':
a.cc:36:26: error: cannot convert 'bool' to 'const char*'
   36 |     else if (strlen(H[h] == 0)) return 0;
      |                     ~~~~~^~~~
      |                          |
      |                          bool
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc: In function 'int insert(char*)':
a.cc:47:26: error: cannot convert 'bool' to 'const char*'
   47 |     else if (strlen(H[h] == 0)) {
      |                     ~~~~~^~~~
      |                          |
      |                          bool
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:48:13: error: lvalue required as left operand of assignment
   48 |       strcpy(H[h], str) = key;
      |       ~~~~~~^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:59:15: error: expected primary-expression before '%' token
   59 |   scanf("%d", %n);
      |               ^
Language: C++

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

#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(char()); 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));
    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) = key;
      return 0;
    }
  }
  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:
a.cc: In function 'long long int getKey(char*)':
a.cc:20:26: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   20 |   for ( i = 0; i < strlen(char()); i++ ) {
      |                    ~~~~~~^~~~~~~~
      |                          |
      |                          char
In file included from a.cc:2:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc: In function 'int find(char*)':
a.cc:36:26: error: cannot convert 'bool' to 'const char*'
   36 |     else if (strlen(H[h] == 0)) return 0;
      |                     ~~~~~^~~~
      |                          |
      |                          bool
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc: In function 'int insert(char*)':
a.cc:47:26: error: cannot convert 'bool' to 'const char*'
   47 |     else if (strlen(H[h] == 0)) {
      |                     ~~~~~^~~~
      |                          |
      |                          bool
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:48:13: error: lvalue required as left operand of assignment
   48 |       strcpy(H[h], str) = key;
      |       ~~~~~~^~~~~~~~~~~
Language: C++

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

vector<string> dist;

void insert(string str){
  dist.push_back(str);
}

string find(string str){
  auto itr = find(dist.begin(), dist.end(), str);
  if(itr != dist.end()) return "yes";
  return "no";
}

int main(){
  string com, str;
  int n, m = 0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin >> com >> str;
    if (com == "insert"){
      insert(str);
      m++;
    }
    else if(com == "find") cout << find(str) << endl;
  }
  return 0;
}



Compiler output:
a.cc: In function 'std::string find(std::string)':
a.cc:13:18: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)'
   13 |   auto itr = find(dist.begin(), dist.end(), str);
      |              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:13:18: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   13 |   auto itr = find(dist.begin(), dist.end(), str);
      |              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:12:8: note: candidate: 'std::string find(std::string)'
   12 | string find(string str){
      |        ^~~~
a.cc:12:8: note:   candidate expects 1 argument, 3 provided
Language: C++

#include "stdafx.h"
#include<iostream>
#include<string>

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,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()
{
	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:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <algorithm>
#include <array>
#include <iostream>
#include <vector>
#include <stdio.h>
#define MAPSIZE 100000000
/*insert, findを実行できる簡易的な辞書を作成する*/
using namespace std;
string *map;
int primes[] = {2, 3, 7, 11, 13, 17 , 19, 23, 29, 31, 37, 41};
int hash1(int key){
	return key % MAPSIZE;
}
int hash2(int key){
	return 1 + (key % (MAPSIZE - 1));
}

int hashFunc(int key, int i){
	return (hash1(key) + i * hash2(key)) % MAPSIZE;
}

void insert(char *key){
	int i = 0;
	int count = 1;
	int keyNum = 0;	
	for(int i = 0; i < strlen(key); i++){
		keyNum += key[i] + primes[count];
		count++;
	}
	while(true){
		int j = hashFunc(keyNum, i);
		if(map[j] == ""){
			map[j] = key;
			return;
		}else{
			i++;
		}
	}
}

bool search(char *key){
	int i = 0;
	int keyNum = 0;
	int count = 1;
	for(int i = 0; i < strlen(key); i++){
		keyNum += key[i] + primes[count];
		count++;
	}
	while(true){
		int j = hashFunc(keyNum, i);
		if(map[j] == key){
			return true;
		}else if(i >= MAPSIZE || map[j] == ""){
			return false;
		}else{
			i++;
		}
	}
}
int main(){	
	map = new string[MAPSIZE];
	//for(int i = 0; i < MAPSIZE; i++) map[i] = "";
	{
		int tmp;
		cin >> tmp;
	}
	char command[10];
	char key[12];
	while(scanf("%s %s", command, key) != EOF){
		if(command[0] == 'i'){
			insert(key);
		}else if(command[0] == 'f'){
			if(search(key)){
				puts("yes");
			}else{
				puts("no");
			}
		}
	}
}




Compiler output:
a.cc: In function 'void insert(char*)':
a.cc:26:28: error: 'strlen' was not declared in this scope
   26 |         for(int i = 0; i < strlen(key); i++){
      |                            ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <vector>
  +++ |+#include <cstring>
    5 | #include <stdio.h>
a.cc: In function 'bool search(char*)':
a.cc:45:28: error: 'strlen' was not declared in this scope
   45 |         for(int i = 0; i < strlen(key); i++){
      |                            ^~~~~~
a.cc:45:28: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <stdio.h>
#include <string.h>
#include <vector>
using namespace std;

vector<string> D; 

int main() {
    int n;
    char o[7], v[14];
    scanf("%d", &n);
    for(int i=0; i<n; i++) {
        scanf("%s %s", o, v);
        if(o[0] == 'i') {
            D.push_back(v);
        } else if(o[0] == 'f') {
            in j=0;
            for (string s : D) {
                if(s==D[j]) printf("yes\n");
            }
            printf("no\n");
        }
    }
    
    return 0;
}


Compiler output:
a.cc:6:8: error: 'string' was not declared in this scope
    6 | vector<string> D;
      |        ^~~~~~
a.cc:4:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    3 | #include <vector>
  +++ |+#include <string>
    4 | using namespace std;
a.cc:6:14: error: template argument 1 is invalid
    6 | vector<string> D;
      |              ^
a.cc:6:14: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:15:15: error: request for member 'push_back' in 'D', which is of non-class type 'int'
   15 |             D.push_back(v);
      |               ^~~~~~~~~
a.cc:17:13: error: 'in' was not declared in this scope; did you mean 'i'?
   17 |             in j=0;
      |             ^~
      |             i
a.cc:18:18: error: 'string' was not declared in this scope
   18 |             for (string s : D) {
      |                  ^~~~~~
a.cc:18:18: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
a.cc:22:9: error: expected primary-expression before '}' token
   22 |         }
      |         ^
a.cc:21:28: error: expected ')' before '}' token
   21 |             printf("no\n");
      |                            ^
      |                            )
   22 |         }
      |         ~                   
a.cc:18:17: note: to match this '('
   18 |             for (string s : D) {
      |                 ^
a.cc:22:9: error: expected primary-expression before '}' token
   22 |         }
      |         ^
Language: C++

#include <stdio.h>
#include <string>
#include <vector>
using namespace std;

vector<string> D; 

int main() {
    int n;
    char o[7], v[14];
    scanf("%d", &n);
    for(int i=0; i<n; i++) {
        scanf("%s %s", o, v);
        if(o[0] == 'i') {
            D.push_back(v);
        } else if(o[0] == 'f') {
            in j=0;
            for (string s : D) {
                if(s==D[j]) printf("yes\n");
            }
            printf("no\n");
        }
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'in' was not declared in this scope; did you mean 'i'?
   17 |             in j=0;
      |             ^~
      |             i
a.cc:19:25: error: 'j' was not declared in this scope
   19 |                 if(s==D[j]) printf("yes\n");
      |                         ^
Language: C++

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

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

// 文字列から数値へ変換してkeyを生成する
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 = 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 = 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() {
    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:
a.cc: In function 'int find(char*)':
a.cc:36:14: error: 'h' cannot be used as a function
   36 |         h = h(h1(key) + i+h2(key)) % M;
      |             ~^~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int insert(char*)':
a.cc:47:14: error: 'h' cannot be used as a function
   47 |         h = h(h1(key) + i+h2(key)) % M;
      |             ~^~~~~~~~~~~~~~~~~~~~~
Language: C++

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

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

// 文字列から数値へ変換してkeyを生成する
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() {
    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:
a.cc: In function 'int h2(int)':
a.cc:30:37: error: expected ';' before ')' token
   30 | int h2(int key) { return 1+key%(M-1)); }
      |                                     ^
      |                                     ;
a.cc:30:37: error: expected primary-expression before ')' token
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
int main(){
  int n;
  char str[10],com[13];
  map<string,bool> mp;
  cin >> n;
  rep(i,n){
    cin >> com >> str;
    if(com[0] == 'i') {mp[str] = true;
    //cout << string(str) << endl;}
    else {
      if(mp[string(str)]) cout << "yes" << endl;
      else cout << "no" << endl;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: expected '}' before 'else'
   13 |     else {
      |     ^~~~
a.cc:11:23: note: to match this '{'
   11 |     if(com[0] == 'i') {mp[str] = true;
      |                       ^
Language: C++

//============================================================================
// Name        : Dictionary.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

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



class Dictionary{
public:
	char dict[16777216]; // pow(4, 12)

	Dictionary(){
		cout << "start" << "\n";
		//for(int i=0; i<16777216; i++){
		//	dict[i] = 0;
		//}
	};

	int encode(string& str){
		int code = 0;
		replace(str.begin(), str.end(), 'A', '0');
		replace(str.begin(), str.end(), 'T', '1');
		replace(str.begin(), str.end(), 'C', '2');
		replace(str.begin(), str.end(), 'G', '3');
		for(int i=0; i<str.size(); i++){
			code = code + ((int) str.at(i)) * pow(4, i);
		}

		return code;
	}

	void insert(string& str){
		int code = encode(str);
		//assert(code < 16777216);
		dict[code] = 1;
	}

	string find(string& str){
		int code = encode(str);
		int isFound = dict[code];

		if(isFound == 0){
			return "no";
		}

		return "yes";
	}


};

int main() {
	cout << "start" << "\n";
	Dictionary dict;
	vector<string> isFound_list;

	int n_lines;
	cin >> n_lines;

	string command, str;
	for(int i=0; i<n_lines; i++){
		cin >> command >> str;

		if(command == "insert"){
			dict.insert(str);
		}else if(command == "find"){
			isFound_list.push_back(dict.find(str));
		}
	}

	for(int i=0; i<isFound_list.size(); i++){
		cout << isFound_list.at(i) << "\n";
	}

	return 0;
}



Compiler output:
a.cc: In member function 'int Dictionary::encode(std::string&)':
a.cc:30:17: error: 'replace' was not declared in this scope
   30 |                 replace(str.begin(), str.end(), 'A', '0');
      |                 ^~~~~~~
Language: C++

include<iostream>

using namespace std;

int cti(char);

int main(){
  int n,hash;
  string op,val;
  bool exist[100000];
  cin >> n;

  for(int i=0;i<100000;i++)exist[i]=false;

  while(n-- > 0){
    cin >> op >> val;
    if(op == "insert"){
     int has = 0;
      for(int i=0;i<val.length();i++){
	has+=cti(val[i]);
      }
      exist[has]=true;
    }else {
      int has=0;
      for(int i=0;i<val.length();i++){
	has+=cti(val[i]);
      }
      if(exist[has])cout << "yes" << endl;
      else cout << "no" << endl;
    }





  }

}


int cti(char c){
  if(c == 'A')return 1;
  else if(c == 'C')return 13;
  else if(c == 'G')return 27;
  else return 40;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'string' was not declared in this scope
    9 |   string op,val;
      |   ^~~~~~
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin >> n;
      |   ^~~
a.cc:16:12: error: 'op' was not declared in this scope
   16 |     cin >> op >> val;
      |            ^~
a.cc:16:18: error: 'val' was not declared in this scope
   16 |     cin >> op >> val;
      |                  ^~~
a.cc:28:21: error: 'cout' was not declared in this scope
   28 |       if(exist[has])cout << "yes" << endl;
      |                     ^~~~
a.cc:28:38: error: 'endl' was not declared in this scope
   28 |       if(exist[has])cout << "yes" << endl;
      |                                      ^~~~
a.cc:29:12: error: 'cout' was not declared in this scope
   29 |       else cout << "no" << endl;
      |            ^~~~
a.cc:29:28: error: 'endl' was not declared in this scope
   29 |       else cout << "no" << endl;
      |                            ^~~~
Language: C++

#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
#define MAX 1000000
using namespace std;


const int  m = 701;
string stack[MAX];
int h1(int);
int h2(int);
int insert(int,int);
int sti(string);

int main(){
  int n,dic=0;
  string op,s;
  bool exist=false; 

  while(cin >> n){
    dic=0,dicc=1<<29;
    rep(i,MAX)stack[i]="instead_of_NULL";

    rep(i,n){
      exist=false;
      cin >> op >> s;
      if(op == "insert"){
	int index=0;
	while(true){
	  int val = insert(sti(s),index);
	  if(stack[val] == "instead_of_NULL"){
	    if(val>dic)dic=val;
	    else if(val<dicc)dicc=val;
	    stack[val]=s;
	    break;
	  }
	  else index++;
	  if(index > dic)index=dicc;
	}
      }
      else if(op == "find"){
	int index2=0;
	while(true){
	  int vall=insert(sti(s),index2);
	  if(stack[vall] == s){
	    exist=true;
	    break;
	  }
	  else if(stack[vall] == "instead_of_NULL"){
	    break;
	  }
	  index2++;
	  if(index2 > dic)index2=dicc;
	}
	if(exist)cout << "yes" << endl;
	else cout << "no" << endl;
      }


    }



  }

}


int h1(int k){
  return k%m;
}

int h2(int k){
  return 1+k%(m-1);
}

int insert(int k,int i){
  return (h1(k) + i*h2(k))%m;
}

int sti(string s){
  int sum=0;
  rep(i,s.length()){
    sum+=(s[i]-'0');
  }
  return sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: 'dicc' was not declared in this scope; did you mean 'dic'?
   20 |     dic=0,dicc=1<<29;
      |           ^~~~
      |           dic
Language: C++

#include <iostream>
#include <string>
#include <math.h>
#define N 1000000
#define M 100003
using namespace std;

void insert(string val);
bool find(string val);
int h(int, int);
int h1(int);
int h2(int);
int getNumber(char);
string hashTable[N];

int n;
int exp;

int main(){

string com;
string val;

cin >> n;
exp = 1.0 / (1.0 - ((double)n / N));

for(int i=0; i<n; i++){
cin >> com;
cin >> val;
if(com[0] == 'i'){
insert(val);
}else if(com[0] == 'f'){
if(find(val) == true){
cout << "yes\n";
}else{
cout << "no\n";
}
}
}

return 0;

}

void insert(string val){

int code = 0;
int p = 1;
for(int i=0, len=val.size(); i<len; i++){
code += getNumber(val[i]) * p;
p *= 5;
}

for(int i=0; i<exp;i++){
int key = h(code,i);
if(hashTable[key] == ""){
hashTable[key] = val;
break;
}
}

}

bool find(string val){

int code = 0;
for(int j=0, len=val.size(); j<len; j++){
code += getNumber(val[j]) * j;
}

for(int i=0; i<exp;i++){
int key = h(code,i);
if(hashTable[key] == val){
return true;
}else if(hashTable[key] == ""){
return false;
}
}

return false;

}

int h(int code, int i){
return (h1(code) + i * h2(code)) % M;
}

int h1(int code){
return code % M;
}

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

int getNumber(char val){

if(val == 'A') return 1;
if(val == 'C') return 2;
if(val == 'G') return 3;
if(val == 'T') return 4;

return 0;

}

Compiler output:
a.cc:17:5: error: 'int exp' redeclared as different kind of entity
   17 | int exp;
      |     ^~~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:113:1: note: previous declaration 'double exp(double)'
  113 | __MATHCALL_VEC (exp,, (_Mdouble_ __x));
      | ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:25:35: error: overloaded function with no contextual type information
   25 | exp = 1.0 / (1.0 - ((double)n / N));
      |                                   ^
a.cc: In function 'void insert(std::string)':
a.cc:54:15: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   54 | for(int i=0; i<exp;i++){
      |              ~^~~~
a.cc: In function 'bool find(std::string)':
a.cc:71:15: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<'
   71 | for(int i=0; i<exp;i++){
      |              ~^~~~