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

#include <iostream>

using namespace std;

void BSearch(int A[] ,unsigned int sp ,unsigned int ep ,int n){ //あり、なしのみboolで返す
  int mid = (ep-sp) / 2;
  if(mid == n)
    return 1;
  if(sp > ep)
    return 0;
  else if(n < mid)
    return BSearch(A ,sp ,mid-1 ,n);
  else
    return BSearch(A ,mid+1 ,ep ,n);
}

int main(void){
  int n,q;
  int counter = 0;
  int S[100000];
  int T[50000];
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> S[i];
  }
  cin >> q;
  for(int i=0;i<q;i++){
    cin >> T[i];
  }
  for(int i=0;i<n;i++){
    if(BSerach(T,0,q,S[i]) && A[i] != A[i-1])
      counter++;
  }
  cout << counter << endl;
}



Compiler output:
a.cc: In function 'void BSearch(int*, unsigned int, unsigned int, int)':
a.cc:8:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
    8 |     return 1;
      |            ^
a.cc:10:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   10 |     return 0;
      |            ^
a.cc: In function 'int main()':
a.cc:31:8: error: 'BSerach' was not declared in this scope; did you mean 'BSearch'?
   31 |     if(BSerach(T,0,q,S[i]) && A[i] != A[i-1])
      |        ^~~~~~~
      |        BSearch
a.cc:31:31: error: 'A' was not declared in this scope
   31 |     if(BSerach(T,0,q,S[i]) && A[i] != A[i-1])
      |                               ^
Language: C++

#include <iostream>

using namespace std;

void BSearch(int A[] ,unsigned int sp ,unsigned int ep ,int n){ //あり、なしのみboolで返す
  int mid = (ep-sp) / 2;
  if(mid == n)
    return 1;
  if(sp > ep)
    return 0;
  else if(n < mid)
    return BSearch(A ,sp ,mid-1 ,n);
  else
    return BSearch(A ,mid+1 ,ep ,n);
}

int main(void){
  int n,q;
  int counter = 0;
  int S[1000000000];
  int T[1000000000];
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> S[i];
  }
  cin >> q;
  for(int i=0;i<q;i++){
    cin >> T[i];
  }
  for(int i=0;i<n;i++){
    if(BSerach(T,0,q,S[i]) && A[i] != A[i-1])
      counter++;
  }
  cout << counter << endl;
}



Compiler output:
a.cc: In function 'void BSearch(int*, unsigned int, unsigned int, int)':
a.cc:8:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
    8 |     return 1;
      |            ^
a.cc:10:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   10 |     return 0;
      |            ^
a.cc: In function 'int main()':
a.cc:31:8: error: 'BSerach' was not declared in this scope; did you mean 'BSearch'?
   31 |     if(BSerach(T,0,q,S[i]) && A[i] != A[i-1])
      |        ^~~~~~~
      |        BSearch
a.cc:31:31: error: 'A' was not declared in this scope
   31 |     if(BSerach(T,0,q,S[i]) && A[i] != A[i-1])
      |                               ^
Language: C++

#include <iostream>

using namespace std;

bool BSearch(int A[] ,unsigned int sp ,unsigned int ep ,int n){ //あり、なしのみboolで返す
  int mid = (ep-sp) / 2;
  int l = sp;
  int r = ep;
  while(l <= r){
    mid = (l + r) / 2;
    if(A[mid] == n){
      return 1;
    }
    else if(array[mid] < value){
      left = mid + 1;
    }
    else{
      right = mid - 1;
    }
  }
  return 0;
}

int main(void){
  int n,q;
  int counter = 0;
  int S[100000];
  int T[50000];
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> S[i];
  }
  cin >> q;
  for(int i=0;i<q;i++){
    cin >> T[i];
  }
  for(int i=0;i<n;i++){
    if(BSearch(T,0,q,S[i]) && S[i] != S[i-1])
      counter++;
  }
  cout << counter << endl;
}



Compiler output:
a.cc: In function 'bool BSearch(int*, unsigned int, unsigned int, int)':
a.cc:14:18: error: expected unqualified-id before '[' token
   14 |     else if(array[mid] < value){
      |                  ^
a.cc:15:12: error: assignment of function 'std::ios_base& std::left(ios_base&)'
   15 |       left = mid + 1;
      |       ~~~~~^~~~~~~~~
a.cc:18:13: error: assignment of function 'std::ios_base& std::right(ios_base&)'
   18 |       right = mid - 1;
      |       ~~~~~~^~~~~~~~~
Language: C++

#include <stdio.h>
 
int BSearch(int A[] ,unsigned int sp ,unsigned int ep ,int n){ //あり、なしのみboolで返す
  int mid = (ep+sp) / 2;
  int l = sp;
  int r = ep;
  while(l <= r){
    mid = (l + r) / 2;
    if(A[mid] == n){
      return 1;
    }
    else if(A[mid] < n){
      l = mid + 1;
    }
    else{
      r = mid - 1;
    }
  }
  return 0;
}
 
int main(void){
  int n,q;
  int counter = 0;
  int S[100000];
  int T[50000];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(int i=0;i<q;i++){
    scanf("%d",&Ti]);
  }
 
 
  for(int i=0;i<q;i++){
    if(BSearch(S,0,n,T[i]))
      counter++;
  }
  printf("counter\n");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:17: error: 'Ti' was not declared in this scope; did you mean 'i'?
   33 |     scanf("%d",&Ti]);
      |                 ^~
      |                 i
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>

int main(void){
    int n,q;
    std::vector<int> S;
    int T;
    int cnt=0;
    scanf(%d,&n);
    for(int i=0;i<n;i++) scanf(%d,&S[i]);
    
    std::cin>>q;
     while(q--){
        std::cin>>T;
        if(std::binary_search(S.begin(),S.end(),T)) cnt++;
    }
    std::cout<<cnt<<std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: expected primary-expression before '%' token
   11 |     scanf(%d,&n);
      |           ^
a.cc:11:12: error: 'd' was not declared in this scope
   11 |     scanf(%d,&n);
      |            ^
a.cc:12:32: error: expected primary-expression before '%' token
   12 |     for(int i=0;i<n;i++) scanf(%d,&S[i]);
      |                                ^
Language: C++

#include<iostream>
#include"heapSort.h"

#define N_MAX 100001
#define Q_MAX 50000
int count = 0;
int n,q;
int s_array[N_MAX],t_array[Q_MAX];
void down_heap(int array[],int,int);

void printArray(int array[],int n){
    for(int i=1;i<=n;i++){
        std::cout << array[i] << ' ';
    }
    std::cout << '\n';
}

void sort(int array[],int n){
    int length = n;
    for(int i=length/2;i>0;i--){
        down_heap(array,length,i);
    }
    while(length != 1){
        array[0] = array[1];
        array[1] = array[length];
        array[length] = array[0];
        length--;
        for(int i=length/2;i>0;i--){
            down_heap(array,length,i);
        }
    }
}


void down_heap(int array[],int length,int k){
    int child;
    
    while(k <= length/2){
            
        child = 2*k;
        if(child+1 <= length && array[child]<array[child+1]){
            child += 1;
        }
        
        if(array[k] < array[child]){
            array[0] = array[k];
            array[k] = array[child];
            array[child] = array[0];
            k = child;
            
        }else{
            break;
        }
        
    }
}
void search(int k,int left,int right){
    int center = (left+right)/2;
    if(s_array[center] == k){
        count += 1;
        return;
    }else if(left == right){
        //std::cout << "見つからない\n";
        return;
    }else if(s_array[center] < k){
        search(k,center+1,right);
        return;
    }else if(s_array[center] > k){
        search(k,left,center-1);
        return;
    }
}
    

int main(){
    
    std::cin >> n;
    for(int i=1;i<=n;i++){
        std::cin >> s_array[i];
    }
    //printArray(s_array,n);
    
    sort(s_array,n);
    
    //printArray(s_array,n);
    
    std::cin >> q;
    for(int i=0;i<q;i++){
        std::cin >> t_array[i];
        search(t_array[i],1,n);
    }
    
    std::cout << count << '\n';
    
    return 0;
}



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

int BinarySearch(int x, int S[], int N){
  int B = 0;
  int T = N-1;

  while(B<=T){
    int mid = (B+T)/2;
    int count=0;

    if(S[mid]==x){
      count++;
      return count;
    }
    else if(S[mid]<x){
      B = mid+1;
    }
    else{
      T = mid-1;
    }
  }

  return -1;
}
int main(){
  int a;
  cin >> a;
  int A[a];
  for(int i=0; i<a; i++){
    cin >> A[i];
  }

  int b;
  cin >> b;
  int B[b];
  for(int i=0; i<b; i++){
    cin >> B[i];
  }

  int cnt=0;
  for(int j=0; j<b; j++){
    int x = BinarySearch(B[j], A, a);
    if(x==1)
      cnt++;
  }
  cout << cnt << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:3: error: 'cin' was not declared in this scope
   25 |   cin >> a;
      |   ^~~
a.cc:44:3: error: 'cout' was not declared in this scope
   44 |   cout << cnt << endl;
      |   ^~~~
a.cc:44:18: error: 'endl' was not declared in this scope
   44 |   cout << cnt << endl;
      |                  ^~~~
Language: C++

int BinarySearch(int x, int S[], int N){
  int B = 0;
  int T = N-1;

  while(B<=T){
    int mid = (B+T)/2;
    int count=0;

    if(S[mid]==x){
      count++;
      return count;
    }
    else if(S[mid]<x){
      B = mid+1;
    }
    else{
      T = mid-1;
    }
  }

  return -1;
}
int main(){
  int a;
  cin >> a;
  int A[a];
  for(int i=0; i<a; i++){
    cin >> A[i];
  }

  int b;
  cin >> b;
  int B[b];
  for(int i=0; i<b; i++){
    cin >> B[i];
  }

  int cnt=0;
  for(int j=0; j<b; j++){
    int x = BinarySearch(B[j], A, a);
    if(x==1)
      cnt++;
  }
  cout << cnt << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:3: error: 'cin' was not declared in this scope
   25 |   cin >> a;
      |   ^~~
a.cc:44:3: error: 'cout' was not declared in this scope
   44 |   cout << cnt << endl;
      |   ^~~~
a.cc:44:18: error: 'endl' was not declared in this scope
   44 |   cout << cnt << endl;
      |                  ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	vector<int> s(100000);
	vector<int> t(50000);
	int n,q,cnt=0;
	for(int i=0;i<n;i++){
		cin>>s[i];
	}
	sort(s.begin(),s.end());
	cin>>q;
	for(int j=0 j<q;j++){
		cin>>t[j];
	}
	for(int k=0;k<q;k++){
		if(binary_search(s.begin(),s.end(),t[k])){
			cnt++;
		}
	}
	cout<<cnt<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:20: error: expected ';' before 'j'
   14 |         for(int j=0 j<q;j++){
      |                    ^~
      |                    ;
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	vector<int> s(100000);
	vector<int> t(50000);
	int n,q,cnt=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>s[i];
	}
	sort(s.begin(),s.end());
	cin>>q;
	for(int j=0 j<q;j++){
		cin>>t[j];
	}
	for(int k=0;k<q;k++){
		if(binary_search(s.begin(),s.end(),t[k])){
			cnt++;
		}
	}
	cout<<cnt<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: expected ';' before 'j'
   15 |         for(int j=0 j<q;j++){
      |                    ^~
      |                    ;
Language: C++

#include<iostream>
#include<math.h>
using namespace std;

int main(void){
	int n, q, num, plus, a=0, sum;
	long S[10001], T[10001];
	
	/* input */
	
	std::cin >> n;
	for(int i=0; i<n; i++){
		std::cin >> S[i];
	}
	
	std::cin >> q;
	for(int i=0; i<q; i++){
		std::cin >> T[i];
	}
	
	/* calc */
	
	int i=1;
	
	for(int t=0; t<q; t++){
		plus = (int)(math.ceil(n/4));
		num = (int)(math.ceil(n/2));
		
		while(i=0){
			
			/* except same_number */
			a = 0;
			for(int k=0; k<i; k++){
				if(S[i] == S[k]){
					a = 1;
				}
			}
			if(a >= 1){
				break;
			}
			
			if(T[t] == S[num]){
				a += 1;
				break;
			}else if(T[t] != S[num]){
				
				if(T[t] > S[num]){
					num = num + plus;
					plus = (int)(math.ceil(plus/2));
				}else if(T[t] < S[num]){
					num = num - plus;
					plus = (int)(math.ceil(plus/2));
				}
			}
			
			if(plus == 0){
				break;
			}
		}
	}
	
	/* output */
	cout << num << "\n";
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:30: error: 'math' was not declared in this scope
   26 |                 plus = (int)(math.ceil(n/4));
      |                              ^~~~
Language: C++

#include<iostream>
#include<math.h>
using namespace std;

int main(void){
	int n, q, sum=0;
	long S[10001], T[10001];
	
	/* input */
	
	std::cin >> n;
	for(int i=0; i<n; i++){
		std::cin >> S[i];
	}
	
	std::cin >> q;
	for(int i=0; i<q; i++){
		std::cin >> T[i];
		if( lower_bound(S, S + n, T[i]) sum++;
		}
	}
	
	cout << sum << "\n";
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:48: error: expected ';' before 'sum'
   19 |                 if( lower_bound(S, S + n, T[i]) sum++;
      |                                                ^~~~
      |                                                ;
a.cc:19:32: warning: ignoring return value of '_ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = long int*; _Tp = long int]', declared with attribute 'nodiscard' [-Wunused-result]
   19 |                 if( lower_bound(S, S + n, T[i]) sum++;
      |                     ~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:1530:5: note: declared here
 1530 |     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
a.cc:20:17: error: expected primary-expression before '}' token
   20 |                 }
      |                 ^
a.cc:19:55: error: expected ')' before '}' token
   19 |                 if( lower_bound(S, S + n, T[i]) sum++;
      |                   ~                                   ^
      |                                                       )
   20 |                 }
      |                 ~                                      
a.cc:20:17: error: expected primary-expression before '}' token
   20 |                 }
      |                 ^
a.cc: At global scope:
a.cc:23:9: error: 'cout' does not name a type
   23 |         cout << sum << "\n";
      |         ^~~~
a.cc:25:9: error: expected unqualified-id before 'return'
   25 |         return 0;
      |         ^~~~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;

int main(void){
	int n, q, sum=0;
	long S[10001], T[10001];
	
	/* input */
	
	std::cin >> n;
	for(int i=0; i<n; i++){
		std::cin >> S[i];
	}
	
	std::cin >> q;
	for(int i=0; i<q; i++){
		std::cin >> T[i];
		if( lower_bound(S, S + n, T[i]) sum++;
		}
	}
	
	cout << sum << "\n";
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:48: error: expected ';' before 'sum'
   20 |                 if( lower_bound(S, S + n, T[i]) sum++;
      |                                                ^~~~
      |                                                ;
a.cc:20:32: warning: ignoring return value of '_ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = long int*; _Tp = long int]', declared with attribute 'nodiscard' [-Wunused-result]
   20 |                 if( lower_bound(S, S + n, T[i]) sum++;
      |                     ~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:1530:5: note: declared here
 1530 |     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
a.cc:21:17: error: expected primary-expression before '}' token
   21 |                 }
      |                 ^
a.cc:20:55: error: expected ')' before '}' token
   20 |                 if( lower_bound(S, S + n, T[i]) sum++;
      |                   ~                                   ^
      |                                                       )
   21 |                 }
      |                 ~                                      
a.cc:21:17: error: expected primary-expression before '}' token
   21 |                 }
      |                 ^
a.cc: At global scope:
a.cc:24:9: error: 'cout' does not name a type
   24 |         cout << sum << "\n";
      |         ^~~~
a.cc:26:9: error: expected unqualified-id before 'return'
   26 |         return 0;
      |         ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;

int main(void){
	int n, q, sum=0;
	long S[10001], T[10001];
	
	/* input */
	
	std::cin >> n;
	for(int i=0; i<n; i++){
		std::cin >> S[i];
	}
	
	std::cin >> q;
	for(int i=0; i<q; i++){
		std::cin >> T[i];
		if( lower_bound(S, S+n, T[i]) == T[i]){
			sum++;
		}
	}
	
	cout << sum << "\n";
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:47: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |                 if( lower_bound(S, S+n, T[i]) == T[i]){
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Language: C++

#include <iostream> #include <vector> void binary(int n, std::vector<int> s, int q, std::vector<int> t) { int count = 0; int left; int right; int mid; for (int i = 0; i < q; i++) { left = 0; right = n; while (left < right) { mid = (left + right) / 2; if (t[i] == s[mid]) { count++; break; } else if (t[i] < s[mid]) { right = mid; } else { left = mid + 1; } } } std::cout << count << std::endl; return; } int main(void) { int n; std::cin >> n; std::vector<int> s(n, 0); for (int i = 0; i < n; i++) { std::cin >> s[i]; } int q; std::cin >> q; std::vector<int> t(q, 0); for (int i = 0; i < q; i++) { std::cin >> t[i]; } binary(n, s, q, t); return 0; } 


Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include <iostream> #include <vector> void binary(int n, std::vector<int> s, int q, std::vector<int> t) { int count = 0; int left; int right; int mid; for (int i = 0; i < q; i++) { left = 0; right = n; while (left < right) { mid = (left + right) / 2; if (t[i] == s[mid]) { count++; break; } else if (t[i] < s[mid]) { right = mid; } else { left = mid + 1; } } } std::cout << count << std::endl; return; } int main(void) { int n; std::cin >> n; std::vector<int> s(n, 0); for (int i = 0; i < n; i++) { std::cin >> s[i]; } int q; std::cin >> q; std::vector<int> t(q, 0); for (int i = 0; i < q; i++) { std::cin >> t[i]; } binary(n, s, q, t); return 0; }
      |                     ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
 using namespace std;
  int main(){
   int n,q;
  	cin >> n;
    int S[n];
     for(int i = 0; i<n; i++){
      cin >> S[i];
      } 
      cin >> q;
       int T[q];
        for(int i = 0; i<q; i++){
         cin >> T[i];
          } //Source??¨???????????????????????????????????????
           int answer = 0;
            int left = 0, right = n;
             for (size_t j = 0; j < q; j++) {
              int left = 0, right = n;
               int key = T[j];
                while(left < right){
                 int mid = (left+right)/2;
                  if(S[mid] == key){
                   answer++;
                    // cout << j << "???????????¢?´¢?????????" << endl;
                     // cout << answer << endl; break;
                  } else{
                  	if(S[mid] < key){
                        left = mid+1;
                         // cout << "left " << left << endl;
                  	} else{
                          	right = mid;
                           // cout << "right " << right << endl;
                  	}
                  }
                }
                               
                                cout << answer << endl;
                                 return 0;
                                  } 


Compiler output:
a.cc: In function 'int main()':
a.cc:39:36: error: expected '}' at end of input
   39 |                                   }
      |                                    ^
a.cc:3:13: note: to match this '{'
    3 |   int main(){
      |             ^
Language: C++

#include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;

bool binarySearch(int a[], int n, int x)
{
  int mid;
  int left = 0;
  int right = n;
  while(left < right){
    mid = (left + right) / 2;
    if(a[mid] == x)
      return true;
    else if(x < a[mid])
      right = mid;
    else
      left = mid + 1;
  }
  return false;
}

int main(void){
	int n, q, sum=0;
	long S[10001], T[10001];
	
	/* input */
	
	std::cin >> n;
	for(int i=0; i<n; i++){
		std::cin >> S[i];
	}
	
	std::cin >> q;
	for(int i=0; i<q; i++){
		std::cin >> T[i];
		}
	
	for(int i; i<q; i++){
		if(binarySearch(S, n, T[i])){
			sum++
		}
	}
	
	cout << sum << "\n";
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:40:33: error: cannot convert 'long int*' to 'int*'
   40 |                 if(binarySearch(S, n, T[i])){
      |                                 ^
      |                                 |
      |                                 long int*
a.cc:6:23: note:   initializing argument 1 of 'bool binarySearch(int*, int, int)'
    6 | bool binarySearch(int a[], int n, int x)
      |                   ~~~~^~~
a.cc:41:30: error: expected ';' before '}' token
   41 |                         sum++
      |                              ^
      |                              ;
   42 |                 }
      |                 ~
Language: C++

#include<iostream>
using namespace std;

bool binarySearch(int a[], int n, int x)
{
  int mid;
  int left = 0;
  int right = n;
  while(left < right){
    mid = (left + right) / 2;
    if(a[mid] == x)
      return true;
    else if(x < a[mid])
      right = mid;
    else
      left = mid + 1;
  }
  return false;
}

int main(void){
	int n, q, sum=0;
	long S[10001], T[10001];
	
	/* input */
	
	std::cin >> n;
	for(int i=0; i<n; i++){
		std::cin >> S[i];
	}
	
	std::cin >> q;
	for(int i=0; i<q; i++){
		std::cin >> T[i];
		}
	
	for(int i; i<q; i++){
		if(binarySearch(S, n, T[i])){
			sum++;
		}
	}
	
	cout << sum << "\n";
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:38:33: error: cannot convert 'long int*' to 'int*'
   38 |                 if(binarySearch(S, n, T[i])){
      |                                 ^
      |                                 |
      |                                 long int*
a.cc:4:23: note:   initializing argument 1 of 'bool binarySearch(int*, int, int)'
    4 | bool binarySearch(int a[], int n, int x)
      |                   ~~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int binarySearch(int A[], int n, int key){
	int mid ,left = 0, right = n;
	while(left < right){
		mid = (left + right) / 2;
		if(A[mid] == key) return 1;
		else if(key < A[mid]) right = mid;
		else left = mid + 1;
	}
	return 0;
}


int main(){
	int n, s[10100], q, key, count = 0;
	int i, j, k;
	
	cin>>n;
	
	for(i = 0; i < n; i++) scanf("%d", &s[i]);
	
	cin>>q;
	
	for(i = 0; i < q; i++){
		 scanf("%d", ,&key);
		 if(binarySearch(s, n, key)) count++;
	}
	
	cout<<count<<endl;	
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:30: error: expected primary-expression before ',' token
   27 |                  scanf("%d", ,&key);
      |                              ^
Language: C++

#include<stdio.h>

iunt 

int binarySearch(int A[], int n, int key) {
  int left = 0;
  int right = n;
  while left < right {
    int mid = (left + right) / 2;
    if (A[mid] == key) return 1;
    else if ( A[mid] < key) right = mid;
    else left = mid + 1 ;
  }
  return 0;
}

int main() {
  int i, n, A[10000+1], q, key, sum = 0;
  
  scanf("%d", &n);
  for ( i = 0; i < n; i++) scanf("%d", &A[i]);
  
  scanf("%d", &q);
  for( i = 0; i < q; i++) { 
    scanf("%d", &key);
    if ( binarySearch(A, n, key) ) sum++;
  }
  printf("%d\n", sum);

  return 0;
}


Compiler output:
a.cc:3:1: error: 'iunt' does not name a type; did you mean 'int'?
    3 | iunt
      | ^~~~
      | int
a.cc: In function 'int main()':
a.cc:26:10: error: 'binarySearch' was not declared in this scope
   26 |     if ( binarySearch(A, n, key) ) sum++;
      |          ^~~~~~~~~~~~
Language: C++

#include<stdio.h>

int binarySearch(int A[], int n, int key) {
  int left = 0;
  int right = n;
  while left < right {
    int mid = (left + right) / 2;
    if (A[mid] == key) return 1;
    else if ( A[mid] < key) right = mid;
    else left = mid + 1 ;
  }
  return 0;
}

int main() {
  int i, n, A[10000+1], q, key, sum = 0;
  
  scanf("%d", &n);
  for ( i = 0; i < n; i++) scanf("%d", &A[i]);
  
  scanf("%d", &q);
  for( i = 0; i < q; i++) { 
    scanf("%d", &key);
    if ( binarySearch(A, n, key) ) sum++;
  }
  printf("%d\n", sum);

  return 0;
}


Compiler output:
a.cc: In function 'int binarySearch(int*, int, int)':
a.cc:6:9: error: expected '(' before 'left'
    6 |   while left < right {
      |         ^~~~
      |         (
a.cc:6:21: error: expected ')' before '{' token
    6 |   while left < right {
      |         ~~~~        ^~
      |                     )
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main() {
  vector<int> A;
  A.reserve(100000);

  int N;
  cin >> N;
  A.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }

  int M;
  int key;
  int sum = 0;

  cin >> M;
  for (int i = 0; i < M; i++) {
    cin >> key;
    if (*lower_bound(A.begin(), A.end(), key) == k) {
      sum++;
    }
  }
  cout << sum << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:50: error: 'k' was not declared in this scope
   25 |     if (*lower_bound(A.begin(), A.end(), key) == k) {
      |                                                  ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
using namespace std;
map <int ,int> mpa,mpb;

int A[100002], n;

int search(int z){
  int co=0;
  int left=0;
  int right=a;
    while(left<right){
      int mid=(left+right)/2;
      if(A[mid]==z) return 1;
      if(A[mid]>z) right=mid;
      else if(A[mid]<z) left=mid+1;
    }
  return 0;
}

int main (){
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> A[i];
  }
  int q,t;
  cin >> q;
  int ans=0;
  for(int i=0;i<n;i++){
    cin >> t;
    if search(t) ans++;
  }
  cout << ans << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int search(int)':
a.cc:20:13: error: 'a' was not declared in this scope
   20 |   int right=a;
      |             ^
a.cc: In function 'int main()':
a.cc:40:8: error: expected '(' before 'search'
   40 |     if search(t) ans++;
      |        ^~~~~~
      |        (
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
using namespace std;
map <int ,int> mpa,mpb;

int A[100002], n;

int search(int z){
  int co=0;
  int left=0;
  int right=n;
    while(left<right){
      int mid=(left+right)/2;
      if(A[mid]==z) return 1;
      if(A[mid]>z) right=mid;
      else if(A[mid]<z) left=mid+1;
    }
  return 0;
}

int main (){
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> A[i];
  }
  int q,t;
  cin >> q;
  int ans=0;
  for(int i=0;i<n;i++){
    cin >> t;
    if search(t) ans++;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:8: error: expected '(' before 'search'
   40 |     if search(t) ans++;
      |        ^~~~~~
      |        (
Language: C++

#include <stdio.h>

int N[100000];

bool binary_search(int* A, int n, int k)
{
	int left = 0, right = n;
	while (left < right)
	{
		int mid = (left + right) / 2;
		if (A[mid] == k)
			return true;
		else if (A[mid] < k)
			left = mid + 1;
		else
			right = mid;
	}
	return false;
}

int main()
{
	int n, q;
	scanf("%d", &n);
	for (int i = 0; i < n; i++)
		scanf("%d", &N[i]);

	scanf("%d", &q);
	int total = 0, k;
	for (int i = 0; i < q; i++)
	{
		scanf("%d", &k);
		if (binary_search(N, n, k))
			total++;
	}
	printf("%d\n", total);

	return 0;



Compiler output:
a.cc: In function 'int main()':
a.cc:38:18: error: expected '}' at end of input
   38 |         return 0;
      |                  ^
a.cc:22:1: note: to match this '{'
   22 | {
      | ^
Language: C++

#include <stdio.h>

// 二分探索
int binarySearch(int *A, int n, int key) {
    int compare=int(n/2);
    int check=n;
    while(check > 0) {
        if(key < A[tmp]) {
            compare = (int)compare/2;
        } else if(key > A[tmp]) {
            compare = (int)compare/2 + compare;
        } else {
            return 1;
        }
        check = (int)check/2;
    }
    return 0;
}

int main() {
    int n, q;
    scanf("%d", &n);
    int S[n];
    for(int i=0; i<n; i++) scanf("%d", &S[i]);
    scanf("%d", &q);
    
    int tmp, sum=0;
    for(int i=0; i<q; i++) {
        scanf("%d", &tmp);
        sum += binarySearch(S, n, key);
    }
    
    printf("%d\n", sum);
    return 0;
}


Compiler output:
a.cc: In function 'int binarySearch(int*, int, int)':
a.cc:8:20: error: 'tmp' was not declared in this scope
    8 |         if(key < A[tmp]) {
      |                    ^~~
a.cc: In function 'int main()':
a.cc:30:35: error: 'key' was not declared in this scope
   30 |         sum += binarySearch(S, n, key);
      |                                   ^~~
Language: C++

#include <stdio.h>

// 二分探索
int binarySearch(int *A, int n, int key) {
    int compare=int(n/2);
    int check=n;
    while(check > 0) {
        if(key < A[compare]) {
            compare = (int)compare/2;
        } else if(key > A[compare]) {
            compare = (int)compare/2 + compare;
        } else {
            return 1;
        }
        check = (int)check/2;
    }
    return 0;
}

int main() {
    int n, q;
    scanf("%d", &n);
    int S[n];
    for(int i=0; i<n; i++) scanf("%d", &S[i]);
    scanf("%d", &q);
    
    int tmp, sum=0;
    for(int i=0; i<q; i++) {
        scanf("%d", &tmp);
        sum += binarySearch(S, n, key);
    }
    
    printf("%d\n", sum);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:35: error: 'key' was not declared in this scope
   30 |         sum += binarySearch(S, n, key);
      |                                   ^~~
Language: C++

#include <stdio.h>
#include <cmath>
using namespace std;

// 二分探索
int binarySearch(int *A, int n, int key) {
    int compare=int(n/2);
    int tmp=1;
    while(tmp > 0) {
        if(key < A[compare]) {
            tmp = n/pow(2.0, i++);
            compare = tmp - tmp/2;
        } else if(key > A[compare]) {
            tmp = n/pow(2.0, i++);
            compare = tmp + tmp/2;
        } else {
            return 1;
        }
    }
    return 0;
}

int main() {
    int n, q;
    scanf("%d", &n);
    int S[n];
    for(int i=0; i<n; i++) scanf("%d", &S[i]);
    scanf("%d", &q);
    
    int tmp, sum=0;
    for(int i=0; i<q; i++) {
        scanf("%d", &tmp);
        sum += binarySearch(S, n, tmp);
    }
    
    printf("%d\n", sum);
    return 0;
}


Compiler output:
a.cc: In function 'int binarySearch(int*, int, int)':
a.cc:11:30: error: 'i' was not declared in this scope
   11 |             tmp = n/pow(2.0, i++);
      |                              ^
a.cc:14:30: error: 'i' was not declared in this scope
   14 |             tmp = n/pow(2.0, i++);
      |                              ^
Language: C++

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

int A[1000000], n;

int main() {
    cin >> n:
    for(int i=0; i<n; i++) {
        scanf("%d", &A[i]);
    }
    
    int q, k, sum=0;
    cin >> q;
    for(int i=0; i<q; i++) {
        scanf("%d", &k);
        if(*lower_bound(A, A+n, k) == k) sum++;
    }
    
    cout << sum << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected ';' before ':' token
    9 |     cin >> n:
      |             ^
      |             ;
a.cc:10:18: error: 'i' was not declared in this scope
   10 |     for(int i=0; i<n; i++) {
      |                  ^
Language: C++

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func binarySearch(target int, elems []int) bool {
	low := 0
	high := len(elems) - 1
	mid := (high + low) / 2
	for low <= high {
		midElem := elems[mid]
		if midElem == target {
			return true
		} else if midElem < target {
			low = mid + 1
			mid = (high + low) / 2
		} else {
			high = mid - 1
			mid = (high + low) / 2
		}
	}
	return false
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	n, _ := nextInt(sc)
	elems := make([]int, n)
	for i := 0; i < n; i++ {
		x, _ := nextInt(sc)
		elems[i] = x
	}
	q, _ := nextInt(sc)
	targets := make([]int, q)
	for i := 0; i < q; i++ {
		x, _ := nextInt(sc)
		targets[i] = x
	}

	count := 0
	for _, v := range targets {
		if binarySearch(v, elems) {
			count++
		}
	}
	fmt.Println(count)
}

func nextInt(sc *bufio.Scanner) (int, error) {
	sc.Scan()
	return strconv.Atoi(sc.Text())
}



Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:29:1: error: 'func' does not name a type
   29 | func main() {
      | ^~~~
a.cc:55:1: error: 'func' does not name a type
   55 | func nextInt(sc *bufio.Scanner) (int, error) {
      | ^~~~
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <conio.h>
using namespace std;

int binary(int value,const int* array,int size){
	int lower,upper,mid;
	lower = 0;
	upper = size;

	while(lower <= upper){

		mid = (lower+upper)/2;

		if(array[mid] == value){
			//cout << arr[mid] << endl;
			return array[mid];
		} else if(array[mid] < value){
			lower = mid +1;
		} else{
			upper = mid-1;
		}
	}
	return NULL;
}

int main(){
	int n,q,sum=0,size=0;
	cin >> n;
	vector<int> S;
	for(int i=0; i<n; ++i){
		int tmp;
		bool check=true;
		cin >> tmp;
		for(int j=0; j<size; ++j){
			if(tmp == S[j]) check = false;
		}
		if(check == true){
			//cout << check << " " << tmp <<  endl;
			S.push_back(tmp);
			size++;
		}
	}
	/*for(int i=0; i<size; ++i){
		cout << S[i] << endl;
	}*/
	cin >> q;
	vector<int> T(q);
	for(int i=0; i<q; ++i){
		cin >> T[i];
	}
	//sort(S.begin(),S.end());
	//sort(T.begin(),T.end());
	for(int i=0; i<q; ++i){
		//cout << binary(T[i],&S.front(),S.size()) << endl;
		if(binary(T[i],&S.front(),S.size()) != NULL) ++sum;
	}
	cout << sum << endl;
	//getch();
	return 0;
}

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

#include <iostream>
#include <stdio.h>
using namespace std;
 
int main() {
    int n,q,*S,*T,c=0,i,j;
    
    scanf("%d",&n);
    S=new int[n];
     
    for(i=0;i<n;++i)scanf("%d",S+i);
     
    scanf("%d",%q");
    T=new int[q];
     
    for(i=0;i<q;++i)scanf("%d",T+i);
     
    for(i=0;i<q;++i)
        for(j=0;j<n;++j){
            if(S[j]>T[i])break;

            if(S[j]==T[i])T[i]=-1;
        }

    for(i=0;i<q;++i)if(T[i]==-1)++c;
     
    cout<<c<<endl;
     
    delete[]S;
    delete[]T;
    return 0;
}

Compiler output:
a.cc:13:18: warning: missing terminating " character
   13 |     scanf("%d",%q");
      |                  ^
a.cc:13:18: error: missing terminating " character
   13 |     scanf("%d",%q");
      |                  ^~~
a.cc: In function 'int main()':
a.cc:13:16: error: expected primary-expression before '%' token
   13 |     scanf("%d",%q");
      |                ^
Language: C++

#include <iostream>
#include <stdio.h>
using namespace std;
 
int main() {
    int n,q,*S,*T,c=0,i,j;
    
    scanf("%d",&n);
    S=new int[n];
     
    for(i=0;i<n;++i)scanf("%d",S+i);
     
    scanf("%d",&q");
    T=new int[q];
     
    for(i=0;i<q;++i)scanf("%d",T+i);
     
    for(i=0;i<q;++i)
        for(j=0;j<n;++j){
            if(S[j]>T[i])break;

            if(S[j]==T[i])T[i]=-1;
        }

    for(i=0;i<q;++i)if(T[i]==-1)++c;
     
    cout<<c<<endl;
     
    delete[]S;
    delete[]T;
    return 0;
}

Compiler output:
a.cc:13:18: warning: missing terminating " character
   13 |     scanf("%d",&q");
      |                  ^
a.cc:13:18: error: missing terminating " character
   13 |     scanf("%d",&q");
      |                  ^~~
a.cc: In function 'int main()':
a.cc:13:18: error: expected ')' before 'T'
   13 |     scanf("%d",&q");
      |          ~       ^
      |                  )
   14 |     T=new int[q];
      |     ~
Language: Java

import com.sun.xml.internal.ws.api.message.ExceptionHasMessage;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.nextLine());
        List<Character> characters = Arrays.asList('A', 'C', 'G', 'T');
        List<String> commands = Arrays.asList("insert", "find");
        HashMap<Character, List<String>> m = new HashMap<>();
        while(sc.hasNext()) {
            String[] c_s = sc.nextLine().split(" ");
            String c = c_s[0];
            String s = c_s[1];
            if (!commands.contains(c)) {
                return;
            }
            System.out.println(Stream.of(s.split("")).collect(Collectors.toList()));
            if (c.equals("insert")) {
                Character ch = s.charAt(0);
                List<String> ss = m.get(ch);
                if (ss == null) {
                    ss = new ArrayList<>();
                }
                ss.add(s);
                m.put(s.charAt(0), ss);
            }
            if (c.equals("find")) {
                Character ch = s.charAt(0);
                List<String> ss = m.get(ch);
                String y_n;
                if (ss == null) {
                    y_n = "no";
                } else if (ss.contains(s)) {
                    y_n = "yes";
                } else {
                    y_n = "no";
                }
                System.out.println(y_n);
            }
        }
        System.out.println(m);
    }
}




Compiler output:
Main.java:1: error: package com.sun.xml.internal.ws.api.message does not exist
import com.sun.xml.internal.ws.api.message.ExceptionHasMessage;
                                          ^
1 error
Language: Java

import java.util.HashSet;
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Set<String> set = new HashSet<String>();
        int n = sc.nextInt();
        for(int i = 0 ; i < n ; i++)
        {
            String str = sc.next();
            if(str.equals("insert"))
                set.add(sc.next());
            else
            {
                if(set.contains(sc.nextInt()))
                    System.out.println("yes");
                else
                    System.out.println("no");
            }
        }
    }
}


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

import java.util.HashSet;
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        HashSet<String> set = new HashSet<String>();
        int n = sc.nextInt();
        for(int i = 0 ; i < n ; i++)
        {
            String str = sc.next();
            if(str.equals("insert"))
                set.add(sc.next());
            else
            {
                if(set.contains(String sc.nextInt()))
                    System.out.println("yes");
                else
                    System.out.println("no");
            }
        }
    }
}


Compiler output:
Main.java:15: error: ')' or ',' expected
                if(set.contains(String sc.nextInt()))
                                      ^
Main.java:15: error: ';' expected
                if(set.contains(String sc.nextInt()))
                                                   ^
Main.java:17: error: 'else' without 'if'
                else
                ^
3 errors
Language: Java

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;

public class Main_dictionary {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in); 
    int n = Integer.parseInt(sc.next());
//    Set<String> d = new Set<String>();
    Set<String> d = new HashSet<String>();
    for (int i=0; i<n; i++) {
      String q = sc.next();
      String s = sc.next();
      if (q.equals("insert") && !d.contains(s)) 
        d.add(s);
      else
        System.out.println(d.contains(s) ? "no" : "yes");
    }
  }
}

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

import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;

public class Main_dictionary {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in); 
    int n = Integer.parseInt(sc.next());
    Set<String> d = new HashSet<String>();
    for (int i=0; i<n; i++) {
      String q = sc.next();
      String s = sc.next();
//      if (q.equals("insert") && !d.contains(s)) 
      if (q.equals("insert")) 
        d.add(s);
      else
        System.out.println(d.contains(s) ? "yes" : "no");
    }
  }
}

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

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

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) throws IOException{
long start=System.currentTimeMillis();
solve();
long end=System.currentTimeMillis();
//out.println(end-start+"ms");
out.flush();
}

private static void solve(){
BufferedReader br=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)){
out.println(d.find(str)?"yes":"no);
}
}
}

Compiler output:
Main.java:44: error: unclosed string literal
out.println(d.find(str)?"yes":"no);
                              ^
Main.java:47: error: reached end of file while parsing
}
 ^
2 errors
Language: Java

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

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) throws IOException{
long start=System.currentTimeMillis();
solve();
long end=System.currentTimeMillis();
//out.println(end-start+"ms");
out.flush();
}

private static void solve(){
BufferedReader br=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:3: error: cannot find symbol
import java.util.StingTokenizer;
                ^
  symbol:   class StingTokenizer
  location: package java.util
Main.java:31: error: cannot find symbol
BufferedReader br=BufferedReader(new InputStreamReader(System.in));
                  ^
  symbol:   method BufferedReader(InputStreamReader)
  location: class Main
Main.java:33: error: cannot find symbol
while((line=br.readLine)!=null&&!line.isEmpty()){
              ^
  symbol:   variable readLine
  location: variable br of type BufferedReader
Main.java:37: error: cannot find symbol
StringTokenizer st=new StringTokenizer(br.readLine());
^
  symbol:   class StringTokenizer
  location: class Main
Main.java:37: error: cannot find symbol
StringTokenizer st=new StringTokenizer(br.readLine());
                       ^
  symbol:   class StringTokenizer
  location: class Main
5 errors
Language: Java

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

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) throws IOException{
long start=System.currentTimeMillis();
solve();
long end=System.currentTimeMillis();
//out.println(end-start+"ms");
out.flush();
}

private static void solve(){
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:3: error: cannot find symbol
import java.util.SrtingTokenizer;
                ^
  symbol:   class SrtingTokenizer
  location: package java.util
Main.java:33: error: cannot find symbol
while((line=br.readLine)!=null&&!line.isEmpty()){
              ^
  symbol:   variable readLine
  location: variable br of type BufferedReader
Main.java:37: error: cannot find symbol
StringTokenizer st=new StringTokenizer(br.readLine());
^
  symbol:   class StringTokenizer
  location: class Main
Main.java:37: error: cannot find symbol
StringTokenizer st=new StringTokenizer(br.readLine());
                       ^
  symbol:   class StringTokenizer
  location: class Main
4 errors
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) throws IOException{
long start=System.currentTimeMillis();
solve();
long end=System.currentTimeMillis();
//out.println(end-start+"ms");
out.flush();
}

private static void solve(){
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:33: error: unreported exception IOException; must be caught or declared to be thrown
while((line=br.readLine())!=null&&!line.isEmpty()){
                       ^
Main.java:37: error: unreported exception IOException; must be caught or declared to be thrown
StringTokenizer st=new StringTokenizer(br.readLine());
                                                  ^
2 errors