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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<string,int>;
const double PI = acos(-1);
string iro(int x){
  string color;
  if(x >= 3200) color = "ziyu";
  else if(x >= 2800) color = "aka";
  else if(x >= 2400) color = "daidai";
  else if(x >= 2000) color = "ki";
  else if(x >= 1600) color = "ao";
  else if(x >= 1200) color = "mizu";
  else if(x >= 800) color = "midori";
  else if(x >= 400) color = "tya";
  else color = "hai";
  return  color;
}
int main() {
 int n;
 cin >> n;
 vector<int> a(n);
 rep(i,n) cin >> a.at(i);
 map<string,int> mp;
 rep(i,n) mp[a.at(i)]++;
 int max,min;
 if(mp.count("ziyu")){
   if(7-mp.size() >= mp["ziyu"]) max = mp.size()+mp["ziyu"]-1;
   else max = 8;

   if(mp.size() > 1) min = mp.size()-1;
   else min = 1;
   
 }
 else{
   max = mp.size();
   min = mp.size();
}
 cout << min << max << endl;

 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:26:13: error: no match for 'operator[]' (operand types are 'std::map<std::__cxx11::basic_string<char>, int>' and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'})
   26 |  rep(i,n) mp[a.at(i)]++;
      |             ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'const std::map<std::__cxx11::basic_string<char>, int>::key_type&' {aka 'const std::__cxx11::basic_string<char>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::__cxx11::basic_string<char>; _Tp = int; _Compare = std::less<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, int> >; mapped_type = int; key_type = std::__cxx11::basic_string<char>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} to 'std::map<std::__cxx11::basic_string<char>, int>::key_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using ll=long long;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF=1LL<<60;

int n;
vector<int> a(110);
set<string> rate;

int main(){
    int free=0;
    cin>>n;
    rep(i,n){
        cin>>a[i];
        if(a[i]<400) rate.insert("gray");
        else if(a[i]<800) rate.insert("brown");
        else if(a[i]<1200) rate.insert("green");
        else if(a[i]<1600) rate.insert("lblue");
        else if(a[i]<2000) rate.insert("blue");
        else if(a[i]<2400) rate.insert("yellow");
        else if(a[i]<2800) rate.insert("orange");
        else if(a[i]<3200) rate.insert("red");
        else free++;
    }

    int minv=max(1,rate.size());
    int maxv=minv+free;
    cout<<minv<<" "<<maxv<<"\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: no matching function for call to 'max(int, std::set<std::__cxx11::basic_string<char> >::size_type)'
   29 |     int minv=max(1,rate.size());
      |              ~~~^~~~~~~~~~~~~~~
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: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:29:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::set<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'})
   29 |     int minv=max(1,rate.size());
      |              ~~~^~~~~~~~~~~~~~~
/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:
/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:29:17: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |     int minv=max(1,rate.size());
      |              ~~~^~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using ll=long long;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF=1LL<<60;

int n;
vector<int> a(110);
set<string> rate;

int main(){
    int free=0;
    cin>>n;
    rep(i,n){
        cin>>a[i];
        if(a[i]<400) rate.insert("gray");
        else if(a[i]<800) rate.insert("brown");
        else if(a[i]<1200) rate.insert("green");
        else if(a[i]<1600) rate.insert("lblue");
        else if(a[i]<2000) rate.insert("blue");
        else if(a[i]<2400) rate.insert("yellow");
        else if(a[i]<2800) rate.insert("orange");
        else if(a[i]<3200) rate.insert("red");
        else free++;
    }

    int minv=max(1,arate.size());
    int maxv=minv+free;
    cout<<minv<<" "<<maxv<<"\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: 'arate' was not declared in this scope; did you mean 'rate'?
   29 |     int minv=max(1,arate.size());
      |                    ^~~~~
      |                    rate
Language: C++

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

int main() {

	const int p = 8;
	int n; cin >> n;
	vector<int> num(p + 1, 0);
	int free = 0;
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		for (int j = 1; j <= p; j++) {
			if (400 * (j - 1) <= a && a < 400 * j) {
				num[j] = 1;
			}
		}
		if (400 * p <= a) free++;
	}
	int ans = 0;
	for (int i = 0; i < p + 1; i++) {
		if (1 == num[i]) ans++;
	}
	cout << ans << " " << ans + free << endl;
	return 0;
}#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {

	const int p = 8;
	int n; cin >> n;
	vector<int> num(p + 1, 0);
	int free = 0;
	for (int i = 0; i < n; i++) {
		int a; cin >> a;
		for (int j = 1; j <= p; j++) {
			if (400 * (j - 1) <= a && a < 400 * j) {
				num[j] = 1;
			}
		}
		if (400 * p <= a) free++;
	}
	int ans = 0;
	for (int i = 0; i < p + 1; i++) {
		if (1 == num[i]) ans++;
	}
	cout << ans << " " << ans + free << endl;
	return 0;
}

Compiler output:
a.cc:26:2: error: stray '#' in program
   26 | }#include <bits/stdc++.h>
      |  ^
a.cc:26:3: error: 'include' does not name a type
   26 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:30:5: error: redefinition of 'int main()'
   30 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int getMin(int min, int &wild){
    if (min == 0){
      	wild--;
        return 1;
    }else{
        return min;
    }
}
 
int getMax(int min, int wild){
    int max = 0;
    
    // if (min + wild >= 8){
    //     max = 8;
    // }else{
    //     max = min + wild;
    // }
    max = min + wild
 
    return max;
}
 
int main(){
 
    int n;
    cin >> n;
 
    vector<bool> colors(8, false);
    int wild = 0;
 
    for (int i = 0; i<n; i++){
        int a;
        cin >> a;
        if (a >= 3200){
            wild++;
            continue;
        }
        
        colors.at(a/400) = true;
    }
 
    int min = 0;
    int max = 0;
 
    for (bool i: colors){
        if (i){
            min++;
        }
    }
 
    min = getMin(min, wild);
    max = getMax(min, wild);
    
    cout << min << " " << max << endl;
 
    return 0;    
}


Compiler output:
a.cc: In function 'int getMax(int, int)':
a.cc:21:21: error: expected ';' before 'return'
   21 |     max = min + wild
      |                     ^
      |                     ;
   22 | 
   23 |     return max;
      |     ~~~~~~           
a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
   24 | }
      | ^
Language: C++

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

int main(){
  int n;
  cin >> n;

  const int NUM_RATE = 9;//レート帯の数

  //レートからレート帯の番号を返す関数
  auto rate_to_idx = [&](int r){
    vector<P> edges;
    edges.push_back(make_pair(1,399));
    edges.push_back(make_pair(400,799));
    edges.push_back(make_pair(800,1199));
    edges.push_back(make_pair(1200,1599));
    edges.push_back(make_pair(1600,1999));
    edges.push_back(make_pair(2000,2399));
    edges.push_back(make_pair(2400,2799));
    edges.push_back(make_pair(2800,3199));
    edges.push_back(make_pair(3200,4800));

    rep(i,NUM_RATE){
      int lower = edges[i].first;
      int upper = edges[i].second;
      if(lower<=r&&r<=upper) return i;
    }

  };

  vector<int> p(NUM_RATE,0);//各レート帯の人数

  rep(i,n){
    int a;
    cin >> a;
    p[rate_to_idx(a)]++;
  }

  int zeros = 0;//人がいない色固定レート帯の数
  int exist_cols = 0;//人がいる色固定レート帯の数
  int strong = p[NUM_RATE-1];//色フリー帯にいる人数

  rep(i,NUM_RATE-1){
    if(p[i]==0) zeros++;
    else exist_cols++;
  }

  int ans_min = max(exist_cols,1);
  int ans_max = exist_cols + min(zeros,strong);
  int ans_max = min(exist_cols + strong,8);
  printf("%d %d\n",ans_min,ans_max);

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:7: error: redeclaration of 'int ans_max'
   53 |   int ans_max = min(exist_cols + strong,8);
      |       ^~~~~~~
a.cc:52:7: note: 'int ans_max' previously declared here
   52 |   int ans_max = exist_cols + min(zeros,strong);
      |       ^~~~~~~
a.cc: In lambda function:
a.cc:32:3: warning: control reaches end of non-void function [-Wreturn-type]
   32 |   };
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
cout << fixed << setprecision(10);
ll n;
cin>>n;
ll s[10]={};
ll a;
ll ca=0;
for(ll i=0; i<n; i++){
cin>>a;
if(0<=a&&a<400){
s[0]++;}
else if(400<=a&&a<800){
s[1]++;}
else if(800<=a&&a<1200){
s[2]++;}
else if(1200<=a&&a<1600){
s[3]++;}
else if(1600<=a&&a<2000){
s[4]++;}
else if(2000<=a&&a<2400){
s[5]++;}
else if(2400<=a&&a<2800){
s[6]++;}
else if(2800<=a&&a<3200){
s[7]++;} 
else 
s[8]++;}
for(ll i=0; i<=7; i++){
if(s[i]>0){
ca++;}}
cout<<ca<<" "<<min(8,ca+(int)s[8])<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:19: error: no matching function for call to 'min(int, ll)'
   49 | cout<<ca<<" "<<min(8,ca+(int)s[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:   template argument deduction/substitution failed:
a.cc:49:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   49 | cout<<ca<<" "<<min(8,ca+(int)s[8])<<endl;}
      |                ~~~^~~~~~~~~~~~~~~~
/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:49:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   49 | cout<<ca<<" "<<min(8,ca+(int)s[8])<<endl;}
      |                ~~~^~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
// nCk を取得
double nCk(int n, int k) {
double res=1.0;
for(int i=0; i<n; i++){
res*=0.5;}
for(int i=0; i<k; i++){
res*=(double)(n-i);
res/=(double)(k-i);
}
return res;}
 
int main() {
cout << fixed << setprecision(10);
ll n;
cin>>n;
ll s[10]={};
ll a;
ll ca=0;
for(ll i=0; i<n; i++){
cin>>a;
if(0<=a&&a<400){
s[0]++;}
else if(400<=a&&a<800){
s[1]++;}
else if(800<=a&&a<1200){
s[2]++;}
else if(1200<=a&&a<1600){
s[3]++;}
else if(1600<=a&&a<2000){
s[4]++;}
else if(2000<=a&&a<2400){
s[5]++;}
else if(2400<=a&&a<2800){
s[6]++;}
else if(2800<=a&&a<3200){
s[7]++;} 
else 
s[8]++;}
for(ll i=0; i<=7; i++){
if(s[i]>0){
ca++;}}
cout<<ca<<" "<<min(8,ca+s[8])<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:19: error: no matching function for call to 'min(int, ll)'
   49 | cout<<ca<<" "<<min(8,ca+s[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:   template argument deduction/substitution failed:
a.cc:49:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   49 | cout<<ca<<" "<<min(8,ca+s[8])<<endl;}
      |                ~~~^~~~~~~~~~~
/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:49:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   49 | cout<<ca<<" "<<min(8,ca+s[8])<<endl;}
      |                ~~~^~~~~~~~~~~
Language: C++

#include <bits/std++.h>
using namespace std;
 
int rate(int x){
  if(x>=1 && x<=399){
    return 0;
  }else if(x>=400 && x<=799){
    return 1;
  }else if(x>=800 && x<=1199){
    return 2;
  }else if(x>=1200 &&x<=1599){
    return 3;
  }else if(x>=1600 && x<=1999){
    return 4;
  }else if(x>=2000 && x<=2399){
    return 5;
  }else if(x>=2400 && x<=2799){
    return 6;
  }else if(x>=2800 && x<=3199){
    return 7;
  }else{
    return 8;
  }
}


int main() {
  int N;
  cin >> N;
  
  vector<int> count(9,0);
  
  vector<int> a(N);
  for(int i=0; i<N; i++){
    cin >> a[i];
    
    int color;
    color=rate(a[i]);
    count[color]++;
  }
  
  int answer=0;
  for(int i=0; i<8;i++){
    if(count[i]!=0){
      answer++;
    }
  }
  
  cout << answer<<" ";
   
  cout <<answer+count[8] << endl;   
  
}
  

Compiler output:
a.cc:1:10: fatal error: bits/std++.h: No such file or directory
    1 | #include <bits/std++.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.Scanner;

public class ColorfulLeaderBoard {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		Scanner sc=new Scanner(System.in);

        //コンテストの参加人数
        int N=sc.nextInt();
        //各参加者のレート数配列
        int[] a=new int[N];
        //色を数えるための配列
        int[] colorCount=new int[8];

        //合計色のカウント
        int sumColor=0;
        int max=0;
        int min=0;

        //自由に色を変更可能な人数をカウント
        int freeColor=0;

        //各参加者のレート数と色のカウント
        for(int i=0;i<N;i++) {
            a[i]=sc.nextInt();

            if(1<=a[i]&&a[i]<399) {
                //灰色
                colorCount[0]=1;
            }else if(400<=a[i]&&a[i]<=799) {
                //茶色
                colorCount[1]=1;
            }else if(800<=a[i]&&a[i]<=1199) {
                //緑色
                colorCount[2]=1;
            }else if(1200<=a[i]&&a[i]<=1599) {
                //水色
                colorCount[3]=1;
            }else if(1600<=a[i]&&a[i]<=1999) {
                //青色
                colorCount[4]=1;
            }else if(2000<=a[i]&&a[i]<=2399) {
                //黄色
                colorCount[5]=1;
            }else if(2400<=a[i]&&a[i]<=2799) {
                //橙色
                colorCount[6]=1;
            }else if(2800<=a[i]&&a[i]<=3199) {
                //赤色
                colorCount[7]=1;
            }else if(3200<=a[i]) {
                //色自由の人
                freeColor += 1;
            }
        }

        //何色あるかカウント
        for(int count:colorCount) {
            sumColor +=count;
        }

        //最大値・最小値を出力
        if(freeColor == 0) {
            System.out.println(sumColor+" "+sumColor);
        }else {
            //最小値出力
            min = 1;
            if(sumColor != 0) {
                min = sumColor;
            }

            //最大値出力
            sumColor += freeColor;
            if(sumColor >= 8){
                max = 8;
            }else{
                max = sumColor;
            }
            System.out.println(min+" "+max);
        }

	}

}


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

import java.util.Scanner;

 

public class Main {
    public static void main(String[] args) {
        // TODO 自動生成されたメソッド・スタブ
        
        Scanner sc=new Scanner(System.in);
        
        //コンテストの参加人数
        int N=sc.nextInt();
        //各参加者のレート数配列
        int[] a=new int[N];
        //色を数えるための配列
        int[] colorCount=new int[7];
        
        //合計色のカウント
        int sumColor=0;
        int max=0;
        int min=0;
        
        //自由に色を変更可能な人数をカウント
        int freeColor=0;
        
        //各参加者のレート数と色のカウント
        for(int i=0;i<N;i++) {
            a[i]=sc.nextInt();
            
            if(1<=a[i]&&a[i]<399) {
                //灰色
                colorCount[0]=1;
            }else if(400<=a[i]&&a[i]<=799) {
                //茶色
                colorCount[1]=1;
            }else if(800<=a[i]&&a[i]<=1199) {
                //緑色
                colorCount[2]=1;
            }else if(1200<=a[i]&&a[i]<=1599) {
                //水色
                colorCount[3]=1;
            }else if(1600<=a[i]&&a[i]<=1999) {
                //青色
                colorCount[4]=1;
            }else if(2000<=a[i]&&a[i]<=2399) {
                //黄色
                colorCount[5]=1;
            }else if(2400<=a[i]&&a[i]<=2799) {
                //橙色
                colorCount[6]=1;
            }else if(2800<=a[i]&&a[i]<=3199) {
                //赤色
                colorCount[7]=1;
            }else if(3200<=a[i]) {
                //色自由の人
                freeColor += 1
            }
        }
        
        //最大値・最小値を出力
        if(freeColor == 0) {
            System.out.println(sumColor+" "+sumColor);
        }else {
        	//最小値出力
            if(freeColor == 0) {
                min = 1;
            }else {
                min = sumColor;
            }
            
	        //最大値出力
	        if(freeColor+sumColor <= 8){
	        	sumColor += freeColor;
	        }
	        if(sumColor >= 8){
	        	max = 8;
	        }else{
	        	max = sumColor;
	        }
			System.out.println(min+" "+max);
        }
    }
}

Compiler output:
Main.java:56: error: ';' expected
                freeColor += 1
                              ^
1 error
Language: C++

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

int main(){
    int n;
    cin >> n;
    vector<int> col(9, 0);
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
        col[max(a/400, 8)]++;
    }

    int ans = 0;
    for(int i = 0; i < 8; i++){
        if(col[i] != 0) ans++; 
    }
    int ma = ans + col[8];
    ma = min(ma, 8);
    int mi = max(ans, col[8]);
    int mi = min(mi, 8);
    cout << mi << ' ' << ma << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: redeclaration of 'int mi'
   21 |     int mi = min(mi, 8);
      |         ^~
a.cc:20:9: note: 'int mi' previously declared here
   20 |     int mi = max(ans, col[8]);
      |         ^~
Language: C++

#include <iostream>
using names

#include <iostream>
using namespace std;

int main() {
  int colo[9]={};
  int n;
  cin>>n;
  int arr[n];
  for (int i=0; i<n; i++){
    cin >> arr[i];
  }
  for (int i=0; i<n; i++){
    for(int j = 0; j <=7;j++){
      if(400 * j <=arr[i] && arr[i] < 400 * (j + 1))colo[j]++;
    }
if(arr[i] > 3200)colo[8]++;
  }
  int total=0;
  for (int i=0; i<8; i++){
    if (colo[i]>0) total++;
  }
  if ( total>0 ) cout << total << ' ' << total+colo[8] << endl; 
  else cout << 1 << ' ' << colo[8] << endl; 
return 0;
}



Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'names'
    2 | using names
      |       ^~~~~
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   cin>>n;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:25:18: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   25 |   if ( total>0 ) cout << total << ' ' << total+colo[8] << endl;
      |                  ^~~~
      |                  std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:25:59: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   25 |   if ( total>0 ) cout << total << ' ' << total+colo[8] << endl;
      |                                                           ^~~~
      |                                                           std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:26:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |   else cout << 1 << ' ' << colo[8] << endl;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:26:39: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   26 |   else cout << 1 << ' ' << colo[8] << endl;
      |                                       ^~~~
      |                                       std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus < 201703L
#        pragma GCC target("avx")
#    else
#        pragma GCC target("avx2")
#    endif

#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;
typedef long double Ld;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

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

    vector<int> c(9);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;

        if (a <= 399) {
            c[0]++;
        } else if (a <= 799) {
            c[1]++;
        } else if (a <= 1199) {
            c[2]++;
        } else if (a <= 1599) {
            c[3]++;
        } else if (a <= 1999) {
            c[4]++;
        } else if (a <= 2399) {
            c[5]++;
        } else if (a <= 2799) {
            c[6]++;
        } else if (a <= 3199) {
            c[7]++;
        } else {
            c[8]++;
        }
    }

    int ansmin = 0, ansmax = 0;
    for (int i = 0; i < 8; i++) {
        if (c[i] != 0) {
            ansmin++;
        }
    }
    ansmax += ansmin;
    if (c[8] != 0) {
        ansmax += min(8 - ansmin, c[8], 8);
    }

    cout << ansmin << ' ' << ansmax << 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:19:
/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:70:22:   required from here
   70 |         ansmax += min(8 - ansmin, c[8], 8);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include"bits/stdc++.h"


#define rep(i, N) for(int i = 0;i < N;i++)
typedef long long ll;
const int mod = 1e9 + 7;

using namespace std;

int main(void) {
	int N; cin >> N;
	vector<int> a(N);
	rep(i, N)cin >> a[i];
	set<int> s;
	int x = 0;
	
	rep(i, N) {
		if (a[i] < 399)s.insert(0);
		else if (a[i] < 799)s.insert(1);
		else if (a[i] < 1199)s.insert(2);
		else if (a[i] < 1599)s.insert(3);
		else if (a[i] < 1999)s.insert(4);
		else if (a[i] < 2399)s.insert(5);
		else if (a[i] < 2799)s.insert(6);
		else if (a[i] < 3199)s.insert(7);
		else x++;
	}

	cout << (s.size()==0?1:s.size()) << " " << min(s.size()+x, 8) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:55: error: no matching function for call to 'min(std::set<int>::size_type, int)'
   29 |         cout << (s.size()==0?1:s.size()) << " " << min(s.size()+x, 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:   template argument deduction/substitution failed:
a.cc:29:55: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   29 |         cout << (s.size()==0?1:s.size()) << " " << min(s.size()+x, 8) << endl;
      |                                                    ~~~^~~~~~~~~~~~~~~
/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:29:55: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   29 |         cout << (s.size()==0?1:s.size()) << " " << min(s.size()+x, 8) << endl;
      |                                                    ~~~^~~~~~~~~~~~~~~
Language: C++

using namespace std;
using ll = long long int;
using pii = pair<int, int>;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0; i<(int)(n); i++)

ll GCD(ll c, ll d){
  if(c<d)swap(c,d);
  if(c%d==0)return d;
  else{return GCD(c%d,d);}
}

int main() {
  int n;cin>>n;
  vector<int> v(n);

  rep(i,n){
    cin>>v.at(i);
    v.at(i)/=400;
  }
    
  set<int> s;
  int c=0;
  rep(i,n){
    if(v.at(i)==8){c++;}
    else{s.insert(v.at(i));}
  }
  int count=s.size();
  cout<<max(c,count)<<" "<<min(count+c,8);
}
      



Compiler output:
a.cc:3:13: error: 'pair' does not name a type
    3 | using pii = pair<int, int>;
      |             ^~~~
a.cc: In function 'll GCD(ll, ll)':
a.cc:8:10: error: 'swap' was not declared in this scope
    8 |   if(c<d)swap(c,d);
      |          ^~~~
a.cc: In function 'int main()':
a.cc:14:9: error: 'cin' was not declared in this scope
   14 |   int n;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 | using namespace std;
a.cc:15:3: error: 'vector' was not declared in this scope
   15 |   vector<int> v(n);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:15:10: error: expected primary-expression before 'int'
   15 |   vector<int> v(n);
      |          ^~~
a.cc:18:10: error: 'v' was not declared in this scope
   18 |     cin>>v.at(i);
      |          ^
a.cc:22:3: error: 'set' was not declared in this scope
   22 |   set<int> s;
      |   ^~~
a.cc:1:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
  +++ |+#include <set>
    1 | using namespace std;
a.cc:22:7: error: expected primary-expression before 'int'
   22 |   set<int> s;
      |       ^~~
a.cc:25:8: error: 'v' was not declared in this scope
   25 |     if(v.at(i)==8){c++;}
      |        ^
a.cc:26:10: error: 's' was not declared in this scope
   26 |     else{s.insert(v.at(i));}
      |          ^
a.cc:28:13: error: 's' was not declared in this scope
   28 |   int count=s.size();
      |             ^
a.cc:29:3: error: 'cout' was not declared in this scope
   29 |   cout<<max(c,count)<<" "<<min(count+c,8);
      |   ^~~~
a.cc:29:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:29:9: error: 'max' was not declared in this scope
   29 |   cout<<max(c,count)<<" "<<min(count+c,8);
      |         ^~~
a.cc:29:28: error: 'min' was not declared in this scope; did you mean 'main'?
   29 |   cout<<max(c,count)<<" "<<min(count+c,8);
      |                            ^~~
      |                            main
Language: Java

import java.util.*;

public class Main{
	
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
  	int n=sc.nextInt(),min=0,max=0,f=0;
    int[] a=new int[n],color=new int[8];
    for(int i=0;i<n;i++){
      a[i]=sc.nextInt();
      if(a[i]<400&&color[0]==0){
        color[0]++;
        min++;
        max++;
        f++;
      }else if(a[i]>=400&&a[i]<800&&color[1]==0){
        color[1]++;
        min++;
        max++;
        f++;
      }else if(a[i]>=800&&a[i]<1200&&color[2]==0){
        color[2]++;
        min++;
        max++;
        f++;
      }else if(a[i]>=1200&&a[i]<1600&&color[3]==0){
        color[3]++;
        min++;
        max++;
        f++;
      }else if(a[i]>=1600&&a[i]<2000&&color[4]==0){
        color[4]++;
        min++;
        max++;
        f++;
      }else if(a[i]>=2000&&a[i]<2400&&color[5]==0){
        color[5]++;
        min++;
        max++;
        f++;
      }else if(a[i]>=2400&&a[i]<2800&&color[6]==0){
        color[6]++;
        min++;
        max++;
        f++;
      }else if(a[i]>=2800&&a[i]<3200&&color[7]==0){
        color[7]++;
        min++;
        max++;
        f++;
      }else if(a[i]>=3200){
        if(i==0){
          min++;
          max++;
        }else{
          max++;
        }
      }
    }
    if(n>=2){
      if(a[0]>=3200&&f>0){
        c--;
      }
    }
    System.out.println(min+" "+max);
  }
}


Compiler output:
Main.java:62: error: cannot find symbol
        c--;
        ^
  symbol:   variable c
  location: class Main
1 error
Language: C++

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

int main(){
    int n;
    cin >> n;

    vector<int> field(9, 0);
    for (int i = 0; i<n; i++){
        int a;
      	cin >> a;

        if (a < 3200){
            field.at(a/400)++;
        }else{
            field.at(8)++;
        }
    }

    int counter = 0;
    for (int i = 0; i<8; i++){
        if (field.at(i) != 0){
            counter++;
        }
    }

    if (field.at(8) != 0){
        if (counter != 0){
            if (field.at(8) <= 8-counter){
                cout << counter << " " << counter+field.at(8) << endl;
            }else{
                cout << counter << " " << 8 << endl;
            }
        }else{
            if (field.at(8) <= 8){
                cout << 1 << " " << field.at(8) << else;
            }else{
                cout << 1 << " " << 8;
            }
        }
    }else{
        cout << counter << " " << counter << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:52: error: expected primary-expression before 'else'
   36 |                 cout << 1 << " " << field.at(8) << else;
      |                                                    ^~~~
Language: C

#include<stdio.h>

int main(){

  int color[9] = {0};
  int n;
  int min = 0;
  int max = 0;
  scanf("%d",&n);

  int a;
  for(int i = 0; i < n ; ++i){
    scanf("%d",&a);
    if(a <= 399) color[0] = 1;
    else if(a <= 799) color[1] = 1;
    else if(a <= 1199) color[2] = 1;
    else if(a <= 1599) color[3] = 1;
    else if(a <= 1999) color[4] = 1;
    else if(a <= 2399) color[5] = 1;
    else if(a <= 2799) color[6] = 1;
    else if(a <= 3199) color[7] = 1;
    else color[8] += 1;
  }

  for(int i = 0; i < 8 ; ++i){
    min += color[i];
  }
  if(min == 0){
    min = color[8];
    max = min
  }else{
    max = min + color[8];
  }
  printf("%d %d", min, max);
  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:30:14: error: expected ';' before '}' token
   30 |     max = min
      |              ^
      |              ;
   31 |   }else{
      |   ~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
int main()
{
  int N;
  cin >> N;
  vector<int> a(N);
  int ra[9] = {0};
  rep(i, N)
  {
    int tmp;
    cin >> tmp;
    a[i] = tmp;
    if (tmp / 400 < 8)
    {
      ra[tmp / 400]++;
    }
    else
    {
      ra[8]++;
    }
  }
  int mini = 0;
  rep(i, 8)
  {
    if (ra[i] > 0)
    {
      mini++;
    }
  }
  mini = min(mini, (ra[8])?1:200000));
  int maxi = max(mini + ra[8], mini);
  cout << mini << " " << maxi << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:37: error: expected ';' before ')' token
   33 |   mini = min(mini, (ra[8])?1:200000));
      |                                     ^
      |                                     ;
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i ,n) for(int i = 0 ; i < (n) ; i ++ )
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using vin=vector<int>;
const int inf=1e9+7;
const ll INF=1e18;


int main() {
  int n;
  cin>>n;
  vin a(n);
  rep(i,n) cin>>a[i];
  /////////
  vector<bool> b(8,false);
  int ans=0;
  int cnt=0;
  rep(i,n){ //a[i]について
    rep(j,8){  //何色か
       if(a[i]>=3200){
         cnt++;
         break;
       }
       else if(a[i]/400==j){
         b[j]=true; 
       }
      
    }//repj
    
  }//repi
  rep(i,8){
    if(b[i]) {ans++;
  }
  if(ans==0) {
    ans++;
    cnt--;
  }
  cout<<ans<<" "<<ans+cnt<<endl;
}

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

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i ,n) for(int i = 0 ; i < (n) ; i ++ )
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using vin=vector<int>;
const int inf=1e9+7;
const ll INF=1e18;


int main() {
  int n;
  cin>>n;
  vin a(n);
  rep(i,n) cin>>a[i];
  /////////
  vector<bool> b(8,false);
  int ans=0;
  int cnt=0;
  rep(i,n){ //a[i]について
    rep(j,8){  //何色か
       if(a[i]>=3200){
         cnt++;
         break;
       }
       else if(a[i]/400==j){
         b[j]=true; 
       }
      
    }//repj
    
  }//repi
  rep(i,8){
    if(b[i]) {ans=++
  }
  if(ans==0) {
    ans++;
    cnt--;
  }
  cout<<ans<<" "<<ans+cnt<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:3: error: expected primary-expression before '}' token
   36 |   }
      |   ^
a.cc:42:2: error: expected '}' at end of input
   42 | }
      |  ^
a.cc:12:12: note: to match this '{'
   12 | int main() {
      |            ^
Language: Java

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

public class CheckAll {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count3200 = 0;
        Set<Integer> set = new HashSet<>();
        for (int i = 0; i < n; i++) {
            int a = scanner.nextInt();
            if (a < 3200) {
                set.add(a/400);
            } else {
                count3200++;
            }
        }

        int min = set.size();
        int max = Math.min(8, set.size() + count3200);
        System.out.println(min + " "+ max);

    }
}

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

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

public class CheckAll {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int count3200 = 0;
        Set<Integer> set = new HashSet<>();
        for (int i = 0; i < n; i++) {
            int a = scanner.nextInt();
            if (a < 3200) {
                set.add(a/400);
            } else {
                count3200++;
            }
        }

        int min = set.size();
        int max = Math.min(8, set.size() + count3200);
        System.out.print(min + " "+ max);
        
    }
}

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

#include <iostream>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <cmath>
#include <tuple>
#include <cassert>
#include <array>
#include <iomanip>

using namespace std;
using pii = pair<int, int>;
using ti = tuple<int, int, int>;

const double eps=1e-14;
const int mod = 1e9 + 7;
const int inf = ((1<<30));
const long long linf = (1LL<<60);

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    map<int, int> mp;
    for(int i=0; i<n; i++)
    {
        int rate;
        cin >> rate;
        if(rate<400) mp[0]++;
        else if(rate<800) mp[1]++;
        else if(rate<1200) mp[2]++;
        else if(rate<1600) mp[3]++;
        else if(rate<2000) mp[4]++;
        else if(rate<2400) mp[5]++;
        else if(rate<2800) mp[6]++;
        else if(rate<3200) mp[7]++;
        else mp[8]++;
    }
    int ans = 0:
    for(int i=0; i<8; i++) if(mp[i] > 0) ans++;
    ans = min(8, ans+mp[8]);
    cout << ans << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:55:16: error: expected ',' or ';' before ':' token
   55 |     int ans = 0:
      |                ^
a.cc:56:18: error: 'i' was not declared in this scope
   56 |     for(int i=0; i<8; i++) if(mp[i] > 0) ans++;
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll  = long long;
using vvl = vector<vector<ll>>;
using vl  = vector<ll>;
#define _GLIBCXX_DEBUG
#define acc_io cin.tie(0);ios::sync_with_stdio(false)
#define all(x) x.begin(),x.end()
#define rep(i,sta,end) for(ll i=sta;i<end;i++)
#define lcm(a,b) (a)/__gcd((a),(b))*(b)
#define pb push_back
const ll MOD = 1000000007;
const double PI = acos(-1);  
//name[i]   -> vl  name(i)
//name[i][j]-> vvl name(i,vl(j))
//or-> ||
//map<int,int>mp

ll n;
ll ans;
//string s;
signed main(){
	acc_io;
	ans=0;
	cin>>n;
	int a;
	int col[10]={0};
	rep(i,0,n){
		cin>>a;
		if(a<400) col[0]++;
		else if(a<800)  col[1]++;
		else if(a<1200) col[2]++;
		else if(a<1600) col[3]++;
		else if(a<2000) col[4]++;
		else if(a<2400) col[5]++;
		else if(a<2800) col[6]++;
		else if(a<3200) col[7]++;
		else            col[8]++;
	}
	int min=0;
	rep(i,0,8){
		if(col[i]) min++;
	}
	int max;
	max=min+col[8];
	max=min(8,max);
	cout<<min<<" "<<max<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:16: error: 'min' cannot be used as a function
   46 |         max=min(8,max);
      |             ~~~^~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int N;
  cin >> N;

  bool colors[8] = {false};
  int free = 0;
  
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (a <= 399) colors[0] = true;
    else if (a <= 799) colors[1] = true;
    else if (a <= 1199) colors[2] = true;
    else if (a <= 1599) colors[3] = true;
    else if (a <= 1999) colors[4] = true;
    else if (a <= 2399) colors[5] = true;
    else if (a <= 2799) colors[6] = true;
    else if (a <= 3199) colors[7] = true;
    else free++;
  }
  
  int ans_min = 0;
  for (int i = 0; i < 8 i++) {
    if (colors[i]) ans_min++;
  }
  if (ans_min==0) ans_min = 1;
  
  int ans_max = ans_min + free;
  if (ans_max > 8) ans_max = 8;
  
  cout << ans_min << " " << ans_max << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:24: error: expected ';' before 'i'
   26 |   for (int i = 0; i < 8 i++) {
      |                        ^~
      |                        ;
Language: C++

#include <iostream>
using namespace std;
int main()
{
  int N;
  cin >> N;

  bool colors[8] = {false};
  int free = 0;
  
  for (int i = 0: i < N; i++) {
    int a;
    cin >> a;
    if (a <= 399) colors[0] = true;
    else if (a <= 799) colors[1] = true;
    else if (a <= 1199) colors[2] = true;
    else if (a <= 1599) colors[3] = true;
    else if (a <= 1999) colors[4] = true;
    else if (a <= 2399) colors[5] = true;
    else if (a <= 2799) colors[6] = true;
    else if (a <= 3199) colors[7] = true;
    else free++;
  }
  
  int ans_min = 0;
  for (int i = 0; i < 8 i++) {
    if (colors[i]) ans_min++;
  }
  if (ans_min==0) ans_min = 1;
  
  int ans_max = ans_min + free;
  if (ans_max > 8) ans_max = 8;
  
  cout << ans_min << " " << ans_max << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: initializer in range-based 'for' loop
   11 |   for (int i = 0: i < N; i++) {
      |              ^
a.cc:11:24: error: expected ')' before ';' token
   11 |   for (int i = 0: i < N; i++) {
      |       ~                ^
      |                        )
a.cc:11:26: error: 'i' was not declared in this scope
   11 |   for (int i = 0: i < N; i++) {
      |                          ^
a.cc:26:24: error: expected ';' before 'i'
   26 |   for (int i = 0; i < 8 i++) {
      |                        ^~
      |                        ;