Language: C++

#include<string>
#define M 1000000
std::vector <std::vector <std::string>> dic(M);
int hash(char ch){
	if(ch=='A') return 1;
	if(ch=='C') return 2;
	if(ch=='G') return 3;
	if(ch=='T') return 4;
	return 0;
}

long long key(std::string str){
	long long v=0;
	int b=1,n=str.size();
	for(int i=0;i<n;i++){
		v+=b*(hash(str[i]));
		b*=5;
	}
	return v%M;
}

int find(std::string str){
	std::vector <std::string> s;
	s=dic[key(str)];
	int n=s.size();
	for(int i=0;i<n;i++){
		if(s[i]==str) return 1;
	}
	return 0;
}

void insert(std::string str){
	dic[key(str)].push_back(str);
}

int main(){
	int n;
	std::cin>>n;
	for(int i=0;i<n;i++){
		std::string com,str;
		std::cin>>com;
		std::cin>>str;
		if(com[0]=='i') insert(str);
		else if(find(str)) std::cout<<"yes"<<'\n'; else std::cout<<"no"<<'\n';
	}
	return 0;
}


Compiler output:
a.cc:3:6: error: 'vector' in namespace 'std' does not name a template type
    3 | std::vector <std::vector <std::string>> dic(M);
      |      ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<string>
  +++ |+#include <vector>
    2 | #define M 1000000
a.cc: In function 'int find(std::string)':
a.cc:23:14: error: 'vector' is not a member of 'std'
   23 |         std::vector <std::string> s;
      |              ^~~~~~
a.cc:23:14: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:23:33: error: expected primary-expression before '>' token
   23 |         std::vector <std::string> s;
      |                                 ^
a.cc:23:35: error: 's' was not declared in this scope
   23 |         std::vector <std::string> s;
      |                                   ^
a.cc:24:11: error: 'dic' was not declared in this scope; did you mean 'div'?
   24 |         s=dic[key(str)];
      |           ^~~
      |           div
a.cc: In function 'void insert(std::string)':
a.cc:33:9: error: 'dic' was not declared in this scope; did you mean 'div'?
   33 |         dic[key(str)].push_back(str);
      |         ^~~
      |         div
a.cc: In function 'int main()':
a.cc:38:14: error: 'cin' is not a member of 'std'
   38 |         std::cin>>n;
      |              ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<string>
  +++ |+#include <iostream>
    2 | #define M 1000000
a.cc:41:22: error: 'cin' is not a member of 'std'
   41 |                 std::cin>>com;
      |                      ^~~
a.cc:41:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:42:22: error: 'cin' is not a member of 'std'
   42 |                 std::cin>>str;
      |                      ^~~
a.cc:42:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:44:41: error: 'cout' is not a member of 'std'
   44 |                 else if(find(str)) std::cout<<"yes"<<'\n'; else std::cout<<"no"<<'\n';
      |                                         ^~~~
a.cc:44:41: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:44:70: error: 'cout' is not a member of 'std'
   44 |                 else if(find(str)) std::cout<<"yes"<<'\n'; else std::cout<<"no"<<'\n';
      |                                                                      ^~~~
a.cc:44:70: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'