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

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

class Node {
private:
	char str[12] = "\0";
	Node *p_next = NULL;
public:
	Node(const char s[]) { strcpy_s(str, 12, s); }
	Node() {}
	Node *getNext() { return p_next; }
	bool equal(const char s[]) { return strcmp(str, s) == 0; }
	bool islower(const char s[]) { return (strcmp(s, str) < 0); }
	void linkNext(Node *p_n) { p_next = p_n; }
};

class Dictionary {
private:
	Node dummy;
public:
	void insert(const char str[]);
	bool find(const char str[]);
};

void Dictionary::insert(const char str[])
{
	Node *p_node = &dummy;
	while ((p_node = p_node->getNext()) && p_node->islower(str));

	if (p_node->equal(str)) return;

	Node *p_newnode = new Node(str);
	p_newnode->linkNext(p_node->getNext());
	p_node->linkNext(p_newnode);
}

bool Dictionary::find(const char str[])
{
	Node *p_node = &dummy;
	while (p_node = p_node->getNext()) {
		if (p_node->equal(str)) return true;
	}
	return false;
}

int main(void)
{
	Dictionary dic;

	int n;
	cin >> n;

	char cm[6] = "\0", str[12] = "\0";
	for (int i = 0; i < n; i++) {
		cin >> cm >> str;
		if (strcmp(cm, "insert") == 0) {
			dic.insert(str);
		}
		else if (strcmp(cm, "find") == 0) {
			bool result = dic.find(str);
			if (result) cout << "yes";
			else cout << "no";
			cout << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In constructor 'Node::Node(const char*)':
a.cc:11:32: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
   11 |         Node(const char s[]) { strcpy_s(str, 12, s); }
      |                                ^~~~~~~~
      |                                strcpy
Language: C++

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

class Node {
private:
	char str[12] = "\0";
	Node *p_next = NULL;
public:
	Node(const char s[]) { strcpy_s(str, 12, s); }
	Node() {}
	Node *getNext() { return p_next; }
	bool equal(const char s[]) { return strcmp(str, s) == 0; }
	bool high(const char s[]) { return (strcmp(s, str) > 0); }
	void linkNext(Node *p_n) { p_next = p_n; }
};

class Dictionary {
private:
	Node dummy;
public:
	void insert(const char str[]);
	bool find(const char str[]);
};

void Dictionary::insert(const char str[])
{
	Node *p_node = &dummy;
	while (1) {
		if (p_node->equal(str)) return;
		if (p_node->high(str)) break;
		p_node = p_node->getNext();
	}

	Node *p_newnode = new Node(str);
	p_newnode->linkNext(p_node->getNext());
	p_node->linkNext(p_newnode);
}

bool Dictionary::find(const char str[])
{
	Node *p_node = &dummy;
	while (p_node = p_node->getNext()) {
		if (p_node->equal(str)) return true;
	}
	return false;
}

int main(void)
{
	Dictionary dic;

	int n;
	cin >> n;

	char cm[7] = "\0", str[13] = "\0";
	for (int i = 0; i < n; i++) {
		cin >> cm >> str;
		if (strcmp(cm, "insert") == 0) {
			dic.insert(str);
		}
		else if (strcmp(cm, "find") == 0) {
			bool result = dic.find(str);
			if (result) cout << "yes";
			else cout << "no";
			cout << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In constructor 'Node::Node(const char*)':
a.cc:11:32: error: 'strcpy_s' was not declared in this scope; did you mean 'strcpy'?
   11 |         Node(const char s[]) { strcpy_s(str, 12, s); }
      |                                ^~~~~~~~
      |                                strcpy
Language: C++

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

int N;
struct Line {
    char instruction[10];
    char sentence[15];
}

dictionary[10000000][15];

struct Line line[10000000];

int main() {
    scanf("%d", N);
    for(int i = 0; i < N; i++) {
        scanf("%s %s", line[i].instruction, line[i].sentence);
        if(strcmp(line[i].instruction, "insert") == 0) {
            for(int j = 0; j < 100000; j++) {
                for(int k = 0; k < 12; k++) {
                    if(dictionary[j][k] != line[i].instruction[k]) {

                    }
                }
            }
        }
        else {

        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:41: error: no match for 'operator!=' (operand types are 'Line' and 'char')
   23 |                     if(dictionary[j][k] != line[i].instruction[k]) {
      |                        ~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~
      |                                       |                         |
      |                                       Line                      char
Language: C++

//
//  main.cpp
//  dictionary
//
//  Created by ???????????? on 2017/10/06.
//  Copyright ?? 2017 ????????????. All rights reserved.
//

#include <iostream>
#include <cmath>

#define NIL (0)

using namespace std;

int m = 100000;

int char_to_int(char str, int i){
    if(str == 'A'){
        return 1*pow(10, i);
    }
    else if(str == 'C'){
        return 2*pow(10, i);
    }
    else if(str == 'G'){
        return 3*pow(10, i);
    }
    else if(str == 'T'){
        return 4*pow(10, i);
    }
    cout << "Unexpected input given" << endl;
    return 0;
}

int get_key(char string[]){
    int key_str = 0;
    size_t n = strlen(string);
    for (int i = 0; i < n; i++){
        key_str += char_to_int(string[i], i);
    }
    return key_str;
}

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

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

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

void insert(int T[], int key){
    int i = 0;
    while(true){
        int j = h(key, i);
        if (T[j] == NIL){
            T[j] = key;
            break;
        }
        else{
            i++;
        }
    }
}

bool search(int T[], int key){
    int i = 0;
    while(true){
        int j = h(key, i);
        if(T[j] == key){
            return true;
        }
        else if(T[j] == NIL || i > m){
            return false;
        }
        else{
            i++;
        }
    }
}

int main(int argc, const char * argv[]) {
    int n, i, key;
    char com[10], string[10];
    int T[m];
    
    scanf("%d", &n);
    for(i = 0; i < n; i++){
        scanf("%s %s", com, string);
        key = get_key(string);
        if(com[0] == 'i'){
            insert(T, key);
        }
        else if(com[0] == 'f'){
            if(search(T, key)){
                cout<<"Yes"<<endl;
            }
            else{
                cout<<"No"<<endl;
            }
        }
        else{
            cout << "Got unexpected command" << endl;
        }
    }
    
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int get_key(char*)':
a.cc:37:16: error: 'strlen' was not declared in this scope
   37 |     size_t n = strlen(string);
      |                ^~~~~~
a.cc:11:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <cmath>
  +++ |+#include <cstring>
   11 |
Language: C++

#include <iostream>

using namespace std;

#define M 1046527
#define h1(key) (key%M)
#define h2(key) (1+(key%(M-1)))
string s[M];

int getCode(char c){
  switch(c){
  case 'A':
    return 1;
    break;
  case 'C':
    return 2;
    break;
  case 'G':
    return 3;
    break;
  }
  return 4;
}

long long getKey(string in){
  long long sum = 0, p = 1;
  for(int i = 0 ; i < (int)in.size() ; i++){
    sum += (getCode(in[i]) * p);
    p *= 5;
  }
  return sum;
}

long long hash_f(long long key, int i){
  return (h1(key) + i * h2(key)) % M;
}

bool find(string in){
  long long key = getKey(in);
  
  for(int i=1;;i++){
    long long h = hash_f(key, i);
    if(s[h] == in) return true;
    else if(s[h].size() == 0) return false;
  }
}

void insert(string in){
  long long key = getKey(in);
  int i;
  for(i=1;;i++){
    long long h = hash_f(key, i); 
    if(s[h].size() == 0){
      s[h] = in;
      break;
    }
  }
}

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

Compiler output:
a.cc:78:1: error: expected unqualified-id before '?' token
   78 | ??????
      | ^
Language: C++

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static final int M = 1046527;
	public static String[] dictionary = new String[M];
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.nextLine();
		List<String> answers = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			String[] meirei = sc.nextLine().split(" ");
			if(meirei[0].equals("insert")) {
				insert(meirei[1]);
			} else {
				answers.add(search(meirei[1]));
			}
		}
		for(String answer: answers) {
			System.out.println(answer);
		}
	}
	public static int h1(int key) {
		return key % M;
	}
	public static int h2(int key) {
		return 1 + (key % (M - 1));
	}
	public static int h(int key, int i) {
		return (h1(key) + i * h2(key)) % M;
	}
	public static int insert(String t) {
		int i = 0;
		int key = getKey(t);
		while(true) {
			int j = h(key, i);
			if(dictionary[j] == null) {
				dictionary[j] = t;
				return j;
			} else {
				i++;
			}
		}
	}
	public static String search(String t) {
		int i = 0;
		int key = getKey(t);
		while(true) {
			int j = h(key, i);
			if(dictionary[j] == null || i >= M) {
				return "no";
			} else if(dictionary[j].equals(t)) {
				return "yes";
			} else {
				i++;
			}
		}
	}
	public static int getInt(char c) {
		switch (c) {
		case 'A':
			return 1;

		case 'C':
			return 2;

		case 'G':
			return 3;

		case 'T':
			return 4;

		default:
			return 0;
		}
	}
	public static int getKey(String moziretsu) {
		int sum = 0;
		int p = 1;
		char[] c = moziretsu.toCharArray();
		for(int i = 0; i < c.length; i++) {
			sum += p * (getInt(c[i]));
			p *= 5;
		}
		return sum;
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.ArrayList;
      | ^~~~~~
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.List;
      | ^~~~~~
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.Scanner;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
Language: C++

#include <set>
#include <string>
#include <iostream>
 
int main()
{
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    std::set<std::string> dic;
    int n;
    std::cin >> n;
    for(int i = 0; i < n; ++i){
        std::string command, str;
        std::cin >> command >> str;
        if(command == "insert"){
            dic.insert(str);
        }else
        if(command == "find"){
            std::cout << (dic.find(str) != dic.end() ? "yes" : "no") << std::endl;
        }
    }
    return 

Compiler output:
a.cc: In function 'int main()':
a.cc:22:11: error: expected primary-expression at end of input
   22 |     return
      |           ^
a.cc:22:11: error: expected ';' at end of input
   22 |     return
      |           ^
      |           ;
a.cc:22:11: error: expected '}' at end of input
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
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); //???????????°??? ?°±??¨????????¶????????????????´? ???????????????????????????????????????h?§??????\?????? ?°±?????\
			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);//?????¨????????´???????????\?????°scanf
		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 Insert(char*)':
a.cc:57:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   57 | int main()
      |         ^~
a.cc:57:9: note: remove parentheses to default-initialize a variable
   57 | int main()
      |         ^~
      |         --
a.cc:57:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:58:1: error: a function-definition is not allowed here before '{' token
   58 | {
      | ^
a.cc:77:2: error: expected '}' at end of input
   77 | }
      |  ^
a.cc:42:1: note: to match this '{'
   42 | {
      | ^
Language: C++

#include<stdio.h>
#include<string.h>
#define M 1046527
#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
	int 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); //???????????°??? ?°±??¨????????¶????????????????´? ???????????????????????????????????????h?§??????\?????? ?°±?????\
			return 0;
		}
	}
	return 0;
}


int main()
{
	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);//?????¨????????´???????????\?????°scanf
		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:9: error: expected ',' or ';' before 'int'
   20 |         int i;
      |         ^~~
a.cc:21:13: error: 'i' was not declared in this scope
   21 |         for(i=0;i<strlen(str);i++)
      |             ^
Language: C++

#include<stdio.h>
#include<string.h>
#define M 1046527
#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 ret = 0, p = 1;
  int i;
  for(i = 0; str[i] != '\0'; i++) {
    ret += p * char2int(str[i]);
    p *= 5;
  }
  return ret;
}
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); //???????????°??? ?°±??¨????????¶????????????????´? ???????????????????????????????????????h?§??????\?????? ?°±?????\
			return 0;
		}
	}
	return 0;
}


int main()
{
	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);//?????¨????????´???????????\?????°scanf
		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:16: error: 'char2int' was not declared in this scope
   21 |     ret += p * char2int(str[i]);
      |                ^~~~~~~~
Language: C++

#include<stdio.h>
#include<string.h>
#define M 1046527
#define L 14
char H[M][L];

int char2int(char c) {
  switch (c) {
    case 'A': return 1;
    case 'C': return 2;
    case 'G': return 3;
    case 'T': return 4;
    default: return 0;
  }
}
//?°?????¬??????¬??¢?????°?????¶??????key
long long getKey(char str[]) {
  long long ret = 0, p = 1;
  int i;
  for(i = 0; str[i] != '\0'; i++) {
    ret += p * getChar(str[i]);
    p *= 5;
  }
  return ret;
}
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); //???????????°??? ?°±??¨????????¶????????????????´? ???????????????????????????????????????h?§??????\?????? ?°±?????\
			return 0;
		}
	}
	return 0;
}


int main()
{
	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);//?????¨????????´???????????\?????°scanf
		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:16: error: 'getChar' was not declared in this scope; did you mean 'getchar'?
   21 |     ret += p * getChar(str[i]);
      |                ^~~~~~~
      |                getchar
Language: C++

#include<iostream>
using namespace std;
int table[16777216];
char str[13];

int get_num(char c) {
	switch (c)
	{
		case 'A': return 0;
		case 'C': return 1;
		case 'G': return 2;
		default: return 3;
	}
}

int hash_table() {
	int ret=0;
	for (int i = 0; str[i] != '\0'; i++) {
		ret = ret * 4 + get_num(str[i]);
	}
	return ret;
}

int main() {
	int n;
	char com[6];
	cin >> n;
	memset(table, 0, sizeof(table));
	for (int i = 0; i < n; i++) {
		cin >> com >> str;
		if (com[0] == 'i') {
			table[hash_table()] = 1;
		}
		else {
			int ret = hash_table();
			if (table[ret] == 1)
				cout << "yes" << endl;
			else
				cout << "no" << endl;
		}
	}
	return 0;
}

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

		hash = makehash(str);
		printf("%d\n",hash);
		if(strcmp(command,"find") == 0){
			find(hash);
		}else if(strcmp(command,"insert") == 0){
			insert(hash);
		}else{
			;
		}
	}
}

Compiler output:
a.cc:1:17: error: 'hash' does not name a type
    1 |                 hash = makehash(str);
      |                 ^~~~
a.cc:2:23: error: expected constructor, destructor, or type conversion before '(' token
    2 |                 printf("%d\n",hash);
      |                       ^
a.cc:3:17: error: expected unqualified-id before 'if'
    3 |                 if(strcmp(command,"find") == 0){
      |                 ^~
a.cc:5:18: error: expected unqualified-id before 'else'
    5 |                 }else if(strcmp(command,"insert") == 0){
      |                  ^~~~
a.cc:7:18: error: expected unqualified-id before 'else'
    7 |                 }else{
      |                  ^~~~
a.cc:10:9: error: expected declaration before '}' token
   10 |         }
      |         ^
a.cc:11:1: error: expected declaration before '}' token
   11 | }
      | ^
Language: C++

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

#define M1046527
#define NIL (-1)
#define L 14

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: In function 'int h1(int)':
a.cc:25:28: error: 'M' was not declared in this scope
   25 | int h1(int key){return key%M;}
      |                            ^
a.cc: In function 'int h2(int)':
a.cc:26:32: error: 'M' was not declared in this scope
   26 | int h2(int key){return 1+(key%(M-1));}
      |                                ^
a.cc: In function 'int find(char*)':
a.cc:32:27: error: 'M' was not declared in this scope
   32 |     h=(h1(key)+i*h2(key))%M;
      |                           ^
a.cc:33:15: error: 'H' was not declared in this scope
   33 |     if(strcmp(H[h],str)==0)return 1;
      |               ^
a.cc:36:11: error: expected ';' before '}' token
   36 |   return 0
      |           ^
      |           ;
   37 | }
      | ~          
a.cc: In function 'int insert(char*)':
a.cc:43:27: error: 'M' was not declared in this scope
   43 |     h=(h1(key)+i*h2(key))%M;
      |                           ^
a.cc:44:15: error: 'H' was not declared in this scope
   44 |     if(strcmp(H[h],str)==0) return 1;
      |               ^
a.cc: In function 'int main()':
a.cc:56:13: error: 'M' was not declared in this scope
   56 |   for(i=0;i<M;i++)H[i][0]='\0';
      |             ^
a.cc:56:19: error: 'H' was not declared in this scope
   56 |   for(i=0;i<M;i++)H[i][0]='\0';
      |                   ^
Language: C++

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

#define M 1046527
#define NIL (-1)
#define L 14

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: In function 'int find(char*)':
a.cc:33:15: error: 'H' was not declared in this scope
   33 |     if(strcmp(H[h],str)==0)return 1;
      |               ^
a.cc:36:11: error: expected ';' before '}' token
   36 |   return 0
      |           ^
      |           ;
   37 | }
      | ~          
a.cc: In function 'int insert(char*)':
a.cc:44:15: error: 'H' was not declared in this scope
   44 |     if(strcmp(H[h],str)==0) return 1;
      |               ^
a.cc: In function 'int main()':
a.cc:56:19: error: 'H' was not declared in this scope
   56 |   for(i=0;i<M;i++)H[i][0]='\0';
      |                   ^
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(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 find(char*)':
a.cc:38:11: error: expected ';' before '}' token
   38 |   return 0
      |           ^
      |           ;
   39 | }
      | ~
Language: C++

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

static const int NMAX = 1000000;

char D[NMAX][13];

int h1(long long x) {
	return x % NMAX;
}

int h2(long long x) {
	return 1 + (x % (NMAX - 1));
}

long long convert(char c[]) {
	long long cc = 0;
	for (unsigned int i = 0; i < strlen(c); i++) {
		cc *= 4;
		if (c[i] == 'A') cc += 0;
		else if (c[i] == 'C') cc += 1;
		else if (c[i] == 'G') cc += 2;
		else if (c[i] == 'T') cc += 3;
		else return -1;
	}

	return cc;
}

int myHash(long long cc, int ix) {
	int idx;

	idx = (h1(cc) + (ix * h2(cc))) % NMAX;

	return idx;
}

void insert(char c[]) {
	long long cc;
	int idx;

	cc = convert(c);
	idx = myHash(cc, 0);

	int ix = 0;
	while (strlen(D[idx]) != 0) idx = myHash(cc, ++ix);

	for (unsigned int i = 0; i < strlen(c); i++) {
		D[idx][i] = c[i];
	}
}

bool search(char c[]) {
	long long cc;
	int idx;

	cc = convert(c);
	idx = myHash(cc, 0);

	int ix = 0;
	while (strlen(D[idx]) != 0) {
		if (!strcmp(D[idx], c)) {
			return true;
		}
		else {
			idx = myHash(cc, ++ix);
		}
	}
	return false;
}

int main() {
	int n;
	char c1[7], c2[13];

	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%s %s", c1, c2);
		if (c1[0] == 'i') {
			insert(c2 );
		}
		else if (c1[0] == 's') {
			if (search(c2)) {
				cout << "yes" << endl;
			}
			else {
				cout << "no" << endl;
			}
		}
		else return -1;
	}

	/*
	for (int i = 0; i < NMAX; i++) {
		if (strlen(D[i]) > 0) cout << i << " : " << D[i] << endl;
	}
	*/

	return 0;
}

Compiler output:
a.cc: In function 'long long int convert(char*)':
a.cc:20:38: error: 'strlen' was not declared in this scope
   20 |         for (unsigned int i = 0; i < strlen(c); i++) {
      |                                      ^~~~~~
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 | #include <stdio.h>
a.cc: In function 'void insert(char*)':
a.cc:48:16: error: 'strlen' was not declared in this scope
   48 |         while (strlen(D[idx]) != 0) idx = myHash(cc, ++ix);
      |                ^~~~~~
a.cc:48:16: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:50:38: error: 'strlen' was not declared in this scope
   50 |         for (unsigned int i = 0; i < strlen(c); i++) {
      |                                      ^~~~~~
a.cc:50:38: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'bool search(char*)':
a.cc:63:16: error: 'strlen' was not declared in this scope
   63 |         while (strlen(D[idx]) != 0) {
      |                ^~~~~~
a.cc:63:16: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:64:22: error: 'strcmp' was not declared in this scope
   64 |                 if (!strcmp(D[idx], c)) {
      |                      ^~~~~~
a.cc:64:22: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
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;
}

// 文字れt流から数値へ変換して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[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:37:16: error: lvalue required as left operand of assignment
   37 |     if ( strcmp(H[h], str) = 0 ) return 1;
      |          ~~~~~~^~~~~~~~~~~
a.cc:38:26: error: cannot convert 'bool' to 'const char*'
   38 |     else if (strlen(H[h] == 0 ) return 0;
      |                     ~~~~~^~~~
      |                          |
      |                          bool
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:39:3: error: expected primary-expression before '}' token
   39 |   }
      |   ^
a.cc:38:42: error: expected ')' before '}' token
   38 |     else if (strlen(H[h] == 0 ) return 0;
      |             ~                            ^
      |                                          )
   39 |   }
      |   ~                                       
a.cc:39:3: error: expected primary-expression before '}' token
   39 |   }
      |   ^
a.cc: In function 'int insert(char*)':
a.cc:47:16: error: 'n' was not declared in this scope
   47 |   scanf("%d", &n);
      |                ^
a.cc:49:20: error: 'com' was not declared in this scope
   49 |     scanf("%s %s", com, str);
      |                    ^~~
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;
}
 
// 文字れt流から数値へ変換して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 find(char*)':
a.cc:38:26: error: cannot convert 'bool' to 'const char*'
   38 |     else if (strlen(H[h] == 0 ) return 0;
      |                     ~~~~~^~~~
      |                          |
      |                          bool
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:39:3: error: expected primary-expression before '}' token
   39 |   }
      |   ^
a.cc:38:42: error: expected ')' before '}' token
   38 |     else if (strlen(H[h] == 0 ) return 0;
      |             ~                            ^
      |                                          )
   39 |   }
      |   ~                                       
a.cc:39:3: error: expected primary-expression before '}' token
   39 |   }
      |   ^
a.cc: In function 'int insert(char*)':
a.cc:49:26: error: cannot convert 'bool' to 'const char*'
   49 |     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:49:31: error: expected ')' before '{' token
   49 |     else if (strlen(H[h] == 0) {
      |             ~                 ^~
      |                               )
a.cc:53:3: error: expected primary-expression before '}' token
   53 |   }
      |   ^
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;
}
  
// 文字れt流から数値へ変換して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 find(char*)':
a.cc:38:26: error: cannot convert 'bool' to 'const char*'
   38 |     else if (strlen(H[h] == 0 ) return 0;
      |                     ~~~~~^~~~
      |                          |
      |                          bool
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:39:3: error: expected primary-expression before '}' token
   39 |   }
      |   ^
a.cc:38:42: error: expected ')' before '}' token
   38 |     else if (strlen(H[h] == 0 ) return 0;
      |             ~                            ^
      |                                          )
   39 |   }
      |   ~                                       
a.cc:39:3: error: expected primary-expression before '}' token
   39 |   }
      |   ^
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);  // より高速な入力 scnaf を使用

    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 main()':
a.cc:69:24: error: expected ';' before 'else'
   69 |         printf("yes\n")
      |                        ^
      |                        ;
   70 |       else
      |       ~~~~
Language: C++

#include <cstdio>
const int SIZE = 33554432;

int Hash;
char* c;
void HASH(A) {
  c = A;
  Hash = 1;
  while( *c ) {
    Hash <<= 2;
    Hash += Key[*c];
    c++;
  }
}

int main() {
  bool dic[SIZE];
  char Key[85]; Key['A'] = 0; Key['C'] = 1; Key['G'] = 2; Key['T'] = 3;
  int n; std::scanf("%d\n", &n);
  char str[21];
  for( int i = 0; i < n; i++ ) {
    std::fgets(str, 21, stdin);
    if( str[0] == 'i' ) {
      HASH(str+7);
      dic[Hash] = 1;
    } else {
      HASH(str+5);
      std::puts(dic[Hash] ? "yes" : "no");
    }
  }
  return 0;
}


Compiler output:
a.cc:6:6: error: variable or field 'HASH' declared void
    6 | void HASH(A) {
      |      ^~~~
a.cc:6:11: error: 'A' was not declared in this scope
    6 | void HASH(A) {
      |           ^
a.cc: In function 'int main()':
a.cc:24:7: error: 'HASH' was not declared in this scope
   24 |       HASH(str+7);
      |       ^~~~
a.cc:27:7: error: 'HASH' was not declared in this scope
   27 |       HASH(str+5);
      |       ^~~~
Language: C++

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

using namespace std;

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

  vector<string> dictionary;
  dictionary.reserve(1000000);
  string command, str;
  for (int i = 0; i < n; i++) {
    cin >> command >> str;
    if (command[0] == 'i') {
      dictionary.push_back(str);
    } else {
      const bool found = (dictionary.end() != find(dictionary.begin(), dictionary.end(), str));
      cout << (found ? "yes" : "no") << endl;
    }
  }

 return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:51: 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 |       const bool found = (dictionary.end() != find(dictionary.begin(), dictionary.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:19:51: 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 |       const bool found = (dictionary.end() != find(dictionary.begin(), dictionary.end(), str));
      |                                               ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

using namespace std;

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

  vector<string> dictionary;
  dictionary.reserve(1000000);
  string command, str;
  for (int i = 0; i < n; i++) {
    cin >> command >> str;
    if (command[0] == 'i') {
      dictionary.push_back(str);
    } else {
      const bool found = (dictionary.end() != find(dictionary.begin(), dictionary.end(), str));
      cout << (found ? "yes" : "no") << endl;
    }
  }

 return 0;
}



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


#include<iostrem>
#include<map>

int main()
{
    map<string, bool> dict;
    int n;
    string x, y;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> x >> y;
        if(x == "insert")
            dict[x] = 1;
        else
        {
            if(dict[y] == 1)
                cout << "yes" << endl;
            else cout << "no" << endl;
        }
    }
}



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

#include<iostream>
#include<cstdio>
#include<string>

using namespace std;

#define M 1000000
#define L 14
char H[M][L];

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

int getkey(char A[])
{
	int sum = 0;
	int p = 1;
	for (int i = 0; i < strlen(A); i++)
	{
		int tmp = getchar(A[i]);
		sum = sum + tmp*p;
		p = p * 5;
	}
	return sum;
}

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

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


int insert(char str[])
{
	int key=getkey(str);
	for (int i = 0;; i++)
	{
		int 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 find(char str[])
{
	int key = getkey(str);
	for (int i = 0;; i++)
	{
		int 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 main()
{
	int N;
	cin >> N;
	char A[6], S[L];
	for (int i = 0; i < M; i++)
	{
		H[i][0] = '\0';
	}
	for (int i = 0; i < N; i++)
	{
		scanf("%s%s", A, S);
		if (A[0] == 'i')
		{
			insert(S);
		}
		else if (A[0] == 'f')
		{
			if (find(S))
				cout << "yes" << endl;
			else
				cout << "no" << endl;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int getkey(char*)':
a.cc:24:29: error: 'strlen' was not declared in this scope
   24 |         for (int i = 0; i < strlen(A); i++)
      |                             ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<cstdio>
  +++ |+#include <cstring>
    3 | #include<string>
a.cc: In function 'int insert(char*)':
a.cc:50:21: error: 'strcmp' was not declared in this scope
   50 |                 if (strcmp(H[h], str) == 0)
      |                     ^~~~~~
a.cc:50:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:52:26: error: 'strlen' was not declared in this scope
   52 |                 else if (strlen(H[h]) == 0)
      |                          ^~~~~~
a.cc:52:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:54:25: error: 'strcpy' was not declared in this scope
   54 |                         strcpy(H[h], str);
      |                         ^~~~~~
a.cc:54:25: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc: In function 'int find(char*)':
a.cc:67:21: error: 'strcmp' was not declared in this scope
   67 |                 if (strcmp(H[h], str) == 0)
      |                     ^~~~~~
a.cc:67:21: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:69:26: error: 'strlen' was not declared in this scope
   69 |                 else if (strlen(H[h]) == 0)
      |                          ^~~~~~
a.cc:69:26: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++


import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<String> dicList = new ArrayList<String>();
		String order, str;

		for (int i = 0; i < n; i++) {
			order = sc.next();
			str = sc.next();
			if (order.equals("insert")) {
				dicList.add(str);
			} else if (order.equals("find")) {
				findDic(dicList, str);
			}
		}
	}

	public static void findDic(ArrayList<String> dicList, String str) {
		if (dicList.contains(str)) {
			System.out.println("yes");
		} else {
			System.out.println("no");
		}

	}
}



Compiler output:
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.ArrayList;
      | ^~~~~~
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.Scanner;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: expected unqualified-id before 'public'
    5 | public class Main {
      | ^~~~~~
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.