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

#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <list>
#define rep(i,n) for (int i = 0; (i) < (n); ++(i))
using namespace std;

int main() {
    int n,q;
    cin >> n >> q;
    vector<int> v(n);
    rep(i,q) {
        int s,t;
        switch(s) {
            case 0:
            int x;
            cin >> x;
            v[t].push_back(x);
            break;
            case 1:
            rep(j,v.size()) {
                cout << v[j];
                if(j!= v.size()) cout << " ";
                else    cout << endl;
            }
            break;
            case 2:
            v[t].erase(v[t].begin(), v[t].end());
            break;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:18: error: request for member 'push_back' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)t))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   27 |             v[t].push_back(x);
      |                  ^~~~~~~~~
a.cc:37:18: error: request for member 'erase' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)t))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   37 |             v[t].erase(v[t].begin(), v[t].end());
      |                  ^~~~~
a.cc:37:29: error: request for member 'begin' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)t))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   37 |             v[t].erase(v[t].begin(), v[t].end());
      |                             ^~~~~
a.cc:37:43: error: request for member 'end' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)t))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   37 |             v[t].erase(v[t].begin(), v[t].end());
      |                                           ^~~
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
    int n,q; cin>>n>>q;
    vector<int>v(n);
    while(q--){
        int a,b,c;
        cin>>a>>b;
        if(!a){
            cin>>c;
            v[b].push_back(c);
        }
        else if(a==1){
            r(i,int v[b].size()){
                if(i)cout<<' ';
                cout<<v[b][i];
            }
            cout<<endl;
        }
        else v[b].clear;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: request for member 'push_back' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)b))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   13 |             v[b].push_back(c);
      |                  ^~~~~~~~~
a.cc:16:17: error: expected primary-expression before 'int'
   16 |             r(i,int v[b].size()){
      |                 ^~~
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:16:17: error: expected ';' before 'int'
   16 |             r(i,int v[b].size()){
      |                 ^~~
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:16:17: error: expected primary-expression before 'int'
   16 |             r(i,int v[b].size()){
      |                 ^~~
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:16:17: error: expected ')' before 'int'
   16 |             r(i,int v[b].size()){
      |                 ^~~
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:2:19: note: to match this '('
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                   ^
a.cc:16:13: note: in expansion of macro 'r'
   16 |             r(i,int v[b].size()){
      |             ^
a.cc:16:25: error: expected initializer before '.' token
   16 |             r(i,int v[b].size()){
      |                         ^
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:16:15: error: 'i' was not declared in this scope
   16 |             r(i,int v[b].size()){
      |               ^
a.cc:2:32: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                                ^
a.cc:22:19: error: request for member 'clear' in 'v.std::vector<int>::operator[](((std::vector<int>::size_type)b))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   22 |         else v[b].clear;
      |                   ^~~~~
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
    int n,q; cin>>n>>q;
    vector<int>v[n];
    while(q--){
        int a,b,c;
        cin>>a>>b;
        if(!a){
            cin>>c;
            v[b].push_back(c);
        }
        else if(a==1){
            r(i,int v[b].size()){
                if(i)cout<<' ';
                cout<<v[b][i];
            }
            cout<<endl;
        }
        else v[b].clear;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected primary-expression before 'int'
   16 |             r(i,int v[b].size()){
      |                 ^~~
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:16:17: error: expected ';' before 'int'
   16 |             r(i,int v[b].size()){
      |                 ^~~
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:16:17: error: expected primary-expression before 'int'
   16 |             r(i,int v[b].size()){
      |                 ^~~
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:16:17: error: expected ')' before 'int'
   16 |             r(i,int v[b].size()){
      |                 ^~~
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:2:19: note: to match this '('
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                   ^
a.cc:16:13: note: in expansion of macro 'r'
   16 |             r(i,int v[b].size()){
      |             ^
a.cc:16:25: error: expected initializer before '.' token
   16 |             r(i,int v[b].size()){
      |                         ^
a.cc:2:30: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                              ^
a.cc:16:15: error: 'i' was not declared in this scope
   16 |             r(i,int v[b].size()){
      |               ^
a.cc:2:32: note: in definition of macro 'r'
    2 | #define r(i,n) for(int i=0;i<n;i++)
      |                                ^
a.cc:22:19: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::clear() [with _Tp = int; _Alloc = std::allocator<int>]'
   22 |         else v[b].clear;
      |              ~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1607:7: note: declared here
 1607 |       clear() _GLIBCXX_NOEXCEPT
      |       ^~~~~
Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
    int n,q; cin>>n>>q;
    vector<int>v[n];
    while(q--){
        int a,b,c;
        cin>>a>>b;
        if(!a){
            cin>>c;
            v[b].push_back(c);
        }
        else if(a==1){
            r(i,(int) v[b].size()){
                if(i)cout<<' ';
                cout<<v[b][i];
            }
            cout<<endl;
        }
        else v[b].clear;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::clear() [with _Tp = int; _Alloc = std::allocator<int>]'
   22 |         else v[b].clear;
      |              ~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1607:7: note: declared here
 1607 |       clear() _GLIBCXX_NOEXCEPT
      |       ^~~~~
Language: C++

#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1000000000
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

int main (){
    int n;
    cin>>n>>q;
    vector<stack<int>> st(n);
    rep(i,0,q){
        int cmd;cin>>cmd;
        if(cmd==0){
            int t,x;cin>>t>>x;
            st[t].push(x);
        }else  if(cmd==1){
            int t;cin>>t;
            if(!st[t].empty())cout<<st[t].top()<<endl;
        }else {
            int t;cin>>t;
            if(!st[t].empty())st[t].pop();
        }
    }
    

}



/*

*/


Compiler output:
a.cc: In function 'int main()':
a.cc:98:13: error: 'q' was not declared in this scope
   98 |     cin>>n>>q;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  int n,q;
  cin>>n>>q;
  vector<stack<int> > s(n);
  for(int i=0;i<q;i++){
    int t,a;
    cin>>t>>a;
    if(t==0){
      int x;
      cin>>x;
      s[a].emplace(x);
    }
    if(t==1) cout<<s[a].top()<<endl;
    it(t==2) s[a].pop();
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'it' was not declared in this scope; did you mean 't'?
   18 |     it(t==2) s[a].pop();
      |     ^~
      |     t
Language: C++

#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
  int n,q;
  cin>>n>>q;
  stack<int>s[n];
  while(q--){
    int a,b,c;
    cin>>a>>b;
    if(!a){
      cin>>c;
      s[b].push(c);
    }
    else if(a==1){
      if(!s[b].empty())cout<<s[b].front()<<endl;
    }
    else if(!s[b].empty())s[b].pop();
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:35: error: 'class std::stack<int>' has no member named 'front'
   17 |       if(!s[b].empty())cout<<s[b].front()<<endl;
      |                                   ^~~~~
Language: C++

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

int main(){
    int n,q,t,x,y;
    cin>>n>>q;
    queue<int>a[n];
    for(int i=0;i<n;i++){
        cin>>t;
        if(x==0){
            cin>>x>>y;
            a[x].push_back(y);
        }
        else if(x==1){
            cin>>x;
            if(!a[x].empty())cout<<a[x].front();
        }
        else if(x==2){
            cin>>x;
            if(!a[x].empty())cout<<a[x].pop_front();
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: 'class std::queue<int>' has no member named 'push_back'
   13 |             a[x].push_back(y);
      |                  ^~~~~~~~~
a.cc:21:41: error: 'class std::queue<int>' has no member named 'pop_front'
   21 |             if(!a[x].empty())cout<<a[x].pop_front();
      |                                         ^~~~~~~~~
Language: Java

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;

public class ITP2_2_C {
	public static void main(String[] args) {
		int i;
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			int q = sc.nextInt();
			List<Queue<Integer>> array = new ArrayList<>();
			for(i = 0; i < n; i++) {
				array.add(new PriorityQueue<Integer>(4 ,new MyComparator()));
			}
			for(i = 0; i < q; i++) {
				int order_number = sc.nextInt();
				int t = sc.nextInt();
				//命令1と2は配列が空なら処理しない
				if(array.get(t).isEmpty() && order_number != 0) {
					continue;
				}
				switch(order_number) {
				case 0 :
					array.get(t).add(sc.nextInt());
					break;
				case 1 :
					System.out.println(array.get(t).peek());
					break;
				case 2 :
					array.get(t).remove();
					break;
				}
				for(Queue<Integer> output : array) {
					System.out.println(output);
				}
			}
		}
	}
}
class MyComparator implements Comparator<Object> {
	 
    public int compare(Object obj1, Object obj2) {
         
        int num1 = (int)obj1;
        int num2 = (int)obj2;
         
        if(num1 < num2) {
            return 1;
        } else if(num1 > num2) {
            return -1;
        } else{
            return 0;
        }
    }
}


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

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

int main(){
    int n,q;
    cin>>n>>q;
    priority_queue<int>s[n];
    while(q--){
        int a,b,c;
        cin>>a>>b;
        if(!a){
            cin>>c;
            s[b].push(c);
        }
        else if(a==1){
            if(!s[b].empty)cout<<s[b].top()<<endl;
        }
        else if(!s[b].pop())s[b].pop();
    }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: cannot convert 'std::priority_queue<int>::empty' from type 'bool (std::priority_queue<int>::)() const' to type 'bool'
   17 |             if(!s[b].empty)cout<<s[b].top()<<endl;
      |                      ^~~~~
a.cc:17:22: error: in argument to unary !
   17 |             if(!s[b].empty)cout<<s[b].top()<<endl;
      |                 ~~~~~^~~~~
a.cc:19:26: error: could not convert 's[b].std::priority_queue<int>::pop()' from 'void' to 'bool'
   19 |         else if(!s[b].pop())s[b].pop();
      |                  ~~~~~~~~^~
      |                          |
      |                          void
a.cc:19:26: error: in argument to unary !
Language: C++

#include <queue>
#include <stdio.h>
const int N=1e5+10;
int main(){
    int n,q,t;
    priority_queue<int> pq[N];
    scanf("%d%d",&n,&q);
    while(q--){
        scanf("%d%d",&n,&t);
        if(n==0){
            scanf("%d",&n);
            pq[t].push(n);
        }
        else if(n==1){
            if(!pq[t].empty())printf("%d\n",pq[t].top());
        }
        else if(!pq[t].empty())pq[t].pop();
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'priority_queue' was not declared in this scope; did you mean 'std::priority_queue'?
    6 |     priority_queue<int> pq[N];
      |     ^~~~~~~~~~~~~~
      |     std::priority_queue
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:496:11: note: 'std::priority_queue' declared here
  496 |     class priority_queue
      |           ^~~~~~~~~~~~~~
a.cc:6:20: error: expected primary-expression before 'int'
    6 |     priority_queue<int> pq[N];
      |                    ^~~
a.cc:12:13: error: 'pq' was not declared in this scope; did you mean 'q'?
   12 |             pq[t].push(n);
      |             ^~
      |             q
a.cc:15:17: error: 'pq' was not declared in this scope; did you mean 'q'?
   15 |             if(!pq[t].empty())printf("%d\n",pq[t].top());
      |                 ^~
      |                 q
a.cc:17:18: error: 'pq' was not declared in this scope; did you mean 'q'?
   17 |         else if(!pq[t].empty())pq[t].pop();
      |                  ^~
      |                  q
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)
#define lpin(a,i,n) for(int i=0;i<n;i++){cin>>a[i];}

int  main(){
  list<int> l[1001];
  list<int>::iterator it;
  int n,q;
  cin>>n>>q;
  lp(i,q){
    int x,y,z;
    cin>>x>>y;
    if(x==0){
      cin>>z;
      l[y].push_back(z);
    }
    if(x==1){
      for(it=l[y].begin();it!=l[y].end();it++){
	cout<<*it<<" ";
      }
      cout<<endl;
      
    }
    if(x==2){
      cin>>z;
      l[y].splice(l[y].begin();std::move(l[z]),l[z].begin());
    }
  }

		  
      
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:27:31: error: expected ')' before ';' token
   27 |       l[y].splice(l[y].begin();std::move(l[z]),l[z].begin());
      |                  ~            ^
      |                               )
a.cc:27:41: warning: ignoring return value of 'constexpr typename std::remove_reference<_Tp>::type&& std::move(_Tp&&) [with _Tp = __cxx11::list<int>&; typename remove_reference<_Tp>::type = __cxx11::list<int>]', declared with attribute 'nodiscard' [-Wunused-result]
   27 |       l[y].splice(l[y].begin();std::move(l[z]),l[z].begin());
      |                                ~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/move.h:137:5: note: declared here
  137 |     move(_Tp&& __t) noexcept
      |     ^~~~
a.cc:27:60: error: expected ';' before ')' token
   27 |       l[y].splice(l[y].begin();std::move(l[z]),l[z].begin());
      |                                                            ^
      |                                                            ;
Language: C++

#include(bits/stdc++.h)
using namespace std;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    cout<<min(a,b,c)<<" "<<max(a,b,c)<<endl;
    return 0;
}


Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include(bits/stdc++.h)
      |         ^
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin>>a>>b>>c;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include(bits/stdc++.h)
a.cc:6:5: error: 'cout' was not declared in this scope
    6 |     cout<<min(a,b,c)<<" "<<max(a,b,c)<<endl;
      |     ^~~~
a.cc:6:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:6:11: error: 'min' was not declared in this scope; did you mean 'main'?
    6 |     cout<<min(a,b,c)<<" "<<max(a,b,c)<<endl;
      |           ^~~
      |           main
a.cc:6:28: error: 'max' was not declared in this scope
    6 |     cout<<min(a,b,c)<<" "<<max(a,b,c)<<endl;
      |                            ^~~
a.cc:6:40: error: 'endl' was not declared in this scope
    6 |     cout<<min(a,b,c)<<" "<<max(a,b,c)<<endl;
      |                                        ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include(bits/stdc++.h)
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    cout<<min(a,b,c)<<" "<<max(a,b,c)<<endl;
    return 0;
}


Compiler output:
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:6:14:   required from here
    6 |     cout<<min(a,b,c)<<" "<<max(a,b,c)<<endl;
      |           ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:6:31:   required from here
    6 |     cout<<min(a,b,c)<<" "<<max(a,b,c)<<endl;
      |                            ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: Java

import java.util.Scanner;
public class Main{
    public static long min(long a[], int b, int e){
        int min = a[b];
        for(int i = b+1 ; i < e ; i++)
            min = Math.min(min,a[i]);
        return min;
    }
    public static long max(long a[], int b, int e){
        int max = a[b];
        for(int i = b+1 ; i < e ; i++)
            max = Math.max(max,a[i]);
        return max;
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[n];
        for(int i = 0 ; i < n ; i++)
            a[i] = sc.nextLong();
        int q = sc.nextInt();
        for(int i = 0 ; i < q ; i++){
            int com = sc.nextInt();
            int b = sc.nextInt();
            int e = sc.nextInt();
            if(com == 0)
                System.out.println(min(a,b,e));
            else
                System.out.println(max(a,b,e));
        }
    }
}


Compiler output:
Main.java:4: error: incompatible types: possible lossy conversion from long to int
        int min = a[b];
                   ^
Main.java:6: error: incompatible types: possible lossy conversion from long to int
            min = Math.min(min,a[i]);
                          ^
Main.java:10: error: incompatible types: possible lossy conversion from long to int
        int max = a[b];
                   ^
Main.java:12: error: incompatible types: possible lossy conversion from long to int
            max = Math.max(max,a[i]);
                          ^
4 errors
Language: Java

import java.util.Scanner;
public class Main{
    public static long m(long a[], int b, int e){
        int Min = a[b];
        for(int i = b+1 ; i < e ; i++)
            Min = Math.min(Min,a[i]);
        return Min;
    }
    public static long M(long a[], int b, int e){
        int Max = a[b];
        for(int i = b+1 ; i < e ; i++)
            Max = Math.max(Max,a[i]);
        return Max;
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[n];
        for(int i = 0 ; i < n ; i++)
            a[i] = sc.nextLong();
        int q = sc.nextInt();
        for(int i = 0 ; i < q ; i++){
            int com = sc.nextInt();
            int b = sc.nextInt();
            int e = sc.nextInt();
            if(com == 0)
                System.out.println(m(a,b,e));
            else
                System.out.println(M(a,b,e));
        }
    }
}


Compiler output:
Main.java:4: error: incompatible types: possible lossy conversion from long to int
        int Min = a[b];
                   ^
Main.java:6: error: incompatible types: possible lossy conversion from long to int
            Min = Math.min(Min,a[i]);
                          ^
Main.java:10: error: incompatible types: possible lossy conversion from long to int
        int Max = a[b];
                   ^
Main.java:12: error: incompatible types: possible lossy conversion from long to int
            Max = Math.max(Max,a[i]);
                          ^
4 errors
Language: C

#include <stdio.h>
int max(int [],int ,int );
int min(int [],int ,int );
int main(void){
    int a[1000],n,q,com,b,e;
    scanf("%d",&n);
    for(int i=0;i<n;i++) scanf("%d",&a[i]);
    scanf("%d",&q);
    for(int i=0;i<q;i++){
        scanf("%d %d %d",&com,&b,&e);
        if(com==0) min(a,b,e);
        else max(a,b,e);
    }
    return 0;
}

int max(int a[],int b,int e){
    int i,max=a[b];
    for(i=b+1;i<e;i++){
        if(max<a[i]) max=a[i];
    }
    printf("%d\n",max);
    return 0;
}


Compiler output:
/usr/bin/ld: /tmp/cc5loy5P.o: in function `main':
main.c:(.text+0xe2): undefined reference to `min'
collect2: error: ld returned 1 exit status
Language: C++

using System;

public class Hello
{
    public static void Main()
    {
        Console.ReadLine();
        var s = Console.ReadLine().Trim();
        var s2 = s.Replace(" ", "");
        Console.ReadLine();
        var t = Console.ReadLine().Trim();
        var t2 = t.Replace(" ", "");
        Console.WriteLine(t2.CompareTo(s2) == 1 ? 1 : 0);
    }
}



Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Hello
      | ^~~~~~
Language: C++

using System;

public class Hello
{
    public static void Main()
    {
        Console.ReadLine();
        var s = Console.ReadLine().Trim();
        var s2 = s.Replace(" ", "");
        Console.ReadLine();
        var t = Console.ReadLine().Trim();
        var t2 = t.Replace(" ", "");
        Console.WriteLine(t2.CompareTo(s2) == 1 ? 1 : 0);
    }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Hello
      | ^~~~~~
Language: Java

import java.util.Scanner;
public class Main{
    public static void rotate(long a[], int b, int m, int e){
        int A[] = new int[e-b];
        for(int i = 0 ; i < e-b ; i++)
            A[i] = a[b + (m-b+i)%(e-m)];
        for(int i = 0 ; i < e-b ; i++)
            a[b+i] = A[i];
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[n];
        for(int i = 0 ; i < n ; i++)
            a[i] = sc.nextLong();
        int q = sc.nextInt();
        for(int i = 0 ; i < n ; i++){
            int b = sc.nextInt();
            int m = sc.nextInt();
            int e = sc.nextInt();
            rotate(a,b,m,e);
        }
        for(int i = 0 ; i < n-1 ; i++)
            System.out.print(a[i] + " ");
        System.out.println(a[n-1]);
    }
}


Compiler output:
Main.java:6: error: incompatible types: possible lossy conversion from long to int
            A[i] = a[b + (m-b+i)%(e-m)];
                    ^
1 error
Language: C++

v#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int a[1010], c[1010];
int main() {
	int n, q;
	cin >> n;
	rep(i, n)cin >> a[i];
	cin >> q;
	while (q--) {
		int b, m, e;
		cin >> b >> m >> e;
		rep(i, n)c[i] = a[i];
		for (int i = b; i < e; i++)c[(b + i + e - m) % (e - m)] = a[b + 1];
		for (int i = b; i < e; i++)a[i] = c[i];
	}
	rep(i, n)cout << a[i] << (i == n - 1 ? "\n" : " ");
	return 0;
}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> n;
      |         ^~~
a.cc:17:18: error: 'cout' was not declared in this scope
   17 |         rep(i, n)cout << a[i] << (i == n - 1 ? "\n" : " ");
      |                  ^~~~
Language: Java

import java.util.Scanner;
public class Main{
    public static void swap(long a[], int b, int e, int t){
        for(int i = 0 ; i < e-b ; i++){
            long tmp = a[b+i];
            a[b+i] = a[k+i];
            a[k+i] = tmp; 
        }
    }
    public static void main(Stirng[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[];
        for(int i = 0 ; i < n ; i++)
            a[i] = sc.nextLong();
        int q = sc.nextInt();
        for(int i = 0 ; i < q ; i++){
            int b = sc.nextInt();
            int e = sc.nextInt();
            int t = sc.nextInt();
            swap(a,b,e,t);
        }
        for(int i = 0 ; i < n-1 ; i++)
            System.out.print(a[i] + " ");
        System.out.println(a[n-1]);
    }
}


Compiler output:
Main.java:13: error: array dimension missing
        long a[] = new long[];
                             ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
    public static void swap(long a[], int b, int e, int t){
        for(int i = 0 ; i < e-b ; i++){
            long tmp = a[b+i];
            a[b+i] = a[k+i];
            a[k+i] = tmp; 
        }
    }
    public static void main(Stirng[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[n];
        for(int i = 0 ; i < n ; i++)
            a[i] = sc.nextLong();
        int q = sc.nextInt();
        for(int i = 0 ; i < q ; i++){
            int b = sc.nextInt();
            int e = sc.nextInt();
            int t = sc.nextInt();
            swap(a,b,e,t);
        }
        for(int i = 0 ; i < n-1 ; i++)
            System.out.print(a[i] + " ");
        System.out.println(a[n-1]);
    }
}


Compiler output:
Main.java:10: error: cannot find symbol
    public static void main(Stirng[] args){
                            ^
  symbol:   class Stirng
  location: class Main
Main.java:6: error: cannot find symbol
            a[b+i] = a[k+i];
                       ^
  symbol:   variable k
  location: class Main
Main.java:7: error: cannot find symbol
            a[k+i] = tmp; 
              ^
  symbol:   variable k
  location: class Main
3 errors
Language: Java

import java.util.Scanner;
public class Main{
    public static void swap(long a[], int b, int e, int t){
        for(int i = 0 ; i < e-b ; i++){
            long tmp = a[b+i];
            a[b+i] = a[t+i];
            a[t+i] = tmp; 
        }
    }
    public static void main(Stirng[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[n];
        for(int i = 0 ; i < n ; i++)
            a[i] = sc.nextLong();
        int q = sc.nextInt();
        for(int i = 0 ; i < q ; i++){
            int b = sc.nextInt();
            int e = sc.nextInt();
            int t = sc.nextInt();
            swap(a,b,e,t);
        }
        for(int i = 0 ; i < n-1 ; i++)
            System.out.print(a[i] + " ");
        System.out.println(a[n-1]);
    }
}


Compiler output:
Main.java:10: error: cannot find symbol
    public static void main(Stirng[] args){
                            ^
  symbol:   class Stirng
  location: class Main
1 error
Language: C++


#include<bits/stdc++.h>
using namespace std;
int main(){
  tuple<int,int,char,long long,string> a[100000];
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    int s1,s2;
    char s3;
    long long s4;
    string s5;
    cin>>s1>>s2>>s3>>s4>>s5;
    a[i]=make_tuple(s1,s2,s3,s4,s5);
  }
  sort(a,a+n);
  for (int i=0;i<n;i++){
    int s1,s2;
    char s3;
    long long s4;
    string s5;
    s1=get<0>(a[i]);
    s2=get<1>(a[i]);
    s3=get<2>(a[i]);
    s4=get<3>(a[i]);
    s5=get<4>(a[i]);
    cout<<s1<<" "<<s2<<" "<<s3<<" "<<s4<<" "<<s5<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:28:4: error: expected '}' at end of input
   28 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: Java

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

public class Main { 
	static Scanner scan = new Scanner(System.in);

    public static void main(String[] args) { 

    	int n = scan.nextInt();
    	String str = "";
    	
    	for(int i=0; i<n; i++) {
    		str += scan.nextInt();	//WARNING
    		if (i != n-1) str += " ";
    	}
    	
    	String str2 = "";
    	List<String> list = new ArrayList<String>();
    	for(int i=1; i<n+1; i++) {
    		str2 += i;
    	}
    	list =permutation(list, str2, "");
    	
    	int a = -1;
    	for(int i=0; i<list.size(); i++) {
    		if(list.get(i).equals(str)) {
    			a = i;
    			break;
    		}
    	}
    	if(a != 0) {
    		System.out.println(list.get(a - 1));
    	}
    	System.out.println(list.get(a));
    	if(a != list.size()-1) System.out.println(list.get(a + 1));
    }
	
    public static List<String> permutation(List<String> list, String q, String ans){
    	if(q.length() <= 1) {
    		list.add(q + str);
    	}else {
    		for (int i = 0; i < q.length(); i++) {
    			permutation(list, q.substring(0, i) + q.substring(i + 1), ans + q.charAt(i) + " ");
    		}
    	}
    	return list;
    }    	
}


Compiler output:
Main.java:41: error: cannot find symbol
    		list.add(q + str);
    		             ^
  symbol:   variable str
  location: class Main
1 error
Language: Java

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

public class Main { 
	static Scanner scan = new Scanner(System.in);

    public static void main(String[] args) { 

    	int n = scan.nextInt();
    	String str = "";
    	
    	for(int i=0; i<n; i++) {
    		str += scan.nextInt();	//WARNING
    		if (i != n-1) str += " ";
    	}
    	
    	String str2 = "";
    	List<String> list = new ArrayList<String>();
    	for(int i=1; i<n+1; i++) {
    		str2 += i;
    	}
    	list =permutation(list, str2, "");
    	
    	int a = -1;
    	for(int i=0; i<list.size(); i++) {
    		if(list.get(i).equals(str)) {
    			a = i;
    			break;
    		}
    	}
    	if(a != 0) {
    		System.out.println(list.get(a - 1));
    	}
    	System.out.println(list.get(a));
    	if(a != list.size()-1) System.out.println(list.get(a + 1));
    }
	
    public static List<String> permutation(List<String> list, String q, String ans){
    	if(q.length() <= 1) {
    		list.add(str + q);
    	}else {
    		for (int i = 0; i < q.length(); i++) {
    			permutation(list, q.substring(0, i) + q.substring(i + 1), ans + q.charAt(i) + " ");
    		}
    	}
    	return list;
    }    	
}


Compiler output:
Main.java:41: error: cannot find symbol
    		list.add(str + q);
    		         ^
  symbol:   variable str
  location: class Main
1 error
Language: Java

public class ITP2_5_D {
	public static void main(String[] args){
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			int[] a = new int[n];
			for(int i = 0; i < n; i++) {
				a[i] = i + 1;
			}
			recursive(a, 0);
		}
	}
	private static void recursive(int[] a,int j){  
		if(j==a.length){ 
			for(int i = 0; i < a.length - 1; i++) {
				System.out.print(a[i] + " ");
			}
			System.out.println(a[a.length - 1]);
			return;  
		}  
		for(int i=j;i<a.length;i++){  
			int t=a[i];  
			for(int k=i;k>j;k--)  
				a[k]=a[k-1];  
			a[j]=t;  
			recursive(a,j+1);  
			for(int k=j;k<i;k++)  
				a[k]=a[k+1];  
			a[i]=t;  
		}  
	}
}


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

import java.util.Scanner;
public class Main{
    public static boolean search(long a[], int k){
        int start = 0;
        int end = k.length-1;
        do{
            int mid = (start + end)/2;
            if(a[mid] == k)
                return true;
            else if(a[mid] > k)
                end = mid;
            else
                start = mid;
        }while(start != end);
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[n];
        for(int i = 0 ; i < n ; i++)
            a[i] = sc.nextLong();
        int q = sc.nextInt();
        for(int i = 0 ; i < q ; i++){
            int k = sc.nextInt();
            if(search(a,k))
                System.out.println(1);
            else
                System.out.println(0);
        }
    }
}


Compiler output:
Main.java:5: error: int cannot be dereferenced
        int end = k.length-1;
                   ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
    public static boolean search(long a[], int k){
        int start = 0;
        int end = a.length-1;
        do{
            int mid = (start + end)/2;
            if(a[mid] == k)
                return true;
            else if(a[mid] > k)
                end = mid;
            else
                start = mid;
        }while(start != end);
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[n];
        for(int i = 0 ; i < n ; i++)
            a[i] = sc.nextLong();
        int q = sc.nextInt();
        for(int i = 0 ; i < q ; i++){
            int k = sc.nextInt();
            if(search(a,k))
                System.out.println(1);
            else
                System.out.println(0);
        }
    }
}


Compiler output:
Main.java:15: error: missing return statement
    }
    ^
1 error
Language: Java

import java.util.Scanner;
public class Main{
    public static boolean search(long a[], int k){
        int start = 0;
        int end = a.length-1;
        while(true){
            if(a[start] == k || a[end] == k)
                return true;
            else{
                int mid = (start + end)/2;
                if(a[mid] == k)
                    return true;
                else if(a[mid] > k)
                    end = mid;
                else
                    start = mid;
            }
            if(start+1 >= end)
                return false;
        }
        return false;
    }
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[n];
        for(int i = 0 ; i < n ; i++)
            a[i] = sc.nextLong();
        int q = sc.nextInt();
        for(int i = 0 ; i < q ; i++){
            int k = sc.nextInt();
            if(search(a,k))
                System.out.println(1);
            else
                System.out.println(0);
        }
    }
}


Compiler output:
Main.java:21: error: unreachable statement
        return false;
        ^
1 error
Language: C

#include<iostream>
int num[10000005];
using namespace std;
int main(){
	int n;
	cin>>n;
	int temp;
    for(int i=0;i<n;i++){
    	cin>>temp;
    	num[temp]=1;
	}
	int n1;
	cin>>n1;
	int no;
	for(int i=0;i<n1;i++){
		cin>>no;
		if(num[no]==0)
		cout<<"0"<<endl;
		else
		cout<<"1"<<endl;
	}
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include<cstring>
#include<cstdio>
#include<vector>
using namespace std;
bool Find(int arr[],int N,int x){
	int L=0,R=N-1,Mid=0;
	while(L<=R){
		Mid=(L+R)/2;
		if(arr[Mid]==x)
		return 1;
		else if(x<arr[Mid])
		R=Mid-1;
		else
		L=Mid+1;
	}
	return 0;
	
}

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	int n,arr[10005];
	vector<int>va;
	cin>>n;
	for(int i=0;i<n;i++)
	cin>>arr[i];
	int m;
	cin>>m;
	for(int i=0;i<m;i++){
		int a;
		cin>>a;
		if(Find(arr,n,a))
		va.push_back(1);
		else 
		va.push_back(0);
	}
	for(int i=0;i<va.size()-1;i++){
		cout<<va[i]<<endl;
	}
	cout<<va[va.size()-1];
	return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

bool binary_search( int* a, int n , int v )
{
    int left = 0, right = n; 
    bool judge = false;

    while( left < right )
    {
        int mid = ( left + right ) / 2;
        if( a[mid] > v )
            right = mid;
        else if( a[mid] < v )
            left = mid + 1;                     // midではなくて、mid+1
        else
        {
            judge = true;
            break;
        }
    }
    return judge;
}

int main()
{
    int n, q, v;

    cin >> n;

    int a[n];

    for( int i = 0; i < n; i++ )
        cin >> a[i];
    
    cin >> q;

    for( int i = 0; i < q; i++ )
    {
        cin >> v;
        if( binary_search( a, n, v ) == true )
            cout << 1 << endl;
        else
            cout << 0 << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'cin' was not declared in this scope
   26 |     cin >> n;
      |     ^~~
a.cc:39:13: error: 'cout' was not declared in this scope
   39 |             cout << 1 << endl;
      |             ^~~~
a.cc:39:26: error: 'endl' was not declared in this scope
   39 |             cout << 1 << endl;
      |                          ^~~~
a.cc:41:13: error: 'cout' was not declared in this scope
   41 |             cout << 0 << endl;
      |             ^~~~
a.cc:41:26: error: 'endl' was not declared in this scope
   41 |             cout << 0 << endl;
      |                          ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
set<int>st;
int main() {
	int q;
	cin >> q;
	while (q--) {
		int Q, k;
		cin >> Q >> k;
		if (Q == 0) {
			st.insert(k);
			cout << st.size() << endl;
		}
		else if (Q == 1) {
			cout << st.count(k) << endl;
		}
		else {
			st.erase(x);
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:34: error: 'x' was not declared in this scope
   19 |                         st.erase(x);
      |                                  ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
using namespace std;
int n;
set<int>S;
main()
{
  cin>>n;
  for(int i=0;i<n;i++)
  {
    int c,x;cin>>c>>x;
    if(c==1)cout<<(S.find(x)!=S.end())<<endl;
    else if(c==0)S.insert(x),cout<<S.size()<<endl;
    else if(c==2)S.erase(x);
    else
    {
      int y;cin>>y;
      auto a=S.lower_bound(x),b=S.upper_bound(y),u=0;
      for(auto it=a;it!=b;it++)cout<<*it<<endl;
    }
  }
}



Compiler output:
a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:20:7: error: inconsistent deduction for 'auto': 'std::_Rb_tree_const_iterator<int>' and then 'int'
   20 |       auto a=S.lower_bound(x),b=S.upper_bound(y),u=0;
      |       ^~~~
Language: C++

#include <stdio.h>
#include <set>
#include <iterator>
using namespace std;
int main(){
    int n,temp,k;
    set<int> s;
    set<int>::iterator u;
    scanf("%d",&n);
    while(n--){
        scanf("%d%d",&k,&temp);
        if(k==0){
            s.insert(temp);
            printf("%ld\n",s.size());
        }
        else if(k==1){
            if(s.find(temp)==s.end())printf("0\n");
            else printf("1\n");
        }
        else if(k==2)s.erase(temp);   
        else{
            u=s.lower_bound(temp);
            cin>>temp;
            while(u!=s.end()){
                if(*u>temp)break;
                cout<<*u<<endl;
            }
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: 'cin' was not declared in this scope
   23 |             cin>>temp;
      |             ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <iterator>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:26:17: error: 'cout' was not declared in this scope
   26 |                 cout<<*u<<endl;
      |                 ^~~~
a.cc:26:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:26:27: error: 'endl' was not declared in this scope
   26 |                 cout<<*u<<endl;
      |                           ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include <iterator>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: Java

import java.util.Scanner;
import java.util.SortedMap;
import java.util.TreeMap;

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

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		int count = 0;
		TreeMap<Integer, Integer> map = new TreeMap<>();

		for(int i = 0; i < n; i++) {
			int query = scan.nextInt();
			int a = scan.nextInt();

			switch(query) {

			case 0:	//insert
				if(!map.containsKey(a)) map.put(a, 1l);
				else map.put(a, map.get(a) + 1);
				count++;
				System.out.println(count);
				break;

			case 1:	//find
				if(map.get(a) != null) System.out.println(map.get(a));
				else System.out.println(0);
				break;

			case 2:	//delete
				if(map.get(a) != null) {
					count -= map.get(a);
					map.remove(map.get(a));
				}
				break;

			case 3:	//dump
				int b = scan.nextInt();
				SortedMap<Integer, Integer> subM = map.subMap(a,true, b,true);
				for(Integer x : subM.keySet()) {
					for(int j=0; j<map.get(x); i++) {
						System.out.println(x);
					}
				}
				break;
			}
		}
	}
}


Compiler output:
Main.java:21: error: incompatible types: long cannot be converted to Integer
				if(!map.containsKey(a)) map.put(a, 1l);
				                                   ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error