Language: C++

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

const int m = 1046527;

int convert(string &str){
	string res = "";
	char temp;

	for(int i=0; i<str.size(); ++i){
		temp = str[i];

		if (temp == 'A'){
			res += "1";
		}else if(temp == 'C'){
			res += "2";
		}else if(temp == 'G'){
			res += "3";
		}else if(temp == 'T'){
			res += "4";
		}
	}
	return stoi(res);
}

int h1(int &key){
	return key%m;
}

int h2(int &key){
	int res = 1 + (key % (m-1));
	return res;
}

int h(int &key, int &i){
	int res = ( h1(key) + i*h2(key) ) % m;
	return res;
}

void insert(vector<int> &storage, string &str){
	int key = convert(str);
	int i = 0;
	int j = 0;

	while(1){
		j = h(key, i);

		auto itr = find(storage.begin(), storage.end(), j);
		if(itr != storage.end()){
			i += 1;
		}else{
			storage.push_back(j);
			return;
		}
	}
}

void find(vector<int> &storage, string &str){
	int key = convert(str);

	auto itr = find(storage.begin(), storage.end(), key);
	if(itr == storage.end()){
		cout << "no" << endl;
	}else{
		cout << "yes" << endl;
	}
}

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

	char command[7];
	string str;

	vector<int> storage; 
	for(int i=0; i<n; ++i){
		scanf("%s", command);
		cin >> str;

		if(command[0] == 'i'){
			insert(storage, str);
		}else{
			find(storage, str);
		}
	}

	return 0;
}


Compiler output:
a.cc: In function 'void insert(std::vector<int>&, std::string&)':
a.cc:50:32: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   50 |                 auto itr = find(storage.begin(), storage.end(), j);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:50:32: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   50 |                 auto itr = find(storage.begin(), storage.end(), j);
      |                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'void find(std::vector<int>&, std::string&)':
a.cc:63:24: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   63 |         auto itr = find(storage.begin(), storage.end(), key);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:63:24: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   63 |         auto itr = find(storage.begin(), storage.end(), key);
      |                    ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:60:6: note: candidate: 'void find(std::vector<int>&, std::string&)'
   60 | void find(vector<int> &storage, string &str){
      |      ^~~~
a.cc:60:6: note:   candidate expects 2 arguments, 3 provided