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

#include <vector>
#include <iostream>

using namespace std;

int main(){
  int a, flag;
  vector<int> prime_list;
  prime_list.push_back(2);
  # cout << "starting aaa" << endl;
  int size;
  for(int i=3; i<123456; i++){
    flag = 0;
    size = prime_list.size();
    for(int j=0; j<size; j++){
      if((i%prime_list[j]) == 0){
	flag = 1;
	break;
      }
    }
    if (flag == 1){
      prime_list.push_back(i);
    }
  }
  # cout << "ending aaa" << endl;
  int count;
  while (true){
    cin >> a;
    if (a ==0) break;
    count = 0;
    for (int i=0; i< prime_list.size(); i++){
      if(prime_list[i]>=a)
	if (prime_list[i] <2*a)
	  count++;
    }
    cout << count << endl;
  }

  return 0;

}

Compiler output:
a.cc:10:5: error: invalid preprocessing directive #cout
   10 |   # cout << "starting aaa" << endl;
      |     ^~~~
a.cc:25:5: error: invalid preprocessing directive #cout
   25 |   # cout << "ending aaa" << endl;
      |     ^~~~
Language: C++

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

int main(　)
{
	int n, count;
	bool flag;
	while(cin >> n, n){
		count = 0;
		for(int i = n + 1; i <= 2 * n; i++){
			flag = true;
			for(int j = 2; j <= sqrt(i); j ++){
				if(i % j == 0){
					flag = false;
					break;
				}
			}
			if(flag)
				count++;
		}
		cout << count << endl;
	}
	return 0;
}

Compiler output:
a.cc:5:10: error: extended character 　 is not valid in an identifier
    5 | int main(　)
      |          ^
a.cc:5:5: error: cannot declare '::main' to be a global variable
    5 | int main(　)
      |     ^~~~
a.cc:5:10: error: '\U00003000' was not declared in this scope
    5 | int main(　)
      |          ^~
Language: C++

#include <stdio.h>
#include <iostream>

using namespace std;

#define PRIME_MAX 250000	//9,223,372,036,854,775,807までの値に対応

class PrimeNumber
{
private:
	bool ary[PRIME_MAX];	//ary[i]がtrueならiは素数
public:
	//コンストラクタ
	PrimeNumber(){
		for(long long i=0;i<PRIME_MAX;i++){
			ary[i]=1;
		}
		ary[0]=0;ary[1]=0;
		long long m=(long long)sqrt(PRIME_MAX);
		for(long long i=2;i<m;i++)
			if(ary[i])
				for(long long j=(i<<2);j<PRIME_MAX;j+=i)
					if(ary[j])
						ary[j]=0;
	};
	long long count(long long s,long long e){
		long long count=0;
		for(long long i=s;i<=e;i++){
			if(ary[i])count++;
		}
		return count;
	};
	bool get(long long i){
		return ary[i];
	};
};

int main(void){

	while(1){

		long long n;
		PrimeNumber prime;

		cin >>n;
		if(!n)
			break;

		cout<<prime.count(n+1,2*n)<<endl;

	}

	return 0;
}

Compiler output:
a.cc: In constructor 'PrimeNumber::PrimeNumber()':
a.cc:19:40: error: 'sqrt' was not declared in this scope
   19 |                 long long m=(long long)sqrt(PRIME_MAX);
      |                                        ^~~~
Language: Java

public class main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        scanner.useDelimiter(".");
        while (scanner.hasNext()){
            String s = scanner.nextLine(); 
        }
    }

}



Compiler output:
Main.java:1: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class main
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
                              ^
  symbol:   class Scanner
  location: class main
3 errors
Language: Java

public class main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String s = scanner.nextLine(); 
        }
    }

}



Compiler output:
Main.java:1: error: class main is public, should be declared in a file named main.java
public class main {
       ^
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class main
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
                              ^
  symbol:   class Scanner
  location: class main
3 errors
Language: Java

package main;

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            String s = scan.nextLine();
            String[] slist = s.split("");
            StringStack stack = new StringStack(100);
            for (String item : slist) {
                if (item == "(" || item == "[") {
                    stack.push(item);
                } else if (item == ")") {
                    if (stack.pop() != "(") {
                        System.out.println("no");
                        break;
                    }
                } else if (item == "]") {
                    if (stack.pop() != "(") {
                        System.out.println("no");
                        break;
                    }
                }
            }
            System.out.println("yes");
        }
    }
}


Compiler output:
Main.java:10: error: cannot find symbol
            StringStack stack = new StringStack(100);
            ^
  symbol:   class StringStack
  location: class Main
Main.java:10: error: cannot find symbol
            StringStack stack = new StringStack(100);
                                    ^
  symbol:   class StringStack
  location: class Main
2 errors
Language: Java

package main;

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            String s = scan.nextLine();
            String[] slist = s.split("");
            StringStack stack = new StringStack(100);
            for (String item : slist) {
                if (item == "(" || item == "[") {
                    stack.push(item);
                } else if (item == ")") {
                    if (stack.pop() != "(") {
                        System.out.print("no/n");
                        break;
                    }
                } else if (item == "]") {
                    if (stack.pop() != "(") {
                        System.out.print("no/n");
                        break;
                    }
                }
            }
            System.out.print("yes/n");
        }
    }
}


Compiler output:
Main.java:10: error: cannot find symbol
            StringStack stack = new StringStack(100);
            ^
  symbol:   class StringStack
  location: class Main
Main.java:10: error: cannot find symbol
            StringStack stack = new StringStack(100);
                                    ^
  symbol:   class StringStack
  location: class Main
2 errors
Language: Java

import java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()) {
            String s = scan.nextLine();
            String[] slist = s.split("");
            StringStack stack = new StringStack(100);
            for (String item : slist) {
                if (item == "(" || item == "[") {
                    stack.push(item);
                } else if (item == ")") {
                    if (stack.pop() != "(") {
                        System.out.print("no/n");
                        break;
                    }
                } else if (item == "]") {
                    if (stack.pop() != "(") {
                        System.out.print("no/n");
                        break;
                    }
                }
            }
            System.out.print("yes/n");
        }
    }
}

public class StringStack {
    private String[] data;
    private int size;
    private int capacity;

    public StringStack(int capacity) {
        this.data = new String[capacity];
        this.size = 0;
    }

    public void push(String item) {
        size += 1;
        data[size] = item;
    }

    public String peek() {
        return data[size];
    }

    public String pop() {
        size -= 1;
        return data[size + 1];
    }

    public boolean empty() {
        if (size == 0) {
            return true;
        } else {
            return false;
        }
    }

    public int size() {
        return size;
    }

}




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

import java.util.Scanner;

public class BalanceOfWorld {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String str = scanner.nextLine();
            if (str.equals("."))
                break;
            str = str.replaceAll("[a-zA-Z/d /.]", "");
//            System.out.println(str);
            while (true) {
                int count = 0;
                if (str.matches(".*\\[\\].*")) {
                    str = str.replaceAll(".*\\[\\].*", "");
//                    System.out.println(str);
                    count++;
                }
                if (str.matches(".*\\(\\).*")) {
                    str = str.replaceAll(".*\\(\\).*", "");
//                    System.out.println(str);
                    count++;
                }
                if (count == 0)
                    break;
            }
            if (str.length() > 0)
                System.out.println("no");
            else
                System.out.println("yes");
        }
    }
}



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

//package aoj;

import java.util.Scanner;
import java.util.Stack;

public class TheBalanceOfTheWorld {
    public static boolean solve(String sentence) {
        Stack<Character> stk = new Stack<>();
        for (int i = 0; i < sentence.length(); i++) {
            if(sentence.charAt(i) == '[' || sentence.charAt(i) == '(') stk.push(sentence.charAt(i));
            else if(sentence.charAt(i) == ']') {
                if(stk.empty()) return false;
                if(stk.peek() != '[') return false;
                stk.pop();
            }
            else if(sentence.charAt(i) == ')') {
                if(stk.empty()) return false;
                if(stk.peek() != '(') return false;
                stk.pop();
            }
        }
        return stk.empty();
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            String sentence = sc.nextLine();
            System.out.println(solve(sentence) ? "yes" : "no");
        }
    }
}



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

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String input = scanner.nextLine();
            boolean isSmall = checkBracket(input,'(',')');
            boolean isLarge = checkBracket(input,'[',']');
            if (isSmall && isLarge){
                System.out.println("yes");
            }else {
                System.out.println("no");
            }
        }
    }

    private static boolean checkBracket(String input, char left, char right) {
        int countLeft = 0;
        int countRight = 0;

        for (char c : input.toCharArray()) {
            if (c == left) {
                countLeft++;
            }
            if (c == right){
                countRight++;
            }
        }
        if (countLeft == countRight){
            return true;
        }
        return false;

    }

}


Compiler output:
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
                              ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

// AOJ 1173 "世界の天秤" (ICPC国内予選 2011 Problem B)
import java.util.Scanner;
import java.util.Stack;

public class AOJ1173 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        while (true) {
            String s = sc.nextLine(); // 空白も考慮する(Scanner.next()はだめ)
            if (s.equals(".")) {
                break;
            }
            
            Stack<Character> st = new Stack<Character>();
            boolean isBalanced = true;
            for (int i = 0; i < s.length(); i++) {
                char c = s.charAt(i);
                if (c == '(' || c == '[') {
                    st.push(c);
                } else if (c == ')' || c == ']') {
                    if (st.empty()) {
                        isBalanced = false;
                        break;
                    }
                    char tmp = st.pop();
                    // 括弧が対応しているかどうか
                    if (!(c == ')' && tmp == '(') &&
                        !(c == ']' && tmp == '[')) {
                        isBalanced = false;
                        break;
                    }
                }
            }
            if (!st.empty()) {
                isBalanced = false;
            }
            
            if (isBalanced) {
                System.out.println("yes");
            } else {
                System.out.println("no");
            }
        }
    }
}

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

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.util.Stack;

public class Main {
    
    public static void main(String[] args) throws FileNotFoundException {
	// write your code here
        Scanner sc = new Scanner(new File(System.in));
        while(sc.hasNext()){
            String temp = sc.nextLine();
            if(temp.equals(".")) return;
            if(solve(temp)){
                System.out.println("yes");
            }else{
                System.out.println("no");
            }
        }
    }

    static boolean solve(String line){
        int cirNum=0, sqNum=0;
        Stack<Character> balance = new Stack<Character>();
        for(int i=0;i<line.length();i++){
            char temp = line.charAt(i);

            if(temp=='(' || temp=='['){
              balance.push(temp);
            }else if(temp==')'){
                if(balance.isEmpty()) return false;
                if(balance.peek()!='('){
                    return false;
                }else{
                    balance.pop();
                }
            }else if(temp==']'){
                if(balance.isEmpty()) return false;
                if(balance.peek()!='['){
                    return false;
                }else{
                    balance.pop();
                }
            }
        }
        return true;
    }
}

Compiler output:
Main.java:10: error: no suitable constructor found for File(InputStream)
        Scanner sc = new Scanner(new File(System.in));
                                 ^
    constructor File.File(String) is not applicable
      (argument mismatch; InputStream cannot be converted to String)
    constructor File.File(URI) is not applicable
      (argument mismatch; InputStream cannot be converted to URI)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.*;

public class balance{
	public static void Main(String[] args){
		Scanner sc = new Scanner(System.in);
		while(true){
			String s = sc.nextLine();
			boolean flag = true;
			if(s.equals(".")) break;
			Stack<String> stack = new Stack<String>();
			while(true){
				for(int i = 0; i < s.length(); i++){
					if(s.charAt(i) == '['){
						stack.push("[");
					}else if(s.charAt(i) == ']'){
						if(stack.empty()){
							flag = false;
							break;
						}
						String a = stack.pop();
						if(!a.equals("[")){
							flag = false;
							break;
						}
					}else if(s.charAt(i) == '('){
						stack.push("(");
					}else if(s.charAt(i) == ')'){
						if(stack.empty()){
							flag = false;
							break;
						}
						String a = stack.pop();
						if(!a.equals("(")){
							flag = false;
							break;
						}
					}
				}
				if(s.charAt(s.length()-1) == '.' || flag == false) break;
				s = sc.nextLine();
			}
			if(flag) System.out.println("yes");
			else System.out.println("no");
		}
	}
}

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

import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		Stack<Character> s = new  Stack<>();
		while(true){
			String in = sc.nextLine();
			String pr = "yes";
			if(in.charAt(0) == '.') break;
			for(int i = 0; ; i++){
				char c = in.charAt(i);
				if(c == '.') 
					break;
				else if(c == '(' || c =='[') 
					s.push(c);
				else if(c == ')' || c == ']'){
					if(s.empty()) {pr = "no"; break;}
					else if ((c == ')' &&  s.peek() == '(') 
						|| (c == ']' &&  s.peek() == '[')){
						s.pop();
					}else{
						pr = "no"; break;
					}
				else continue;	
				}
			}
			if (!(s.empty())) pr = "no"; 
			System.out.println(pr);
			s.clear();
		}
	}
}

Compiler output:
Main.java:25: error: 'else' without 'if'
				else continue;	
				^
1 error
Language: Java


import java.util.*;
class Main
{

    public static void main(String[] args)
    {

        Scanner sc = new Scanner(System.in);

        while(sc.hasNext())
        {
            int pts[]={0,0};
            String txt =sc.nextLine();
            for(int i=0; i<txt.length(); i++)
            {
                switch(txt.charAt(i))
                {
                    case '(':
                        pts[0]++;
                        break;
                    case ')':
                        pts[0]--;
                        break;
                    case '[':
                        pts[1]++;
                        break;
                    case ']':
                        pts[1]--:
                        break;
                }
                if(pts[0]<0 || pts[1]<0)
                {
                    System.out.println("no");
                }
            }
            if(pts[0]==0 && pts[1]==0)
            {
                System.out.println("yes");
            }
            else
            {
                System.out.println("no");
            }
        }
        sc.close();
    }
}

Compiler output:
Main.java:29: error: ';' expected
                        pts[1]--:
                                ^
1 error
Language: Java


import java.util.*;
class Main
{

    public static void main(String[] args)
    {

        Scanner sc = new Scanner(System.in);

        while(sc.hasNext)
        {
            int pts[]={0,0};
            String txt =sc.nextLine();
            if(txt == null)
            {
                break;
            }
            for(int i=0; i<txt.length(); i++)
            {
                switch(txt.charAt(i))
                {
                    case '(':
                        pts[0]++;
                        break;
                    case ')':
                        pts[0]--;
                        break;
                    case '[':
                        pts[1]++;
                        break;
                    case ']':
                        pts[1]--;
                        break;
                }
                if(pts[0]<0 || pts[1]<0)
                {
                    System.out.println("no");
                }
            }
            if(pts[0]==0 && pts[1]==0)
            {
                System.out.println("yes");
            }
            else
            {
                System.out.println("no");
            }
        }
        sc.close();
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
        while(sc.hasNext)
                ^
  symbol:   variable hasNext
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.Scanner;

public class Balance{
 public static void main(String[] args){
  Scanner sc=new Scanner(System.in);
  String passage;
  int counter1=0,counter2=0;
  do{
  passage=sc.nextLine();
  String[] ch =passage.split("");
  for(int i=0;i<passage.length();i++){
   if(ch[i].equals("[")) counter1++;
   if(ch[i].equals("]")) counter1--;
   if(ch[i].equals("(")) counter2++;
   if(ch[i].equals(")")) counter2--;
  }
  if(counter1==0&&counter2==0)
   System.out.println("yes");
  else
   System.out.println("no");
  }while(!passage.equals("."));

 }
}

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

import java.util.Scanner;

public class Balance{
 public static void main(String[] args){
  Scanner sc=new Scanner(System.in);
  String passage;
  int counter1=0,counter2=0;
  do{
  passage=sc.nextLine();
  String[] ch =passage.split("");
  for(int i=0;i<passage.length();i++){
   if(ch[i].equals("[")) counter1++;
   if(ch[i].equals("]")) counter1--;
   if(ch[i].equals("(")) counter2++;
   if(ch[i].equals(")")) counter2--;
  }
  if(!passage.equals(".")){
  if(counter1==0&&counter2==0)
   System.out.println("yes");
  else
   System.out.println("no");
 }
  }while(!passage.equals("."));

 }
}

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

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

public class Balance{
 public static void main(String[] args){
  Scanner sc=new Scanner(System.in);
  String passage;
  char[] ch;
  Deque<Integer> ad=new ArrayDeque<Integer>();
  do{
  passage = sc.nextLine();
  ad.addFirst(0);

  for(int i=0;i<passage.length();i++){
    if(passage.charAt(i)=='(')
    ad.addFirst(1);
    if(passage.charAt(i)==')'&&ad.getFirst()==1)
    ad.removeFirst();
    if(passage.charAt(i)=='[')
    ad.addLast(2);
    if(passage.charAt(i)==']'&&ad.getLast()==2)
    ad.removeLast();
  }

  if(!passage.equals(".")) {
  if(ad.getFirst()==0&&ad.getLast()==0) System.out.println("yes");
  else System.out.println("no");
  }

  ad.clear();
  }while(!passage.equals("."));

}
}

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

public class Main {
	
	void run() throws NumberFormatException, IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		int count_a = 0;
		int count_b = 0;
		int count_c = 0;
		int count_d = 0;

		String word_line = "";
		String word = "";
		List result = new ArrayList();
		while(true) {
			word_line = br.readLine();
			if (word_line.equals(".")) break; 
			for (int j = 0; j < word_line.length(); j++) {
				word = word_line.substring(j, j + 1);
				if (word.equals("(")) {
					count_a++;
				}
				if (word.equals(")")) {
					count_b++;
				}
				if (word.equals("[")) {
					count_c++;
				}
				if (word.equals("]")) {
					count_d++;
				}
			}
			if (count_a == count_b && count_c == count_d) {
				result.add("yes");
			} else {
				result.add("no");
			}
		}
		for (int i = 0; i < result.size(); i++) {
			String answer = (String) result.get(i);
			System.out.println(answer);
		}
	}

	public static void main(String[] args) throws IOException {
		new Main().run();
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
	void run() throws NumberFormatException, IOException {
	                                         ^
  symbol:   class IOException
  location: class Main
Main.java:45: error: cannot find symbol
	public static void main(String[] args) throws IOException {
	                                              ^
  symbol:   class IOException
  location: class Main
Main.java:5: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                        ^
  symbol:   class BufferedReader
  location: class Main
Main.java:5: error: cannot find symbol
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		                                           ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:14: error: cannot find symbol
		List result = new ArrayList();
		^
  symbol:   class List
  location: class Main
Main.java:14: error: cannot find symbol
		List result = new ArrayList();
		                  ^
  symbol:   class ArrayList
  location: class Main
7 errors
Language: Java

class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        String[] strings = {"([", ")]"};
        while (true) {
            String input = scan.nextLine();
            ArrayList<Integer> list = new ArrayList<Integer>();
            if (input.equals(".")) {
                break;
            }
            boolean flag = true;
            for (int i = 0; i < input.length(); i++) {
                for (int j = 0; j < strings[0].length(); j++) {
                    if (input.charAt(i) == strings[0].charAt(j)) {
                        list.add(j);
                        // System.out.println("[add]i="+i+":j="+j+":size="+list.size());
                    } else if (input.charAt(i) == strings[1].charAt(j)) {
                        // System.out.println("[deleat]i="+i+":j="+j+":size="+list.size());
                        try {
                            if (list.get(list.size() - 1) == j) {
                                list.remove(list.size() - 1);
                            } else {
                                i = input.length();
                                flag = false;
                                break;
                            }
                        } catch (Exception e) {
                            flag = false;
                            break;
                        }

                    }
                }
            }
            if (flag) {
                System.out.println("yes");
            } else {
                System.out.println("no");
            }
        }
    }
}


Compiler output:
Main.java:3: error: cannot find symbol
        Scanner scan = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner scan = new Scanner(System.in);
                           ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
            ArrayList<Integer> list = new ArrayList<Integer>();
            ^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
            ArrayList<Integer> list = new ArrayList<Integer>();
                                          ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: Java

public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        String[] strings = {"([", ")]"};
        while (true) {
            String input = scan.nextLine();
            ArrayList<Integer> list = new ArrayList<Integer>();
            if (input.equals(".")) {
                break;
            }
            boolean flag = true;
            for (int i = 0; i < input.length(); i++) {
                for (int j = 0; j < strings[0].length(); j++) {
                    if (input.charAt(i) == strings[0].charAt(j)) {
                        list.add(j);
                        // System.out.println("[add]i="+i+":j="+j+":size="+list.size());
                    } else if (input.charAt(i) == strings[1].charAt(j)) {
                        // System.out.println("[deleat]i="+i+":j="+j+":size="+list.size());
                        try {
                            if (list.get(list.size() - 1) == j) {
                                list.remove(list.size() - 1);
                            } else {
                                i = input.length();
                                flag = false;
                                break;
                            }
                        } catch (Exception e) {
                            flag = false;
                            break;
                        }

                    }
                }
            }
            if (flag) {
                System.out.println("yes");
            } else {
                System.out.println("no");
            }
        }
    }
}


Compiler output:
Main.java:3: error: cannot find symbol
        Scanner scan = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner scan = new Scanner(System.in);
                           ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
            ArrayList<Integer> list = new ArrayList<Integer>();
            ^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
            ArrayList<Integer> list = new ArrayList<Integer>();
                                          ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: Java

public class Main {
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
			while(sc.hasNextLine()) {
				String str=sc.nextLine();
				if(str.equals(".")) break;
				Stack<Character>  stack=new Stack<Character>();
				boolean tf=true;
				for(int i=0; i<str.length(); i++) {
					char s=str.charAt(i);
					if(s=='.') {
						break;
					}
					if(s=='(') {
						stack.push(')');
					}
					if(s=='[') {
						stack.push(']');
					}
					if(s==')'|| s==']') {
						if(stack.isEmpty() || stack.pop()==s) {
							tf=false;
							break;
						}
					}
				}
				if(tf)	System.out.println("yes");
				else	System.out.println("no");

			}
			

		}
	}
}


Compiler output:
Main.java:3: error: cannot find symbol
		try(Scanner sc = new Scanner(System.in)){
		    ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		try(Scanner sc = new Scanner(System.in)){
		                     ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
				Stack<Character>  stack=new Stack<Character>();
				^
  symbol:   class Stack
  location: class Main
Main.java:7: error: cannot find symbol
				Stack<Character>  stack=new Stack<Character>();
				                            ^
  symbol:   class Stack
  location: class Main
4 errors
Language: Java

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.File;
import java.io.PrintStream;

public class B {

	public static void main(String[] args) throws IOException {
		/**
		  try {
			System.setOut(new PrintStream(new File("result_b2.txt")));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		*/
		
		InputStreamReader reader = new InputStreamReader(System.in);
		int key,i,a[],flag;
		a=new int[100];
		key='.';
		key=reader.read();
		while(true){  //while outside
			//System.out.print((char)key+"-");
			//System.out.print("***");
			i=0;
			a[i]=0;
			
			if(key=='.')
				break;
			while(true){	//while inside
				if(key=='['||key=='('){
					i++;
					a[i]=key;
				}
				else if(key==']'){
					if(a[i]!='['){
						while(key!='.'){
							key=reader.read();
						}
						System.out.println("no");
						break;
					}
					i--;
				}
				else if(key==')'){
					if(a[i]!='('){
						while(key!='.'){
							key=reader.read();
						}
						System.out.println("no");
						break;
					}
					i--;
				}	

				key=reader.read();
				if(key=='.'){
					if(i==0){
						System.out.println("yes");
						break;
					}
					else{
						System.out.println("no");
						break;
					}
				}
			} //while(true) inside
			
			while(key!='\n'){
				key=reader.read();
			}
			//System.out.print((char)key);
			//if(key=='\n'){
			key=reader.read();
			//}
			//key=reader.read();
			
		} //while outside
	} //main
} //class

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


package _1173;

import java.util.*;
import java.lang.*;
import java.math.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	
	String trim(String tar){
		String ret = "";
		for(char ch:tar.toCharArray){
			if("()[]".indexOf(ch) >=0){
				ret += "()[]".indexOf(ch);
			}
		}
		return ret;
	}
	void run() {
		for (;;) {
			String buffer = sc.nextLine();
			if (buffer.equals(".")) {
				break;
			}
			buffer = trim(buffer);
			
			for(int i =0 ;i < 50;i++){
				buffer = buffer.replace("01","");
				buffer = buffer.replace("23","");
			}
			boolean ok = buffer.length ==0;
			System.out.println(ok?"yes":"no");
		}
	}

	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}
}

Compiler output:
Main.java:13: error: cannot find symbol
		for(char ch:tar.toCharArray){
		               ^
  symbol:   variable toCharArray
  location: variable tar of type String
Main.java:32: error: cannot find symbol
			boolean ok = buffer.length ==0;
			                   ^
  symbol:   variable length
  location: variable buffer of type String
2 errors
Language: Java

package _1173;

import java.util.*;
import java.lang.*;
import java.math.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	
	String trim(String tar){
		String ret = "";
		for(char ch:tar.toCharArray()){
			if("()[]".indexOf(ch) >=0){
				ret += "()[]".indexOf(ch);
			}
		}
		return ret;
	}
	void run() {
		for (;;) {
			String buffer = sc.nextLine();
			if (buffer.equals(".")) {
				break;
			}
			buffer = trim(buffer);
			
			for(int i =0 ;i < 50;i++){
				buffer = buffer.replace("01","");
				buffer = buffer.replace("23","");
			}
			boolean ok = buffer.length ==0;
			System.out.println(ok?"yes":"no");
		}
	}

	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}
}

Compiler output:
Main.java:31: error: cannot find symbol
			boolean ok = buffer.length ==0;
			                   ^
  symbol:   variable length
  location: variable buffer of type String
1 error
Language: Java

class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);for(;;){String t,r;t=sc.nextLine();if(t.equals("."))break;r="";for(char c:t.toCharArray())if("()[]".indexOf(c)<0)r+=(c+8);for(int i=0;i<50;i++)r=r.replace("01","").replace("ce","");System.out.println(r.equals("")?"no":"yes");}}}

Compiler output:
Main.java:1: error: cannot find symbol
class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);for(;;){String t,r;t=sc.nextLine();if(t.equals("."))break;r="";for(char c:t.toCharArray())if("()[]".indexOf(c)<0)r+=(c+8);for(int i=0;i<50;i++)r=r.replace("01","").replace("ce","");System.out.println(r.equals("")?"no":"yes");}}}
                                              ^
  symbol:   class Scanner
  location: class Main
Main.java:1: error: cannot find symbol
class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);for(;;){String t,r;t=sc.nextLine();if(t.equals("."))break;r="";for(char c:t.toCharArray())if("()[]".indexOf(c)<0)r+=(c+8);for(int i=0;i<50;i++)r=r.replace("01","").replace("ce","");System.out.println(r.equals("")?"no":"yes");}}}
                                                            ^
  symbol:   class Scanner
  location: class Main
Main.java:1: error: cannot find symbol
class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);for(;;){String t,r;t=sc.nextLine();if(t.equals("."))break;r="";for(char c:t.toCharArray())if("()[]".indexOf(c)<0)r+=(c+8);for(int i=0;i<50;i++)r=r.replace("01","").replace("ce","");System.out.println(r.equals("")?"no":"yes");}}}
                                                                                                    ^
  symbol:   variable sc
  location: class Main
3 errors
Language: Java

import java.util.*;class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);for(;;){String t,r;t=sc.nextLine();if(t.equals("."))break;r="";for(char c:t.toCharArray())if("()[]".indexOf(c)<0)r+=(c+8);for(int i=0;i<50;i++)r=r.replace("01","").replace("ce","");System.out.println(r.equals("")?"no":"yes");}}}

Compiler output:
Main.java:1: error: cannot find symbol
import java.util.*;class Main{public static void main(String[]a){Scanner s=new Scanner(System.in);for(;;){String t,r;t=sc.nextLine();if(t.equals("."))break;r="";for(char c:t.toCharArray())if("()[]".indexOf(c)<0)r+=(c+8);for(int i=0;i<50;i++)r=r.replace("01","").replace("ce","");System.out.println(r.equals("")?"no":"yes");}}}
                                                                                                                       ^
  symbol:   variable sc
  location: class Main
1 error
Language: Java

import java.util.*;class Main{public static void main(String[]a){int i;Scanner s=new Scanner(System.in);for(;;){String t,r;t=s.nextLine();if(t.equals("."))break;r="";for(char c:t.toCharArray()){i="()[]".indexOf(c);if(i>=0)r+=i;}for(;i<99;i++)r=r.replace("01","").replace("23","");System.out.println(r.equals("")?"no":"yes");}}}

Compiler output:
Main.java:1: error: variable i might not have been initialized
import java.util.*;class Main{public static void main(String[]a){int i;Scanner s=new Scanner(System.in);for(;;){String t,r;t=s.nextLine();if(t.equals("."))break;r="";for(char c:t.toCharArray()){i="()[]".indexOf(c);if(i>=0)r+=i;}for(;i<99;i++)r=r.replace("01","").replace("23","");System.out.println(r.equals("")?"no":"yes");}}}
                                                                                                                                                                                                                                         ^
1 error
Language: Java

import java.util.LinkedList;
import java.util.Scanner;

public class main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		LinkedList<Character> q = new LinkedList<Character>();
		String input = "";
		while (!(input = scanner.nextLine()).equals(".")) {
			boolean procFlag = false;
			char[] ch = input.toCharArray();
			int i = 0;
			while (i < ch.length) {
				char c = ch[i];
				switch (c) {
				case '(':
				case '[':
					procFlag = true;
					q.push(c);
					break;
				case ')':
					if (q.peek() == '(') {
						q.pop();
					} else {

					}
					break;
				case ']':
					if (q.peek() == '[') {
						q.pop();
					} else {

					}
				default:
					break;
				}
				i++;
			}
			if (q.isEmpty() && procFlag || !procFlag) {
				System.out.println("yes");
			} else {
				System.out.println("no");
			}
		}
	}
}

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

import java.util.LinkedList;
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		LinkedList<Character> q = new LinkedList<Character>();
		String input = "";
		while (!(input = scanner.nextLine()).equals(".")) {
			boolean procFlag = false;
			char[] ch = input.toCharArray();
			int i = 0;
			while (i < ch.length) {
				char c = ch[i];
				switch (c) {
				case '(':
				case '[':
					procFlag = true;
					q.push(c);
					break;
				case ')':
					if (q.peek() == '(') {
						q.pop();
					} else {

					}F
					break;
				case ']':
					if (q.peek() == '[') {
						q.pop();
					} else {

					}
				default:
					break;
				}
				i++;
			}
			if (q.isEmpty() && procFlag || !procFlag) {
				System.out.println("yes");
			} else {
				System.out.println("no");
			}
		}
	}
}

Compiler output:
Main.java:30: error: not a statement
					}F
					 ^
Main.java:30: error: ';' expected
					}F
					  ^
2 errors
Language: Java

public class TheBalanceoftheWorld{
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args){
        String line;
        int number_round, number_square, p;
        char[] sentence;
        outer:
        while(!(line = sc.nextLine()).equals(".")){
            char[] check_stack = new char[200];
            number_round = 0;
            number_square = 0;
            p = 1;
            sentence = line.toCharArray();
            for(char tmp: sentence){
                if(tmp == '('){
                    check_stack[p++] = '(';
                    number_round++;
                }
                else if(tmp == ')'){
                    if(check_stack[--p] != '('){
                        System.out.println("no");
                        continue outer;
                    }
                    number_round--;
                }
                else if(tmp == '['){
                    check_stack[p++] = '[';
                    number_square++;
                }
                else if(tmp == ']'){
                    if(check_stack[--p] != '['){
                        System.out.println("no");
                        continue outer;
                    }
                    number_square--;
                }
                if(number_round < 0 || number_square < 0){
                    System.out.println("no");
                    continue outer;
                }
            }
            if(number_round == 0 || number_square == 0) System.out.println("yes");
            else System.out.println("no");
        }
    }
}

Compiler output:
Main.java:1: error: class TheBalanceoftheWorld is public, should be declared in a file named TheBalanceoftheWorld.java
public class TheBalanceoftheWorld{
       ^
Main.java:2: error: cannot find symbol
    static Scanner sc = new Scanner(System.in);
           ^
  symbol:   class Scanner
  location: class TheBalanceoftheWorld
Main.java:2: error: cannot find symbol
    static Scanner sc = new Scanner(System.in);
                            ^
  symbol:   class Scanner
  location: class TheBalanceoftheWorld
3 errors
Language: Java

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


class Ballance {
    public String line;

    public Ballance(String str){
        line = str;
    }

    public void init(){
        String res = "";

        for(int i=0; i<line.length(); i++){
            char ch = line.charAt(i);
            if (ch == '(' || ch == '[' || ch == ')' || ch  == ']'){
                res += String.valueOf(ch);
            }
        }
        this.line = res;
    }

    public boolean check(int index){
        boolean ret = false;

        if(line.length() == 0){
            return true;
        }else if (line.charAt(index) == ')' || line.charAt(index) == ']'){
            ret = false;
        }else if (line.charAt(index) == '(' && line.charAt(index+1) == ')'
            || line.charAt(index) == '[' && line.charAt(index+1) == ']'){
            ret = true;
        }else if (line.charAt(index) == '(' && line.charAt(index+1) == ']'
            || line.charAt(index) == '[' && line.charAt(index+1) == ')'){
            ret = false;
        }else if(line.charAt(index+1) == '(' || line.charAt(index+1) == '['){
            ret = check(index+1);
        }

        if(ret){
            if(index+1 <= this.line.length()){
                ret = true;
            }else if(index+2 < this.line.length()){
                ret = check(index+2);
            }
        }else{
            ret = false;
        }

        return ret;
    }
}

public class TheBallance{

    public static void main(String[] args){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String str = ".";
            try{
                str = br.readLine();
            }catch(IOException e){ }

            if(str.length() == 1 && str.charAt(0) == '.'){
                break;
            }

            Ballance ball = new Ballance(str);
            ball.init();

            int len = ball.line.length();
            if(len == 1){
                System.out.println("no");
                break;
            }else if(len == 0){
                System.out.println("yes");
                break;
            }

            if(ball.check(0)){
                System.out.println("yes");
            }else{
                System.out.println("no");
            }

        }

    }

}

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

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

public class Main {

    private class Ballance {
        public String line;

        public Ballance(String str){
            line = str;
        }

        public void init(){
            String res = "";

            for(int i=0; i<line.length(); i++){
                char ch = line.charAt(i);
                if (ch == '(' || ch == '[' || ch == ')' || ch  == ']'){
                    res += String.valueOf(ch);
                }
            }
            line = res;
        }

        public boolean check(int index){
            boolean ret = false;

            if(line.length() == 0){
                return true;
            }else if (line.charAt(index) == ')' || line.charAt(index) == ']'){
                ret = false;
            }else if (line.charAt(index) == '(' && line.charAt(index+1) == ')'
                    || line.charAt(index) == '[' && line.charAt(index+1) == ']'){
                ret = true;
            }else if (line.charAt(index) == '(' && line.charAt(index+1) == ']'
                    || line.charAt(index) == '[' && line.charAt(index+1) == ')'){
                ret = false;
            }else if(line.charAt(index+1) == '(' || line.charAt(index+1) == '['){
                ret = check(index+1);
            }

            if(ret){
                if(index+1 <= line.length()){
                    ret = true;
                }else if(index+2 < line.length()){
                    ret = check(index+2);
                }
            }else{
                ret = false;
            }

            return ret;
        }
    }

    public static void main(String[] args){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        while(true){
            String str = ".";
            try{
                str = br.readLine();
            }catch(IOException e){ }

            if(str.length() == 1 && str.charAt(0) == '.'){
                break;
            }

            Ballance ball = new this.Ballance(str);
            ball.init();

            int len = ball.line.length();
            if(len == 1){
                System.out.println("no");
                break;
            }else if(len == 0){
                System.out.println("yes");
                break;
            }

            if(ball.check(0)){
                System.out.println("yes");
            }else{
                System.out.println("no");
            }

        }

    }

}

Compiler output:
Main.java:69: error: as of release 8, 'this' is allowed as the parameter name for the receiver type only
            Ballance ball = new this.Ballance(str);
                                ^
  which has to be the first parameter, and cannot be a lambda parameter
1 error