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

#include<iostream>
using namespace std;
int main(){
	int N,a[10000],SUNADA=0,HIGASHINO=0,q=0,w=0,e=0,r=0,t=0,y=0,u=0,o=0,BaKA=0;
	cin>>N;
	for(int i=0;i<N;i++){
		a[i]=0;
		cin>>a[i];
	}
	for(int i=0;i<N;i++){
		if(a[i]<=399&&q==0){
			SUNADA+=1;
			HIGASHINO+=1;
			q+=1;
		}
		else if(a[i]/400==1&&w==0){
			SUNADA+=1;
			HIGASHINO+=1;
			w+=1;
		}
		else if(a[i]/400==2&&e==0){
			SUNADA+=1;
			HIGASHINO+=1;
			e+=1;
		}
		else if(a[i]/400==3&&r==0){
			SUNADA+=1;
			HIGASHINO+=1;
			r+=1;
		}
		else if(a[i]/400==4&&t==0){
			SUNADA+=1;
			HIGASHINO+=1;
			t+=1;
		}
		else if(a[i]/400==5&&y==0){
			SUNADA+=1;
			HIGASHINO+=1;
			y+=1;
		}
		else if(a[i]/400==6&&u==0){
			SUNADA+=1;
			HIGASHINO+=1;
			u+=1;
		}
		else if(a[i]/400==7&&o==0){
			SUNADA+=1;
			HIGASHINO+=1;
			o+=1;
		}
		else if(a[i]>=3200&&BaKa==0){
			HIGASHINO+=1;
			BaKa+=1;
		}
			else if(a[i]>=3200){
			SUNADA+=1;
		}
	}
	cout<<HIGASHINO<<" "<<SUNADA<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:37: error: 'BaKa' was not declared in this scope; did you mean 'BaKA'?
   51 |                 else if(a[i]>=3200&&BaKa==0){
      |                                     ^~~~
      |                                     BaKA
Language: C++

#include <cstdio>

#define min(a, b) (a < b ? a : b)
#define max(a, b) (a > b ? a : b)

int main()
{
    int no_of_contestants;
    scanf("%d", &no_of_contestants);

    const int NO_OF_COLOURS = 8, SPECIAL = 8;
    int frequency[NO_OF_COLOURS + 1] = {0}, special_colours = 0;

    while(no_of_contestants--)
    {
        int rating;
        scanf("%d", &rating);

        if(rating < 3200)
            frequency[colour/400]++;
        else
            special_colours++;
    }

    int normal_colours = 0;
    for(int i = 0; i < SPECIAL; i++)
        normal_colours += (frequency[i] > 0);

    int min_colours = (normal_colours == 0 ? 1 : normal_colours);
    int max_colours = normal_colours + special_colours;

    printf("%d %d", min_colours, max_colours);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:23: error: 'colour' was not declared in this scope
   20 |             frequency[colour/400]++;
      |                       ^~~~~~
Language: Java

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int userCount = sc.nextInt();

        int free = 0;
        Set<Integer> colors = new HashSet<>();
        for (int i = 0; i < userCount; i++) {
            int rate = sc.nextInt() / 400;
            if (7 < rate) {
                free++;
            } else {
                colors.add(rate);
            }
        }
        int hold  = colors.size();

        int min = 0;
        int max = 0;
        if (hold == 0) {
            if (0 < free) {
                min = 1;
                max = free <= 8 ? free : 8;
            }
        } else {
            min = hold;
            max = hold + free <= 8 ? hold + free : 8;
        }
        System.out.println(min + " " + max);
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
        Set<Integer> colors = new HashSet<>();
        ^
  symbol:   class Set
  location: class Main
Main.java:8: error: cannot find symbol
        Set<Integer> colors = new HashSet<>();
                                  ^
  symbol:   class HashSet
  location: class Main
4 errors
Language: C++

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

int main()
{
  int N;
  cin >> N;
  int rate[9] = {1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200};
  int color[9] = {};
  for (int i = 0; i < N; i++) {
    int buf;
    cin >> buf;
    for (int j = 0; j < 8; j++) {
      if (rate[j] <= buf && buf < rate[j+1]) {
        color[j]++;
      }
    }
    if (rate[8] <= buf) {
      color[8]++;
    }
  }
  int min = 0;
  int max;
  for (int i = 0 ; i < 8; i++) {
    if (color[i] != 0) min++;
  }
 
  if (min == 0) {
    min = 1;
    if (color[8] <= 8)
      max = color[8];
    else
      max = 8;
  }
  if (min + color[8] > 8 && min !=0) {
    max = 8;
  } else if  {
    max = min + color[8];
  }
  cout << min << " " << max << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:14: error: expected '(' before '{' token
   37 |   } else if  {
      |              ^
      |              (
Language: C++

#include <iostream>

using namespace std;

int main(void) {
  int N;
  cin >> N;
  
  int R[10] = { };
  int high = 0;
  for(int i = 0; i < N; i++) {
   	int r;
    cin >> r;
   	if(r >= 3200) high++;
    else R[r / 400]++;
  }
  
  int cln = 0;
  for(int i = 0; i < 8; i++) {
    cln += (R[i] > 0);
  }
  
  if(cln == 0) cout << 1 << ' ';
  else cout << cln << ' ';
  
  cout << (high + cln) << endl
  
  return 0;
}
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:26:31: error: expected ';' before 'return'
   26 |   cout << (high + cln) << endl
      |                               ^
      |                               ;
   27 | 
   28 |   return 0;
      |   ~~~~~~
Language: C++

#include<iostream>
int main(){
  int n,a[9],s;
  std::cin>>n;
  for(int i=0;i<n;i++){
    int x;
    std::cin>>x;
    if(x>=3600){
    x=3201;
    }
    if(a[(x-x%400)/400]==0){
      s+=1;
    }
    a[x(x-x%400)/400]+=1;
  }
 std::cout<<s<<std::endl;
  if(s+a[8]<=8){
  std::cout<<s+a[8]<<std::endl;
  }
  else{
  std::cout<<8<<std::endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 'x' cannot be used as a function
   14 |     a[x(x-x%400)/400]+=1;
      |       ~^~~~~~~~~
Language: C++

#include<iostream>
int main(){
  int n,a[9],s;
  std::cin>>n;
  for(int i=0;i<n;i+){
    int x;
    std::cin>>x;
    if(x>=3600){
    x=3200;
    }
    if(a[x/400]==0){
      s+=1
    }
    a[x/400]+=1;
  }
 std:cout<<s<<std::endl;
  if(s+a[8]<=8){
  std::cout<<s+a[8]<<std::endl;
  }
  else{
  std::cout<<8<<std::endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:21: error: expected primary-expression before ')' token
    5 |   for(int i=0;i<n;i+){
      |                     ^
a.cc:12:11: error: expected ';' before '}' token
   12 |       s+=1
      |           ^
      |           ;
   13 |     }
      |     ~      
a.cc:16:6: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |  std:cout<<s<<std::endl;
      |      ^~~~
      |      std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>

using namespace std;

int main() {
	int hist[9] = {0};
	int N;

	cin >> N;
	for(int i = 0; i < N; i++) {
		int a;
		cin >> a;
		if(1 <= a && a < 400) hist[0]++;
		if(400 <= a && a < 800) hist[1]++;
		if(800 <= a && a < 1200) hist[2]++;
		if(1200 <= a && a <1600) hist[3]++;
		if(1600 <= a && a < 2000) hist[4]++;
		if(2000 <= a && a < 2400) hist[5]++;
		if(2400 <= a && a < 2800) hist[6]++;
		if(2800 <= a && a < 3200) hist[7]++;
		if(3200 <= a) hist[8]++;
	}
	
	int sum = 0;
	for(int i = 0; i < 8; i++) {
		sum += (hist[i] > 0);
	}
	
	int sum2;
	int tmp = 8 - sum;
	if(tmp > hist[8]) {
		if(sum == 0) sum = hist[8];
		sum2 = sum + hist[8];
	else {
		if(sum == 0) sum = tmp;
		sum2 = sum + 8;
	}

	cout << sum << ' ' << sum2 << endl;

	return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: expected '}' before 'else'
   34 |         else {
      |         ^~~~
a.cc:31:27: note: to match this '{'
   31 |         if(tmp > hist[8]) {
      |                           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n, a[100], c[8] = {}, p = 0, ans;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &n);
    if (a >= 3200)
      p++;
    else
      c[a / 400] = 1;
  }
  ans = count(c, c + 8, 1);
  printf("%d %d\n", max(1, ans), ans + p);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     if (a >= 3200)
      |         ~~^~~~~~~
a.cc:13:11: error: invalid operands of types 'int [100]' and 'int' to binary 'operator/'
   13 |       c[a / 400] = 1;
      |         ~ ^ ~~~
      |         |   |
      |         |   int
      |         int [100]
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<vector>
#include<climits>
#define ll long long int
using namespace std;
int main(void) {
  int n;
  cin>>n;
  int c[8]={0};
  int o=0;
  int a=0;
  for(int i=0; i<n; i++) {
    int x;
    cin>>x;
    if(x>=3200) o++;
    if(c[x/400]==0) {
      a++;
      c[x/400]=1;
    }
  }
  if(a==0) cout<<1<<<" "<<o<<endl;
  else cout<<a<<" "<<a+o<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: expected primary-expression before '<' token
   25 |   if(a==0) cout<<1<<<" "<<o<<endl;
      |                     ^
a.cc:25:25: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator<<'
   25 |   if(a==0) cout<<1<<<" "<<o<<endl;
      |                      ~~~^~~
      |                      |    |
      |                      |    int
      |                      const char [2]
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<climits>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<iomanip>
#include<deque>
using namespace std;

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define rep2(i,j,n) for(int i=(j);i<=(n);i++)
#define all(i) i.begin(),i.end()

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<int, int> pi;
typedef long long i64;

int main() {
	int n;
	cin >> n;
	vi a(n);
	int x = 0;
	set<int> st;
	rep(i, 0, n) {
		cin >> a[i];
		if (1 <= a[i] && a[i] < 400) {
			st.insert(1);
		}
		else if (400 <= a[i] && a[i] < 800) {
			st.insert(2);
		}
		else if (800 <= a[i] && a[i] < 1200) {
			st.insert(3);
		}
		else if (1200 <= a[i] && a[i] < 1600) {
			st.insert(4);
		}
		else if (1600 <= a[i] && a[i] < 2000) {
			st.insert(5);
		}
		else if (2000 <= a[i] && a[i] < 2400) {
			st.insert(6);
		}
		else if (2400 <= a[i] && a[i] < 2800) {
			st.insert(7);
		}
		else if (2800 <= a[i] && a[i] < 3200) {
			st.insert(8);
		}
		else {
			x++;
		}
	}
	int min = st.size();
	if (min == 0) {
		min++;
	}
	int max = st.size() + x;
	cout << min << " " << max << endl;
	return 0:
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:17: error: expected ';' before ':' token
   69 |         return 0:
      |                 ^
      |                 ;
a.cc:69:17: error: expected primary-expression before ':' token
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
int main(void){
    ll n,a;
    cin>>n;
    vector<ll> v;
    rep(i,0,n){
        cin>>a;
        if(a<3200)v.at(a/400)=1;
        else v.at(8)++;
    }
    rep(i,1,8)v.at(0)+=v.at(i);
    cout<<max(v.at(0),(ll)1)<<' '<<min(v.at(0)+v.at(8))<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:39: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type)'
   15 |     cout<<max(v.at(0),(ll)1)<<' '<<min(v.at(0)+v.at(8))<<endl;
      |                                    ~~~^~~~~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:15:39: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   15 |     cout<<max(v.at(0),(ll)1)<<' '<<min(v.at(0)+v.at(8))<<endl;
      |                                    ~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,l,r) for(ll i=(l);i<(r);i++)
int main(void){
    ll n,a;
    cin>>n;
    vector<ll> v;
    rep(i,0,n){
        cin>>a;
        if(a<3200)v.at(a/400)=1;
        else v.at(8)++;
    }
    rep(i,1,9)v.at(0)+=v.at(i);
    cout<<min(v.at(0),9)
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&, int)'
   15 |     cout<<min(v.at(0),9)
      |           ~~~^~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:15:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   15 |     cout<<min(v.at(0),9)
      |           ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:15:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   15 |     cout<<min(v.at(0),9)
      |           ~~~^~~~~~~~~~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(9);
  for(int i = 0; i < n; i++){
    cin >> a.at(i);
    if(a.at(i) < 400){
      b.at(0)++;
    }else if(a.at(i) >= 400 && a.at(i) < 800){
      b.at(1)++;
    }else if(a.at(i) >= 800 && a.at(i) < 1200){
      b.at(2)++;
    }else if(a.at(i) >= 1200 && a.at(i) < 1600){
      b.at(3)++;
    }else if(a.at(i) >= 1600 && a.at(i) < 2000){
      b.at(4)++;
    }else if(a.at(i) >= 2000 && a.at(i) < 2400){
      b.at(5)++;
    }else if(a.at(i) >= 2400 && a.at(i) < 2800){
      b.at(6)++;
    }else if(a.at(i) >= 2800 && a.at(i) < 3200){
      b.at(7)++;
    }else if(a.at(i) >= 3200){
      b.at(8)++;
    }
  }
  int c = 0;
  for(int i = 0; i < 9; i++){
    if(b.at(i) >= 1){
      c++;
    }
  }
  int comin, comax;
  if(b.at(8) == 0){
    comin = c;
    comax = c;
  }else(b.at(8) >= 1){
    if(c == 0){
      comin = 1;
      comax = min(8, b.at(8));
    }else{
      comin = c;
      comax = min(8, c+b.at(8));
    }
  }
  cout << comin << " " << comax << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:22: error: expected ';' before '{' token
   42 |   }else(b.at(8) >= 1){
      |                      ^
      |                      ;
Language: C++

N = int(input())
a = list(map(lambda x : int(x) // 400, input().split()))
over3200 = sum(list(map(lambda x: 1 if x >= 8 else 0, a)))

count = 0
for i in range(8):
    if i in a:
        count += 1
        
print(max(1, count), count+over3200)


Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int N = sc.nextInt();
  Set<String> s = new HashSet<String>();
  int counter = 0;
  for(int i = 0;i < N;i++){
    int a = sc.nextInt();
    if(a < 400)s.add("a");
    else if(a < 800)s.add("b");
    else if(a < 1200)s.add("c");
    else if(a < 1600)s.add("d");
    else if(a < 2000)s.add("e");
    else if(a < 2400)s.add("f");
    else if(a < 2800)s.add("g");
    else if(a < 3200)s.add("h");
    else if(a >= 3200)counter++;
  }
  if(s.size == 0){
    System.out.println("1");
  }
  else{
    System.out.print(s.size() > 8 ? "8" : s.size());
  }
  System.out.print(" ");
  System.out.println(s.size() + counter > 8 ? "8" : s.size() + counter);
}}


Compiler output:
Main.java:20: error: cannot find symbol
  if(s.size == 0){
      ^
  symbol:   variable size
  location: variable s of type Set<String>
1 error
Language: C++

n=int(input())
a=[int(i) for i in input().split()]
num=[0 for i in range(14)]
for rate in a:
	num[int(rate/400)]+=1

ans=0
for i in range(8):
	if num[i]>0:
		ans+=1
over=0
for i in range(8,14):
	over+=num[i]
print(max(ans,1),end="")
print(" ",end="")
print(min(ans+over,8))


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

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

#define REP(n) for(int i = 0;i < n;i++)
using namespace std;

int main(){

    int n;
    cin >> n;
    vector<bool> a(12,0);
    int tmp = 0;
    int count = 0;
    REP(n){
        cin >> tmp;
        if(tmp >=3200){
            count++;
        }
        a[tmp/400] = true;z
    }

    int color_count = 0;
    REP(8){
        if(a[i] == true){
            color_count++;
        }
    }

    int mini = (color_count != 0) ? color_count : 1;
    int maxi = color_count+count;

    cout << mini << " " << maxi << endl;


    
   
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: 'z' was not declared in this scope
   20 |         a[tmp/400] = true;z
      |                           ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<int, int> P;
typedef pair<ll, P> E;
#define cost first
#define from second.first
#define to second.second
#define MOD (1000000007ll)
#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

int main(void){
	int n,a,his[9],i,ans=0;
	fill(h,h+9,0);
	for(i=0; i<n; ++i){
		cin >> a;
		his[min(3200,a)/400]++;
	}
	for(i=0; i<8; i++){
		if(his[i]){
			ans++;
		}
	}
	cout << ans << " " << (ans+his[8]) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: 'h' was not declared in this scope
   21 |         fill(h,h+9,0);
      |              ^
Language: C++

// finish date: 2018/01/22
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long
#define bigmod 1000000007
#define INF 500000000


int main() {
    int N;
    cin >> N;
    map<int, int> mp;
    int a;
    rep(i, N) {
        cin >> a;
        mp[min(8, a / 400)]++;
    }
    int mi, ma;
    mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0));
    ma = min(mi + mp[8], 8);

    cout << mi << " " << ma << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:13: error: no matching function for call to 'max(int, std::map<int, int>::size_type)'
   30 |     mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0));
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:30:13: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::map<int, int>::size_type' {aka 'long unsigned int'})
   30 |     mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0));
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:30:13: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   30 |     mi = max(1,mp.size() - ((mp.count(8)) ? 1 : 0));
      |          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
bool f[10];
int main(){
  int n,cnt=0,ans=0;
  int a;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a;
    if(1<=a&&a<=399)f[0]=1;
    else if(a<800)f[1]=1;
    else if(a<1200)f[2]=1;
    else if(a<1600)f[3]=1;
    else if(a<2000)f[4]=1;
    else if(a<2400)f[5]=1;
    else if(a<2800)f[6]=1;
    else if(a<3200)f[7]=1;
    else cnt++;
  }
  for(int i=0;i<8;i++)ans+=f[i];
  if(ans==0)cout<<1<<' ';
  else cout<<ans<<' ';
  else cout<<ans+cnt<<endl;
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:3: error: 'else' without a previous 'if'
   23 |   else cout<<ans+cnt<<endl;
      |   ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
using namespace std;
//
int main(){
  int N;
  int cnt=0;
  set<int> S;
  cin>>N;
  FOR(i,0,N){
    int A;
    cin>>A;
    if(A>=3200){
      cnt++;
      continue;
    }
    int B=A/400;
    S.insert(B);
  }
  cout<<max(S.size(),1)<<" "<<S.size()+cnt<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:12: error: no matching function for call to 'max(std::set<int>::size_type, int)'
   40 |   cout<<max(S.size(),1)<<" "<<S.size()+cnt<<endl;
      |         ~~~^~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:40:12: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   40 |   cout<<max(S.size(),1)<<" "<<S.size()+cnt<<endl;
      |         ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:40:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   40 |   cout<<max(S.size(),1)<<" "<<S.size()+cnt<<endl;
      |         ~~~^~~~~~~~~~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<set>
 
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;
#define p(p) cout<<(p)<<" ";
#define pb push_back
#define mp make_pair
#define INF 1<<25

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef long long ll;

//int dy[8]={1,1,1,0,0,-1,-1,-1};
//int dx[8]={-1,0,1,-1,1,-1,0,1};
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
struct S{
	int a,b,c;
};
bool asc(const S& left,const S& right){
	return left.c > right.c;
}
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin>>N;
	vi a(N),color(8,0);
	int r=0;
	rep(i,N){
		cin>>a[i];
		if(a[i]<400)color[0]++;
		else if(a[i]<800)color[1]++;
		else if(a[i]<1200)color[2]++;
		else if(a[i]<1600)color[3]++;
		else if(a[i]<2000)color[4]++;
		else if(a[i]<2400)color[5]++;
		else if(a[i]<2800)color[6]++;
		else if(a[i]<3200)color[7]++;
		else r++;
	}
	int cnt=0;
	rep(i,8){
		if(color[i]>0)cnt++;
	}
	if(cnt!=0)
		p(cnt)P(cnt+r);
	else 
		p("1")P(cnt+r);
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:75:9: error: 'else' without a previous 'if'
   75 |         else
      |         ^~~~
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<set>
 
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;
#define p(p) cout<<(p)<<" ";
#define pb push_back
#define mp make_pair
#define INF 1<<25

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pi;
typedef long long ll;

//int dy[8]={1,1,1,0,0,-1,-1,-1};
//int dx[8]={-1,0,1,-1,1,-1,0,1};
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
struct S{
	int a,b,c;
};
bool asc(const S& left,const S& right){
	return left.c > right.c;
}
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin>>N;
	vi a(N),color(8,0);
	int r=0;
	rep(i,N){
		cin>>a[i];
		if(a[i]<400)color[0]++;
		else if(a[i]<800)color[1]++;
		else if(a[i]<1200)color[2]++;
		else if(a[i]<1600)color[3]++;
		else if(a[i]<2000)color[4]++;
		else if(a[i]<2400)color[5]++;
		else if(a[i]<2800)color[6]++;
		else if(a[i]<3200)color[7]++;
		else r++;
	}
	int cnt=0;
	rep(i,8){
		if(color[i]>0)cnt++;
	}
	if(cnt!=0)
		p(cnt)P(cnt+r);
	else 
		p(1)P(cnt+r);
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:75:9: error: 'else' without a previous 'if'
   75 |         else
      |         ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<bool> a(8, 0);
  int count = 0;
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    if (b <= 399) {
      a[0] = 1;
    } else if (b <= 799) {
      a[1] = 1;
    } else if (b <= 1199) {
      a[2] = 1;
    } else if (b <= 1599) {
      a[3] = 1;
    } else if (b <= 1999) {
      a[4] = 1;
    } else if (b <= 2399) {
      a[5] = 1;
    } else if (b <= 2799) {
      a[6] = 1;
    } else if (b <= 3199) {
      a[7] = 1;
    } else {
      count++;
    }
  }
  int c = a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[7];
  cout << max(c, count > 0) << " ";
  cout << c + count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:14: error: no matching function for call to 'max(int&, bool)'
   34 |   cout << max(c, count > 0) << " ";
      |           ~~~^~~~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:34:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'bool')
   34 |   cout << max(c, count > 0) << " ";
      |           ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:34:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   34 |   cout << max(c, count > 0) << " ";
      |           ~~~^~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<bool> a(8, 0);
  int count = 0;
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    if (b <= 399) {
      a[0] = 1;
    } else if (b <= 799) {
      a[1] = 1;
    } else if (b <= 1199) {
      a[2] = 1;
    } else if (b <= 1599) {
      a[3] = 1;
    } else if (b <= 1999) {
      a[4] = 1;
    } else if (b <= 2399) {
      a[5] = 1;
    } else if (b <= 2799) {
      a[6] = 1;
    } else if (b <= 3199) {
      a[7] = 1;
    } else {
      count++;
    }
  }
  int c = a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[7];
  cout << max(c, count > 0) << " ";
  cout << c + count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:14: error: no matching function for call to 'max(int&, bool)'
   33 |   cout << max(c, count > 0) << " ";
      |           ~~~^~~~~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:33:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'bool')
   33 |   cout << max(c, count > 0) << " ";
      |           ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include<iostream>
using namespace std;

int n, buf, emp = 0, p = 0;
int color[9] = {0,0,0,0,0,0,0,0,0};

int main(){
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> buf;
        if(buf < 400){
            color[0]++;
        }else if(buf < 800){
            color[1]++;
        }else if(buf < 1200){
            color[2]++;
        }else if(buf < 1600){
            color[3]++;
        }else if(buf < 2000){
            color[4]++;
        }else if(buf < 2400){
            color[5]++;
        }else if(buf < 2800){
            color[6]++;
        }else if(buf < 3200){
            color[7]++;
        }else{
            color[8]++;
        }
    }
    for(int j = 0; j < 8; j++){
        if(color[j] == 0){
            emp++;
        }
    }
    if(emp == 8) p = 1;
    if(color[8] == 0){
        cout << 8 - emp << " " << 8 - emp << endl;
    }else(color[8] < emp){
        cout << 8 - emp + p << " " << 8 - emp + color[8] << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:26: error: expected ';' before '{' token
   39 |     }else(color[8] < emp){
      |                          ^
      |                          ;
Language: Java

import static java.lang.System.out;
import java.util.Scanner;
import java.util.Arrays;
public class Main{
   public static void main(String[]aa){
      Scanner sc = new Scanner(System.in); 
      int N = sc.nextInt();
      int[] numarray = new int[N];
      for(int i=0;i<N;i++){
            numarray[i] =sc.nextInt();
      }
      int[] countarray = new int[8];
      int over = 0;
      for(int i=0;i<N;i++){
         int target = numarray[i];
         
         int j = target<400 ? 0:
         target< 800 ? 1:
         target<1200 ? 2:
         target<1600 ? 3:
         target<2000 ? 4:
         target<2400 ? 5:
         target<2800 ? 6:
         target<3200 ? 7:
         10;
         if(j ==10){
            over++;
         }else{
            countarray[j] =1;
         }
      }
      int count=0;
      for(int i:countarray){
            count+= i;
      }
      if(count!=0){
         out.print(count +" ");
      }else{
         out.print(over + " ");
      }
      out.print(Math.min(8,count+over));
   }


Compiler output:
Main.java:42: error: reached end of file while parsing
   }
    ^
1 error
Language: C++

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define rep(i,n) for(int i=0;i<=(n);++i)
#define ALL(v) (v).begin(),(v).end()

typedef long long ll;
typedef pair<ll, int> P;

int n;
bool c[8];
int cnt;

int main(){
	cin.tie(0);
  ios::sync_with_stdio(false);

	REP(i,8) c[i]=false;

	cin>>n;
	REP(i,n) {
		int a; cin>>a;
		if(a<400) c[0]=true;
		else if(a<800) c[1]=true;
		else if(a<1200) c[2]=true;
		else if(a<1600) c[3]=true;
		else if(a<2000) c[4]=true;
		else if(a<2400) c[5]=true;
		else if(a<2800) c[6]=true;
		else if(a<3200) c[7]=true;
		else cnt++;
	}
	int sum=0;
	REP(i,8) {
		sum+=(c[i]?1:0);
	}
	cout<<(sum?sum:"1")<<' '<<sum+cnt<<endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:19: error: operands to '?:' have different types 'int' and 'const char*'
   42 |         cout<<(sum?sum:"1")<<' '<<sum+cnt<<endl;
      |                ~~~^~~~~~~~
Language: C++

int his[9]={};
int main(int argc , char **argv)
{
	(void)argc;
	(void)argv;

	int N;
	cin >> N;
	for(int i=1;i<=N;i++){
		int a;
		cin >> a;
		int c = a/400;
		if (3200 <= a){c = 8;}
		his[c]++;
	}

	int cc=0;
	for(int i=0;i<=7;i++){
		if( 0<his[i] ){cc++;}
	}

	printf("%d %d\n",max(1,cc),cc+his[8]);

	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> N;
      |         ^~~
a.cc:22:26: error: 'max' was not declared in this scope
   22 |         printf("%d %d\n",max(1,cc),cc+his[8]);
      |                          ^~~
a.cc:22:9: error: 'printf' was not declared in this scope
   22 |         printf("%d %d\n",max(1,cc),cc+his[8]);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int his[9]={};
Language: C++

	if(color[i])
	    x++;

    cout<<x<<" ";
    int m = min(8,x+over);
    cout<<m<<endl;

    return 0;
}


Compiler output:
a.cc:1:9: error: expected unqualified-id before 'if'
    1 |         if(color[i])
      |         ^~
a.cc:4:5: error: 'cout' does not name a type
    4 |     cout<<x<<" ";
      |     ^~~~
a.cc:5:19: error: 'x' was not declared in this scope
    5 |     int m = min(8,x+over);
      |                   ^
a.cc:5:21: error: 'over' was not declared in this scope
    5 |     int m = min(8,x+over);
      |                     ^~~~
a.cc:5:13: error: 'min' was not declared in this scope
    5 |     int m = min(8,x+over);
      |             ^~~
a.cc:6:5: error: 'cout' does not name a type
    6 |     cout<<m<<endl;
      |     ^~~~
a.cc:8:5: error: expected unqualified-id before 'return'
    8 |     return 0;
      |     ^~~~~~
a.cc:9:1: error: expected declaration before '}' token
    9 | }
      | ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int rate[]={1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4900};

int main(){
        int flag[9];
        for(int i=0;i<9;i++){
                flag[i]=0;
        }
        int N;
        cin>>N;
        for(int i=0;i<N;i++){
                int rr;
                cin>>rr;
                for(int j=0;j<9;j++){
                        if(rr>=rate[j]&&rr<rate[j+1]){
                                flag[j]++;
                                break;
                        }
                }
                /*for(int j=0;j<9;j++){
                        cout<<j+1<<":"<<flag[j]<<endl;  
                }*/
        }
        int res=0;
        for(int i=0;i<8;i++){
                if(flag[i]>0)
                        res++;
        }
        if(res==0){
                cout<<1<<" "<<flag[8]<<endl;

        else{
                cout<<res<<" "<<res+flag[8]<<endl;
        }
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: expected '}' before 'else'
   35 |         else{
      |         ^~~~
a.cc:32:19: note: to match this '{'
   32 |         if(res==0){
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;

int n, c[10];

int main(int argc, char const *argv[]) {
	ios_base::sync_with_stdio(false);
	cin >> n;
	FOR(i, n) {
		int a;
		cin >> a;
		a = min(a/400, 8);
		c[a]++;
	}
	int cnt = 0;
	FOR(i, 8) {
		if (c[i]) cnt++;
	}
	int mi = (cnt : cnt ? 1), ma = cnt + c[8];
	cout << mi << " " << ma << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:24:23: error: found ':' in nested-name-specifier, expected '::'
   24 |         int mi = (cnt : cnt ? 1), ma = cnt + c[8];
      |                       ^
      |                       ::
a.cc:24:19: error: 'cnt' is not a class, namespace, or enumeration
   24 |         int mi = (cnt : cnt ? 1), ma = cnt + c[8];
      |                   ^~~
a.cc:24:32: error: expected ':' before ')' token
   24 |         int mi = (cnt : cnt ? 1), ma = cnt + c[8];
      |                                ^
      |                                :
a.cc:24:32: error: expected primary-expression before ')' token
a.cc:25:30: error: 'ma' was not declared in this scope; did you mean 'mi'?
   25 |         cout << mi << " " << ma << endl;
      |                              ^~
      |                              mi
Language: C++

#include<stdio.h>
int main(void)
{
	int n,a[8],i,j,x,h,h2,l;
	scanf("%d",&n);
	for(i=0;i<8;i++)	a[i]=0;
	l=0;
	for(i=0;i<n;i++){
		scanf("%d",&x);
		if(x>3199){
			l++;
		}
		else{
			h=400;	h2=1;
			for(j=0;j<8;j++){
				if(h2<=x && x<h){
					a[j]=1;
					break;
				}
				h2=h;
				h=h+400;
			}
		}
	}
	x=0;
	for(i=0;i<8;i++){
		if(a[i]==1)	x++;
	}
	if(l>8)	l=8
	l=x+l;
	printf("%d %d\n",x,l);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: expected ';' before 'l'
   29 |         if(l>8) l=8
      |                    ^
      |                    ;
   30 |         l=x+l;
      |         ~
Language: C++

#include<stdio.h>
int main(void)
{
	int n,a,x[]={0,399,799,1199,1599,1999,2399,2799,3199},flg[10],cnt,cnt1,i,j;
	scanf("%d",&n);
	cnt=0;
	for(i=0;i<8;i++) flg[i]=0;
	for(i=0;i<n;i++){
		scanf("%d",&a);
		for(j=0;j<9;j++){
			if(j==8){
				cnt++;
				break;
			}
			else if(x[j]<a&&x[j+1]>=a){
			//	printf("a=%d i=%d\n",a,i);
				flg[j]=1;
				break;
			}
		}
	}
//	 for(i=0;i<9;i++) printf("%d\n",x[i]);
	// for(i=0;i<8;i++) printf("%d\n",flg[i]);
	cnt1=0;
	for(i=0;i<8;i++){
		if(flg[i]==1) cnt1++;
	}
	 //if(cnt1==0) printf("1 ");
	else printf("%d ",cnt1);
	cnt1+=cnt;
	printf("%d\n",cnt1);
	//else printf("8\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'else' without a previous 'if'
   29 |         else printf("%d ",cnt1);
      |         ^~~~
Language: C++

#include<cstdio>
#include<iostream>
using namespace std;
int main(void){
	int n,min,max,i,a[100],flg[8],cn;
	for(i=0;i<8;i++) flg[i]=0;
	cin>>n;
	for(i=0;i<n;i++) cin>>a[i];
	min=0; max=0; cn=0
	for(i=0;i<n;i++){
		if(a[i]<=399&&flg[0]!=1){
			flg[0]=1;
			min++; max++;
		}
		if(a[i]>=400&&a[i]<=799&&flg[1]!=1){
			flg[1]=1;
			min++; max++;
		}
		if(a[i]>=800&&a[i]<=1199&&flg[2]!=1){
			flg[2]=1;
			min++; max++;
		}
		if(a[i]>=1200&&a[i]<=1599&&flg[3]!=1){
			flg[3]=1;
			min++; max++;
		}
		if(a[i]>=1600&&a[i]<=1999&&flg[4]!=1){
			flg[4]=1;
			min++; max++;
		}
		if(a[i]>=2000&&a[i]<=2399&&flg[5]!=1){
			flg[5]=1;
			min++; max++;
		}
		if(a[i]>=2400&&a[i]<=2799&&flg[6]!=1){
			flg[6]=1;
			min++; max++;
		}
		if(a[i]>=2800&&a[i]<=3199&&flg[7]!=1){
			flg[7]=1;
			min++; max++;
		}
		if(a[i]>=3200){
			cn++; max++;
		}
	}
	if(cn>min) min+=cn-min;
	cout<<min<<' '<<max<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:27: error: expected ';' before 'for'
    9 |         min=0; max=0; cn=0
      |                           ^
      |                           ;
   10 |         for(i=0;i<n;i++){
      |         ~~~                
a.cc:10:24: error: expected ';' before ')' token
   10 |         for(i=0;i<n;i++){
      |                        ^
      |                        ;
Language: C++

#aiinclude <iostream>
#define MAX_N 200
using namespace std;
int main(void){
  int n;
  int cn[MAX_N] = {0};
  int fc = 0;
  cin >> n;
  for(int i = 0; i < n; i++){
    int a;
    cin >> a;
    if(a >= 3200) fc++;
    else cn[a/400] = 1;
  }
  int mi = 0;
  for(int i = 0; i < 8; i++) mi += cn[i];
  if(mi == 0) mi = 1;
  int max;
  if(mi+fc >= 8) max = 8;
  else max = mi+fc;
  cout << mi << " " << max << endl;
  return 0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #aiinclude; did you mean #include?
    1 | #aiinclude <iostream>
      |  ^~~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #aiinclude <iostream>
a.cc:21:3: error: 'cout' was not declared in this scope
   21 |   cout << mi << " " << max << endl;
      |   ^~~~
a.cc:21:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:31: error: 'endl' was not declared in this scope
   21 |   cout << mi << " " << max << endl;
      |                               ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #aiinclude <iostream>