criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.StringTokenizer;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

static class Dictionary{

ArrayList<String> array=new ArrayList<String>();

void insert(String str){
array.add(str);
}

boolean find(String str){
return (array.indexOf(str)<0)?false:true;
}
}

public static void main(String[] args){
long start=System.currentTimeMillis();
solve();
long end=System.currentTimeMillis();
//out.println(end-start+"ms");
out.flush();
}

private static void solve() throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
Dictionary d=new Dictionary();
for(int i=0;i<n;i++){
StringTokenizer st=new StringTokenizer(br.readLine());
String command=st.nextToken();
String str=st.nextToken();
if("insert".equals(str)){
d.insert(str);
}
if("find".equals(str)){
if(d.find(str)) out.println("yes");
else out.println("no");
}
}
}
}
}

Compiler output:
Main.java:24: error: unreported exception IOException; must be caught or declared to be thrown
solve();
     ^
1 error
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.StringTokenizer;

class Main{

static final PrintWriter out;
static final BufferedReader br;

static class Dictionary{

ArrayList<String> array=new ArrayList<String>();

void insert(String str){
array.add(str);
}

boolean find(String str){
return (array.indexOf(str)<0)?false:true;
}
}

public static void main(String[] args) throws IOException{
out=new PrintWriter(System.out);
br=new BufferedReader(new InputStreamReader(System.in));
long start=System.currentTimeMillis();
solve();
long end=System.currentTimeMillis();
//out.println(end-start+"ms");
out.flush();
}

private static void solve(){
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
Dictionary d=new Dictionary();
for(int i=0;i<n;i++){
StringTokenizer st=new StringTokenizer(br.readLine());
String command=st.nextToken();
String str=st.nextToken();
if("insert".equals(str)){
d.insert(str);
}
if("find".equals(str)){
if(d.find(str)) out.println("yes");
else out.println("no");
}
}
}
}
}

Compiler output:
Main.java:24: error: cannot assign a value to static final variable out
out=new PrintWriter(System.out);
^
Main.java:25: error: cannot assign a value to static final variable br
br=new BufferedReader(new InputStreamReader(System.in));
^
2 errors
Language: Java

import java.io.*;
import java.util.ArrayList;
import java.util.StringTokenizer;

class Main{

static PrintWriter out;
static BufferedReader br;

static class Dictionary{

ArrayList<String> array=new ArrayList<String>();

void insert(String str){
array.add(str);
}

boolean find(String str){
return (array.indexOf(str)<0)?false:true;
}
}

public static void main(String[] args) throws IOException{
out=new PrintWriter(System.out);
br=new BufferedReader(new InputStreamReader(System.in));
long start=System.currentTimeMillis();
solve();
long end=System.currentTimeMillis();
//out.println(end-start+"ms");
out.flush();
}

private static void solve(){
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
Dictionary d=new Dictionary();
for(int i=0;i<n;i++){
StringTokenizer st=new StringTokenizer(br.readLine());
String command=st.nextToken();
String str=st.nextToken();
if("insert".equals(str)){
d.insert(str);
}
if("find".equals(str)){
if(d.find(str)) out.println("yes");
else out.println("no");
}
}
}
}
}

Compiler output:
Main.java:35: error: unreported exception IOException; must be caught or declared to be thrown
while((line=br.readLine())!=null&&!line.isEmpty()){
                       ^
Main.java:39: error: unreported exception IOException; must be caught or declared to be thrown
StringTokenizer st=new StringTokenizer(br.readLine());
                                                  ^
2 errors
Language: Java

import java.util.HashSet;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Dictionary {
    public static void main (String[] args) throws IOException {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	int n = Integer.parseInt(br.readLine());
	String input;
	HashSet<String> dic = new HashSet<String>();
	StringBuilder sb = new StringBuilder();
	for (int i = 0; i < n; i++) {
	    input = br.readLine();
	    if (input.startsWith("i")) {
		dic.add(input.substring(7));
	    } else if (input.startsWith("f")) {
		if (dic.contains(input.substring(5))) {
		    sb.append("yes\n");
		} else {
		    sb.append("no\n");
		}
	    }
	}
	System.out.print(sb);
    }
}

Compiler output:
Main.java:5: error: class Dictionary is public, should be declared in a file named Dictionary.java
public class Dictionary {
       ^
1 error
Language: Java

import util.FastReader;

import java.util.HashSet;

/**
 * @see <a href='http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?lang=jp&id=ALDS1_4_C'>Dictionary</a>
 */
public class ALDS1_4_C {
    private static FastReader in = new FastReader();

    public static void main(String[] args) throws Exception {
        ALDS1_4_C ALDS14C = new ALDS1_4_C();
        ALDS14C.run();
    }

    private void run() {
        int[] dictionary = new int[16777216];
        int n = in.nextInt();
        for (int i = 0; i < n; i++) {
            String order = in.next();
            String word = in.next();
            int index = toInt(word);
            switch (order) {
                case "insert":
                    dictionary[index]++;
                    break;
                case "find":
                    System.out.println(dictionary[index] > 0 ? "yes" : "no");
                    break;
            }
        }
    }

    private int toInt(String word) {
        int i = 0;
        int mul = 1;
        for (char charactor : word.toCharArray()) {
            switch (charactor) {
                case 'A':
                    i += mul;
                    break;
                case 'C':
                    i += mul * 2;
                    break;
                case 'T':
                    i += mul * 3;
                    break;
                case 'G':
                    i += mul * 4;
                    break;
            }
            mul *= 5;
        }
        return i;
    }
}

Compiler output:
Main.java:8: error: class ALDS1_4_C is public, should be declared in a file named ALDS1_4_C.java
public class ALDS1_4_C {
       ^
Main.java:1: error: package util does not exist
import util.FastReader;
           ^
Main.java:9: error: cannot find symbol
    private static FastReader in = new FastReader();
                   ^
  symbol:   class FastReader
  location: class ALDS1_4_C
Main.java:9: error: cannot find symbol
    private static FastReader in = new FastReader();
                                       ^
  symbol:   class FastReader
  location: class ALDS1_4_C
4 errors
Language: Java

  import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;

public class Main2 {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Map<String,Integer> dictionary = new HashMap<String,Integer>();
		StringBuffer ans = new StringBuffer();
		int n = Integer.parseInt(br.readLine());
	
		for(int i = 0; i < n; i++){
			String[] order = br.readLine().split(" ");
			if (order[0].contains("insert")) {
				dictionary.put(order[1], i);
			} else {
				if (dictionary.containsKey(order[1])) {
					ans.append("yes" + "\n");
				} else {
					ans.append("no" + "\n");
				}
			}
		}
		System.out.print(ans.toString());
	}
} 

Compiler output:
Main.java:7: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: Java

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


class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		// insert ????????? ???????????? ?????£?????????????´?????????????????????????????????????
		StringBuffer dictionary = new StringBuffer();
		// find ????????? ????????????????´????????????????????????????????????????????????????
		StringBuffer ans = new StringBuffer();

		// ???insert ???????????????find ?????????????????????????????????????????????????????¨??¨?????????????????¨???????????????????´???????
		for (int i = 0; i < n; i++) {
			String[] order = br.readLine().split(" ");
			// order[0](????????¨)???"insert"????????????????????????????????¶?????????????????????????????\?????????
			if (order[0].contains("insert")) {
				// insert????????´???????????????????????¨???dictionary?????????????????????????´???????
				dictionary.append(order[1] + " ");
			} else {
				if (dictionary.toString().contains(order[1])) {
					ans.append("yes" + "\n");
				} else {
					ans.append("no" + "\n");
				}
			}
		}
		System.out.print(ans.toString());
	}
}import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


class Main {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		// insert ????????? ???????????? ?????£?????????????´?????????????????????????????????????
		StringBuffer dictionary = new StringBuffer();
		// find ????????? ????????????????´????????????????????????????????????????????????????
		StringBuffer ans = new StringBuffer();

		// ???insert ???????????????find ?????????????????????????????????????????????????????¨??¨?????????????????¨???????????????????´???????
		for (int i = 0; i < n; i++) {
			String[] order = br.readLine().split(" ");
			// order[0](????????¨)???"insert"????????????????????????????????¶?????????????????????????????\?????????
			if (order[0].contains("insert")) {
				// insert????????´???????????????????????¨???dictionary?????????????????????????´???????
				dictionary.append(order[1] + " ");
			} else {
				if (dictionary.toString().contains(order[1])) {
					ans.append("yes" + "\n");
				} else {
					ans.append("no" + "\n");
				}
			}
		}
		System.out.print(ans.toString());
	}
}

Compiler output:
Main.java:33: error: class, interface, enum, or record expected
}import java.io.BufferedReader;
 ^
Main.java:34: error: class, interface, enum, or record expected
import java.io.IOException;
^
Main.java:35: error: class, interface, enum, or record expected
import java.io.InputStreamReader;
^
3 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main3 {
    
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        HashSet<String> array = new HashSet<String>();
        
        int N = in.nextInt();
        for (int i = 0; i < N; i++){
            String c1 = in.next();
            String c2 = in.next();
            
            if (c1.equals("insert")){
                array.add(c2);
            }else if(c1.equals("find")){   
                if (array.contains(c2)){
                    System.out.println("yes");
                }else{
                    System.out.println("no");
                }
            }
        }
    }
}

Compiler output:
Main.java:4: error: class Main3 is public, should be declared in a file named Main3.java
public class Main3 {
       ^
1 error
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
class Main {
   public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		ArrayList<String> S = new ArrayList<String>();

		boolean result;

		for(int i = 0; i < n; i++){
			String str1 = scan.next();
			String str2 = scan.next();

			if(str1.equals("insert")){
				S.add(str2);
			}else{
				Collections.sort(S);
				result = BinarySearch(S, str2);
				if(result){
					System.out.println("yes");
				}else{
					System.out.println("no");
				}
			}
		}
	}

	static boolean BinarySearch(ArrayList<String> data, String serch){

		int min = 0;
		int max = data.size() - 1;

		while(min <= max){

			int middle = (min + max) / 2;

			if(serch.equals(data.get(middle))){
				return true;
			}else if(serch.compareTo(data.get(middle)) < 0){
				max = middle - 1;
			}else{
				min = middle + 1;
			}
		}
		return false;
	}
}

Compiler output:
Main.java:18: error: cannot find symbol
				Collections.sort(S);
				^
  symbol:   variable Collections
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

/**
 *
 * @author baito
 */
public class Main2 {
    static StringBuilder sb = new StringBuilder();
    /**
     * @param args the command line arguments
     * @throws java.lang.Exception
     */
    public static void main(String[] args) throws Exception {
        // TODO code application logic here
        ContestScanner sc = new ContestScanner();
        int n = sc.nextInt();
        char[] c;
        boolean[] dic = new boolean[244140625];
        for (int i = 0; i < n; i++) {

            c = sc.readLine().toCharArray();
            {
                if (c[0] == 'i') {
                    dic[hash(Arrays.copyOfRange(c, 7, c.length))] = true;
                } else {
                    if(dic[hash(Arrays.copyOfRange(c, 5, c.length))]==true)
                        sb.append("yes").append('\n');
                    else
                        sb.append("no").append('\n');
                }
            }
        }
        System.out.println(sb);
    }

    public static int hash(char[] c) {
        int p;
        int hash = 0;
        for (int i = 0; i < c.length; i++) {
            switch (c[i]) {
                case 'A':
                    p = 1;
                    break;
                case 'C':
                    p = 2;
                    break;
                case 'G':
                    p = 3;
                    break;
                default:
                    p = 4;
                    break;
            }
            hash = hash * 5 + p;

        }
        return hash;
    }

}

//????????????????????????
class ContestScanner {

    private final BufferedReader reader;
    private String[] line;
    private int idx;

    public ContestScanner() throws FileNotFoundException {
        reader = new BufferedReader(new InputStreamReader(System.in));
    }

    public ContestScanner(String filename) throws FileNotFoundException {
        reader = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
    }
    //???????????? 

    public String readLine() throws Exception {
        return reader.readLine();
    }

    public String nextToken() throws IOException {
        if (line == null || line.length <= idx) {
            line = reader.readLine().trim().split(" ");
            idx = 0;
        }
        return line[idx++];
    }

    public long nextLong() throws IOException, NumberFormatException {
        return Long.parseLong(nextToken());
    }

    public int nextInt() throws NumberFormatException, IOException {
        return (int) nextLong();
    }

    public double nextDouble() throws NumberFormatException, IOException {
        return Double.parseDouble(nextToken());
    }
}

Compiler output:
Main.java:12: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: Java

import java.util.Scanner;
import java.util.Arrays;
import java.util.Deque;
import java.util.ArrayDeque;

class Main{
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		int n = Integer.parseInt(scanner.nextLine());
		boolean[] dic = new boolean[(int) Math.pow(5, 12)];

		for(int i = 0; i < n; i++){
			char[] c = scanner.nextLine().toCharArray();

			if(c[0] == "i"){
				dic[hash(Arrays.copyOfRange(c, 7, c.length))] == true;
			}else{
				if(dic[hash(Arrays.copyOfRange(c, 5, c.length))] == true){
					sb.append("yes\n");
				}else{
					sb.append("no\n");
				}
			}
		}
		System.out.print(sb);
	}

	public static int hash(char[] c){
		int a = 0;
		int hash = 0;
		for(int i = 0; i < c.length; i++){
			switch(c[i]){
				case 'A':
	                a = 1;
	                break;
            	case 'C':
	                a = 2;
	                break;
	            case 'G':
	                a = 3;
	                break;
	            default:
	                a = 4;
	                break; 
			}
			hash = hash*5 + a;
		}
		return hash;
	}
}

Compiler output:
Main.java:17: error: not a statement
				dic[hash(Arrays.copyOfRange(c, 7, c.length))] == true;
				                                              ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.IOException;
import java.util.TreeSet;

public class ALDS1_4_C_Dictionary {

    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        int n = Integer.parseInt(br.readLine());
        TreeSet<String> dictionary = new TreeSet();
        while (n-- > 0) {
            String[] command = br.readLine().split(" ");
            switch (command[0]) {
                case "insert":
                    dictionary.add(command[1]);
                    break;
                case "find":
                    bw.append(dictionary.contains(command[1]) ? "yes\n" : "no\n");
                    break;
            }
        }
        bw.flush();
    }

}


Compiler output:
Main.java:8: error: class ALDS1_4_C_Dictionary is public, should be declared in a file named ALDS1_4_C_Dictionary.java
public class ALDS1_4_C_Dictionary {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: Java


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

public class Main2 {
	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:
Main.java:5: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2 {
       ^
1 error
Language: Java

import java.util.Scanner;
import java.util.HashSet;
import java.util.Set;

public class j10031{
    public static void main(String[] aaa){
        Scanner s = new Scanner(System.in);
        Set<String> hset = new HashSet<String>();
        int n,q,i,count=0;
        String a,b;
        n = s.nextInt();
        for(i=0;i<n;i++){
            a = s.next();
            b = s.next();
            if(a.equals("insert"))hset.add(b);
            else{
                if(hset.contains(b))System.out.println("yes");
                else System.out.println("no");
            }
        }
    }
}


Compiler output:
Main.java:5: error: class j10031 is public, should be declared in a file named j10031.java
public class j10031{
       ^
1 error
Language: Java

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

public class Main{
	public static void main(String[] args){
		HashMap<Integer,Short> hashDictionary = new HashMap<Integer,Short>();
		
		Scanner sc = new Scanner(System.in);								//標準入力
		short numOfInput = sc.nextShort();												//データ数
		
		for (int i = 0; i < numOfInput; i++){
			String order = sc.next();
			
			//入力された文字のハッシュ値を求める
			int newHash = hash(sc.next());
			
			//新しい辞書の追加
			if (order.equals("insert") == true){				
				//ハッシュ値を追加
				hashDictionary.put(newHash, 1);
				
			}else{
				if (hashDictionary.containsKey(newHash) == true){
					System.out.println("yes");
				}else{
					System.out.println("no");
				}
			}
		}
	}
	
	private static int hash(String word){
		int result = 0;
		
		for (int i = 0; i < word.length(); i++){
			char c = word.charAt(i);
			
			if (c == 'A'){
				result += 1 * Math.pow(5,i);
			}else if (c == 'C'){
				result += 2 * Math.pow(5,i);
			}else if (c == 'T'){
				result += 3 * Math.pow(5,i);
			}else{
				result += 4 * Math.pow(5,i);
			}
		}
		
		return result;
	}
}


Compiler output:
Main.java:8: error: cannot find symbol
		HashMap<Integer,Short> hashDictionary = new HashMap<Integer,Short>();
		^
  symbol:   class HashMap
  location: class Main
Main.java:8: error: cannot find symbol
		HashMap<Integer,Short> hashDictionary = new HashMap<Integer,Short>();
		                                            ^
  symbol:   class HashMap
  location: class Main
2 errors
Language: Java

import java.util.Scanner;
import java.util.HashMap

public class Main{
	public static void main(String[] args){
		HashMap<Integer,Short> hashDictionary = new HashMap<Integer,Short>();
		
		Scanner sc = new Scanner(System.in);								//標準入力
		short numOfInput = sc.nextShort();												//データ数
		
		for (int i = 0; i < numOfInput; i++){
			String order = sc.next();
			
			//入力された文字のハッシュ値を求める
			int newHash = hash(sc.next());
			
			//新しい辞書の追加
			if (order.equals("insert") == true){				
				//ハッシュ値を追加
				hashDictionary.put(newHash, 1);
				
			}else{
				if (hashDictionary.containsKey(newHash) == true){
					System.out.println("yes");
				}else{
					System.out.println("no");
				}
			}
		}
	}
	
	private static int hash(String word){
		int result = 0;
		
		for (int i = 0; i < word.length(); i++){
			char c = word.charAt(i);
			
			if (c == 'A'){
				result += 1 * Math.pow(5,i);
			}else if (c == 'C'){
				result += 2 * Math.pow(5,i);
			}else if (c == 'T'){
				result += 3 * Math.pow(5,i);
			}else{
				result += 4 * Math.pow(5,i);
			}
		}
		
		return result;
	}
}


Compiler output:
Main.java:2: error: ';' expected
import java.util.HashMap
                        ^
1 error
Language: Java

import java.awt.print.Printable;
import java.util.Scanner;
import javax.sound.midi.SysexMessage;
import java.util.Arrays;
  
public class Main{      
    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);

        int count = sc.nextInt();
        String dict[]=new String[1000000];
        for(int i=0;i<count;i++){
            String str = sc.next();
            if(str.equals("insert"))
                dict[i]=sc.next();
            else{
                if(Arrays.asList(dict).contains(sc.next()))
                    System.out.println("yes");
                else
                    System.out.println("no");
            }
            }
        }
        sc.close();
        
    }   
}


Compiler output:
Main.java:25: error: <identifier> expected
        sc.close();
                ^
Main.java:28: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.awt.print.Printable;
import java.util.Scanner;
import java.util.Set;

import javax.sound.midi.SysexMessage;
import java.util.Arrays;
  
public class Main{      
    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);

        int count = sc.nextInt();
        String dict[]=new String[1000000];
        Set<String> set = new HashSet<String>();
        for(int i=0;i<count;i++){
            String str = sc.next();
            if(str.equals("insert"))
                set.add(sc.next());
            else{
                if(set.contains(sc.next()))
                    System.out.println("yes");
                else
                    System.out.println("no");
            }
            
        }
        sc.close();
        
    }   
}


Compiler output:
Main.java:15: error: cannot find symbol
        Set<String> set = new HashSet<String>();
                              ^
  symbol:   class HashSet
  location: class Main
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;

public class _CDictionary {
    public static void main(String[] args) throws Exception {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(bf.readLine());
        HashSet<String> hashSet = new HashSet<>();
        for (int i = 0; i < n; i++) {
            String sp = bf.readLine();
            if (sp.charAt(0)=='i'){
                hashSet.add(sp.substring(6));
            }else {
                System.out.println(hashSet.contains(sp.substring(6))?"yes":"no");
            }
        }
    }
}


Compiler output:
Main.java:5: error: class _CDictionary is public, should be declared in a file named _CDictionary.java
public class _CDictionary {
       ^
1 error
Language: Java


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashSet;

public class _CDictionary {
    public static void main(String[] args) throws Exception {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(bf.readLine());
        StringBuilder sb = new StringBuilder();
        HashSet<String> hashSet = new HashSet<>();
        for (int i = 0; i < n; i++) {
            String sp = bf.readLine();
            if (sp.charAt(0)=='i'){
                hashSet.add(sp.substring(7));
            }else {
               sb.append(hashSet.contains(sp.substring(5))?"yes\n":"no\n");
            }
        }
        bf.close();
        System.out.println(sb.toString());
    }
}


Compiler output:
Main.java:6: error: class _CDictionary is public, should be declared in a file named _CDictionary.java
public class _CDictionary {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.BitSet;
import java.util.HashSet;

public class _CDictionary {
    public static void main(String[] args) throws Exception {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(bf.readLine());
        StringBuilder sb = new StringBuilder();
        BitSet bitSet = new BitSet(33554432);
        final char[] key = new char[128];
        key['A'] = 0;
        key['C'] = 1;
        key['G'] = 2;
        key['T'] = 3;
        for (int i = 0; i < n; i++) {
            String sp = bf.readLine();
            if (sp.charAt(0) == 'i') {
                int hash = 1;
                for (int j = 7; j < sp.length(); j++) {
                    hash <<= 2;
                    hash+=key[sp.charAt(j)];
                }
                bitSet.set(hash);
            } else {
                int hash = 1;
                for (int j = 5; j < sp.length(); j++) {
                    hash <<= 2;
                    hash+=key[sp.charAt(j)];
                }
                sb.append(bitSet.get(hash) ? "yes\n" : "no\n");
            }
        }
        bf.close();
        System.out.print(sb.toString());
    }
}


Compiler output:
Main.java:6: error: class _CDictionary is public, should be declared in a file named _CDictionary.java
public class _CDictionary {
       ^
1 error
Language: Java

import java.io.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
	    int i,j,n=0,hz=0,sc;
    BufferedReader sca=new BufferedReader(new InputStreamReader(System.in));;
    String yomi,sp[]=new String[2];//0:order 1:name
    try{
    n=Integer.parseInt(sca.readLine());
    }catch(Exception e){
	System.out.println(e);
    }
    String dic[] = new String[n];
    for(i=0;i<n;i++){
	try{
	sp=(sca.readLine()).split("[\\s]+");
	}catch(Exception e){
	    System.out.println(e);
	}
    	if(sp[0].equals("insert")){
	    for(sc=0;sc<n;sc++){
		hz=myhash(sp[1],n)+sc*(1+myhash(sp[1].n-1));
		if(dic[hz]==null){
		    dic[hz]=sp[1];
		    break;
	    }
    	}
	}
    	if(sp[0].equals("find")){
	    for(sc=0;sc<n;sc++){
		hz=myhash(sp[1],n)+sc*(1+myhash(sp[1].n-1));
		if(dic[hz]==null){
		    break;
      		}
		if(dic[hz].equals(sp[1])){
		    break;
		}
	    }
    		if(dic[hz]==null){
    			System.out.println("no");
    		}else{
    			System.out.println("yes");
    		}
    	}
	
    }
	}
    
    public static int myhash(String data,int ti){//A=2,C=3,G=5,T=7;
	int k,h;
        String moji[];
	moji=data.split("");
	//	System.out.println(moji[0]);
	h=1;
	for(k=0;k<moji.length;k++){
	    if(moji[k].equals("A")){
		h*=2;
	    }else if(moji[k].equals("C")){
		h*=3;
	    }else if(moji[k].equals("G")){
		h*=5;
	    }else if(moji[k].equals("T")){
		h*=7;
	    }
	}
	return h%ti;
    }

}


Compiler output:
Main.java:23: error: cannot find symbol
		hz=myhash(sp[1],n)+sc*(1+myhash(sp[1].n-1));
		                                     ^
  symbol:   variable n
  location: class String
Main.java:32: error: cannot find symbol
		hz=myhash(sp[1],n)+sc*(1+myhash(sp[1].n-1));
		                                     ^
  symbol:   variable n
  location: class String
2 errors
Language: Java

import java.io.*;
public class p4_3_2{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
	    int i,j,n=0,hz=0,sc,ha1=0,ha2=0;
    BufferedReader sca=new BufferedReader(new InputStreamReader(System.in));;
    String yomi,sp[]=new String[2];//0:order 1:name
    try{
    n=Integer.parseInt(sca.readLine());
    }catch(Exception e){
	System.out.println(e);
	System.exit(0);
    }
    String dic[] = new String[n];
    for(i=0;i<n;i++){
	try{
	sp=(sca.readLine()).split("[\\s]+");
	}catch(Exception e){
	    System.out.println(e);
	    System.exit(0);
	}
    	if(sp[0].equals("insert")){
	    ha1=myhash(sp[1],n);
	    if(i!=0){
	   ha2=1+myhash(sp[1],n-1);
	    }
	    for(sc=0;sc<n;sc++){
		hz=(ha1+sc*ha2)%n;
		if(dic[hz]==null){
		    dic[hz]=sp[1];
		    break;
	    }
	    }
	}
    	if(sp[0].equals("find")){
	    ha1=myhash(sp[1],n);
	    if(i!=0){
	    ha2=1+myhash(sp[1],n-1);
	    }
	    for(sc=0;sc<n;sc++){
		hz=(ha1+sc*ha2)%n;
		if(dic[hz]==null){
		    break;
      		}
		if(dic[hz].equals(sp[1])){
		    break;
		}
	    }
    		if(dic[hz]==null||sc==n){
    			System.out.println("no");
    		}else{
    			System.out.println("yes");
    		}
    	}
	
    }
	}
    
    public static int myhash(String data,int ti){//A=2,C=3,G=5,T=7;
	int k;
	long h;
        String moji[];
	moji=data.split("");
	h=1l;
	for(k=0;k<moji.length;k++){
	    if(moji[k].equals("A")){
		h*=2;
	    }else if(moji[k].equals("C")){
		h*=3;
	    }else if(moji[k].equals("G")){
		h*=5;
	    }else if(moji[k].equals("T")){
		h*=7;
	    }
	}
	return (int)(h%(long)ti);
    }

}



Compiler output:
Main.java:2: error: class p4_3_2 is public, should be declared in a file named p4_3_2.java
public class p4_3_2{
       ^
1 error
Language: Java

import java.io.*;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
	    int i,j,n=0,hz=0,sc,ha1=0,ha2=0;
    BufferedReader sca=new BufferedReader(new InputStreamReader(System.in));;
    String yomi,sp[]=new String[2];//0:order 1:name
    try{
    n=Integer.parseInt(sca.readLine());
    }catch(Exception e){
	System.out.println(e);
	System.exit(0);
    }
    String dic[] = new String[n];
    for(i=0;i<n;i++){
	try{
	sp=(sca.readLine()).split("[\\s]+");
	}catch(Exception e){
	    System.out.println(e);
	    System.exit(0);
	}
    	if(sp[0].equals("insert")){
	    ha1=myhash(sp[1],n);
	    if(i!=0){
	   ha2=1+myhash(sp[1],n-1);
	    }
	    for(sc=0;sc<n;sc++){
		hz=(ha1+sc*ha2)%n;
		if(dic[hz]==null){
		    dic[hz]=sp[1];
		    break;
	    }
	    }
	}
    	if(sp[0].equals("find")){
	    ha1=myhash(sp[1],n);
	    if(i!=0){
	    ha2=1+myhash(sp[1],n-1);
	    }
	    for(sc=0;sc<n;sc++){
		hz=(ha1+sc*ha2)%n;
		if(dic[hz]==null){
		    break;
      		}
		if(dic[hz].equals(sp[1])){
		    break;
		}
	    }
    		if(dic[hz]==null||sc==n){
    			System.out.println("no");
    		}else{
    			System.out.println("yes");
    		}
    	}
	
    }
	}
    
    public static int myhash(String data,int ti){//A=2,C=3,G=5,T=7;
	int k;
	int h;
        String moji[];
	moji=data.split("");
        h=0
	for(k=0;k<moji.length;k++){
	    if(moji[k].equals("A")){
		h+=1;
	    }else if(moji[k].equals("C")){
		h+=10;
	    }else if(moji[k].equals("G")){
		h+=100;
	    }else if(moji[k].equals("T")){
		h+=1000;
	    }
	}
	return h%ti;
    }

}



Compiler output:
Main.java:65: error: ';' expected
        h=0
           ^
1 error
Language: Java

mport java.io.*;
import java.util.Map;
import java.util.HashMap;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
    int i,j,n=0;
    BufferedReader sca=new BufferedReader(new InputStreamReader(System.in));;
    String yomi,sp[]=new String[2];//0:order 1:name
    try{
    n=Integer.parseInt(sca.readLine());
    }catch(Exception e){
	System.out.println(e);
    }
    HashMap<String,String> dicmap=new HashMap<String,String>(n);
    for(i=0;i<n;i++){
	try{
	sp=(sca.readLine()).split("[\\s]+");
	}catch(Exception e){
	    System.out.println(e);
	}
    	if(sp[0].equals("insert")){
	    dicmap.put(sp[1],sp[1]);
    	}
    	if(sp[0].equals("find")){
    		if(dicmap.containsKey(sp[1])){
    			System.out.println("yes");
    		}else{
    			System.out.println("no");
    		}
    	}
    }
	}

}



Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.io.*;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Map;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.HashMap;
^
3 errors
Language: Java

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

class Main {
  public static void main(String... args) {
    Scanner sc = new Scanner(System.in);
    int size = Integer.parseInt(sc.next());
    List<String> inserts = new ArrayList<String>(size);
    List<String> results = new ArrayList<String>(size);
    String input;
    String find;

    int asciiIndex;
    // boolean first = true;

    for (int i = 0; i < size; i++) {

      if (sc.next().equals("insert")) {
        inserts.add(sc.next());

        // if (first) {
        //     first = false;
        // }

      } else {

        // if (first) {
        //   results[fIndex] = "no";
        //   fIndex++;
        //   continue;
        // }

        results.add(search(sc.next(), inserts) ? "yes" : "no");
      }
    }

    for (String result : results) {
      System.out.println(resulta);
    }
  }

  public static boolean search(String find, List<String> inserts) {
    for (String check : inserts) {
      if (check.equals(find)) {
        return true;
      }
    }

    return false;
  }
}



Compiler output:
Main.java:39: error: cannot find symbol
      System.out.println(resulta);
                         ^
  symbol:   variable resulta
  location: class Main
1 error
Language: Java

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

class Main {
  public static void main(String... args) {
    Scanner sc = new Scanner(System.in);
    int size = Integer.parseInt(sc.next());
    List<String> inserts = new ArrayList<String>(size);
    List<String> results = new ArrayList<String>(size);
    String input;
    String find;

    int asciiIndex;

    for (int i = 0; i < size; i++) {

      if (sc.next().equals("insert")) {
        inserts.add(sc.next());

      } else {
        results.add(search(sc.next(), inserts) ? "yes" : "no");
      }
    }

    for (String result : results) {
      System.out.println(resulta);
    }
  }

  public static boolean search(String find, List<String> inserts) {
    for (String check : inserts) {
      if (check.equals(find)) {
        return true;
      }
    }

    return false;
  }
}



Compiler output:
Main.java:27: error: cannot find symbol
      System.out.println(resulta);
                         ^
  symbol:   variable resulta
  location: class Main
1 error
Language: C

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

#define MAX 1000000
#define L 14

char H[MAX][L];

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

int getvalue(char ary[]){
  int sum=0,a=1,i;
  for(i=0;i<strlen(ary[i]);i++){
    sum+=a*(ctoi(ary[i]));
    a*=5;
  }
  return sum;
}

int jud1(int key){return key%MAX;}
int jud2(int key){return 1+(key%(M-1));}

int find(char ary[]){
  int key,i,jud;
  key=getvalue(ary);
  for(i=0;;i++){
    jud=(jud1(key)+i*jud2(key))%MAX;
    if(strcmp(H[jud],ary)==0)return 1;
    else if(strlen(H[jud])==0)return 0;
  }
  return 0;
}

int insert(char ary[]){
  
  int key,i,jud;
  
  key=getvalue(ary);
  for(i=0;;i++){
    jud=(jud1(key)+i*jud2(key))%MAX;
    if(strcmp(H[jud],ary)==0)return 1;
    else if(strlen(H[h])==0){
      strcpy(H[jud],str);
      return 0;
    }
  }
  return 0;
}

int main(){
  int i,n;
  char ary[L],command[9];
  for(i=0;i<MAX;i++)H[i][0]='\0';
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s %s",command,ary);
    if(command[0]=='i'){
      insert(ary);
    }
    else{
      if(find(ary)){
	printf("yes\n");
      }
      else printf("no\n");
    }
  }
  return 0;
}

	

		     
		     
 



Compiler output:
main.c: In function 'ctoi':
main.c:11:11: error: 'ch' undeclared (first use in this function)
   11 |   else if(ch=='C')return 2;
      |           ^~
main.c:11:11: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'getvalue':
main.c:19:23: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   19 |   for(i=0;i<strlen(ary[i]);i++){
      |                    ~~~^~~
      |                       |
      |                       char
In file included from main.c:2:
/usr/include/string.h:407:35: note: expected 'const char *' but argument is of type 'char'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
main.c: In function 'jud2':
main.c:27:34: error: 'M' undeclared (first use in this function)
   27 | int jud2(int key){return 1+(key%(M-1));}
      |                                  ^
main.c: In function 'insert':
main.c:48:22: error: 'h' undeclared (first use in this function)
   48 |     else if(strlen(H[h])==0){
      |                      ^
main.c:49:21: error: 'str' undeclared (first use in this function)
   49 |       strcpy(H[jud],str);
      |                     ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define INF 0x3f3f3f3f
#define NIL -1
#define M 1000003
__int64 T[M+1];
void trans(char *s){
    for(int i = 0; i < strlen(s); i++){
        if(s[i] == 'A') s[i] = '1';
        else if(s[i] == 'C') s[i] = '2';
        else if(s[i] == 'G') s[i] = '3';
        else if(s[i] == 'T') s[i] = '4';
    }
}
__int64 stringToInt(char s[]){
    __int64 t = 0;
    __int64 p = 1;
    for(int i = strlen(s)-1; i >= 0; i--){
        t += (s[i]-'0')*p;
        p *= 10;
    }
    return t;
}
void insert(__int64 c){
    T[c] = 1;
}
int find(__int64 d){
    if(T[d] == NIL){
        return -1;
    }
    else{
        return 1;
    }
}
int main(){
    for(int i = 0; i < M; i++) T[i] = NIL;

    int n;
    scanf("%d", &n);
    while(n--){
        char a[10], b[13];
        scanf("%s %s", a, b);
        if(a[0] == 'i'){
            trans(b);
            __int64 c = stringToInt(b);
            insert(c);
        }
        else{
            trans(b);
            __int64 d = stringToInt(b);
            if(find(d) != -1){
                printf("yes\n");
            }
            else{
                printf("no\n");
            }
        }
    }

    return 0;
}


Compiler output:
main.c:7:1: error: unknown type name '__int64'; did you mean '__int64_t'?
    7 | __int64 T[M+1];
      | ^~~~~~~
      | __int64_t
main.c:16:1: error: unknown type name '__int64'; did you mean '__int64_t'?
   16 | __int64 stringToInt(char s[]){
      | ^~~~~~~
      | __int64_t
main.c: In function 'stringToInt':
main.c:17:5: error: unknown type name '__int64'; did you mean '__int64_t'?
   17 |     __int64 t = 0;
      |     ^~~~~~~
      |     __int64_t
main.c:18:5: error: unknown type name '__int64'; did you mean '__int64_t'?
   18 |     __int64 p = 1;
      |     ^~~~~~~
      |     __int64_t
main.c: At top level:
main.c:25:13: error: unknown type name '__int64'; did you mean '__int64_t'?
   25 | void insert(__int64 c){
      |             ^~~~~~~
      |             __int64_t
main.c:28:10: error: unknown type name '__int64'; did you mean '__int64_t'?
   28 | int find(__int64 d){
      |          ^~~~~~~
      |          __int64_t
main.c: In function 'main':
main.c:46:13: error: unknown type name '__int64'; did you mean '__int64_t'?
   46 |             __int64 c = stringToInt(b);
      |             ^~~~~~~
      |             __int64_t
main.c:47:13: error: implicit declaration of function 'insert' [-Wimplicit-function-declaration]
   47 |             insert(c);
      |             ^~~~~~
main.c:51:13: error: unknown type name '__int64'; did you mean '__int64_t'?
   51 |             __int64 d = stringToInt(b);
      |             ^~~~~~~
      |             __int64_t
main.c:52:16: error: implicit declaration of function 'find' [-Wimplicit-function-declaration]
   52 |             if(find(d) != -1){
      |                ^~~~
Language: C

#include<stdio.h>
#include<string.h>
#define M 1046537
#define NIL (-1)
#define L 14


 char[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(int i=0;i<strlen(str);i++){
           sum+=p*(getChar(str[i]));
           p*=5;
           }
     return sum;
     }

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

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

 int find(char str[]){
     long long x,i,h;
     x=getKey(str);
     for(i=0;;i++){
         h=(h1(x)+i*h2(x))%M;
         if(strcmp(H[h],str)==0)return 0;
         else if(strlen(H[h])==0)return 0;
         }
     return 0;
     }

 int insert(char str[]){
     long long x.i.h;
     x=getKey(str);
     for(i=0;;i++){
         h=(h1(x)+i*h2(x))%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];
     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:
main.c:8:6: error: expected identifier or '(' before '[' token
    8 |  char[M][l];
      |      ^
main.c:18:31: error: expected identifier or '(' before '{' token
   18 |  long long getKey(char str[]);{
      |                               ^
main.c: In function 'find':
main.c:40:20: error: 'H' undeclared (first use in this function)
   40 |          if(strcmp(H[h],str)==0)return 0;
      |                    ^
main.c:40:20: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'insert':
main.c:47:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   47 |      long long x.i.h;
      |                 ^
main.c:47:17: error: expected expression before '.' token
main.c:48:6: error: 'x' undeclared (first use in this function)
   48 |      x=getKey(str);
      |      ^
main.c:49:10: error: 'i' undeclared (first use in this function)
   49 |      for(i=0;;i++){
      |          ^
main.c:50:10: error: 'h' undeclared (first use in this function); did you mean 'h2'?
   50 |          h=(h1(x)+i*h2(x))%M;
      |          ^
      |          h2
main.c:51:20: error: 'H' undeclared (first use in this function)
   51 |          if(strcmp(H[h],str)==0)return 1;
      |                    ^
Language: C

#include<stdio.h>
#include<string.h>
#define M 1046537
#define NIL (-1)
#define L 14


 char[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(int i=0;i<strlen(str);i++){
           sum+=p*(getChar(str[i]));
           p*=5;
           }
     return sum;
     }

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

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

 int find(char str[]){
     long long x,i,h;
     x=getKey(str);
     for(i=0;;i++){
         h=(h1(x)+i*h2(x))%M;
         if(strcmp(H[h],str)==0)return 0;
         else if(strlen(H[h])==0)return 0;
         }
     return 0;
     }

 int insert(char str[]){
     long long x.i.h;
     x=getKey(str);
     for(i=0;;i++){
         h=(h1(x)+i*h2(x))%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];
     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:
main.c:8:6: error: expected identifier or '(' before '[' token
    8 |  char[M][L];
      |      ^
main.c:18:31: error: expected identifier or '(' before '{' token
   18 |  long long getKey(char str[]);{
      |                               ^
main.c: In function 'find':
main.c:40:20: error: 'H' undeclared (first use in this function)
   40 |          if(strcmp(H[h],str)==0)return 0;
      |                    ^
main.c:40:20: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'insert':
main.c:47:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   47 |      long long x.i.h;
      |                 ^
main.c:47:17: error: expected expression before '.' token
main.c:48:6: error: 'x' undeclared (first use in this function)
   48 |      x=getKey(str);
      |      ^
main.c:49:10: error: 'i' undeclared (first use in this function)
   49 |      for(i=0;;i++){
      |          ^
main.c:50:10: error: 'h' undeclared (first use in this function); did you mean 'h2'?
   50 |          h=(h1(x)+i*h2(x))%M;
      |          ^
      |          h2
main.c:51:20: error: 'H' undeclared (first use in this function)
   51 |          if(strcmp(H[h],str)==0)return 1;
      |                    ^