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

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <iomanip>
#include <queue>
#include <deque>
#include <sstream>
#include <stdio.h>
#include <string>
#include <cmath>
#include <map>
#include <utility>
using namespace std;

#define s(n) scanf("%d",&n)
#define sc(n) scanf("%c",&n)
#define ss(n) scanf("%s",&n)
#define MOD 1000000007
#define ll long long int
#define vi vector<int>
#define vii vector< vector<int> >
#define PI 3.1415926535897932384626433832795

int color(int x) {
	if(x >= 1 && x<= 399) {
		return 0;
	}
	if(x >= 400 && x<= 799) {
		return 1;
	}
	if(x >= 800 && x<= 1199) {
		return 2;
	}
	if(x >= 1200 && x<= 1599) {
		return 3;
	}
	if(x >= 1600 && x<= 1999) {
		return 4;
	}
	if(x >= 2000 && x<= 2399) {
		return 5;
	}
	if(x >= 2400 && x<= 2799) {
		return 6;
	}
	if(x >= 2800 && x<= 3199) {
		return 7;
	}
	return 8;
}

int main() {
	int n;
	cin >> n;
	vector<bool> was (8,false);
	int count3200 = 0;
	int max = 0;
	for(int i = 0; i < n; i++) {
		int x;
		cin >> x;
		int col = color(x);
		if(col == 8) {
			count3200++;
		} else {
			was[col] = true;
		}
	}
	int count = 0;
	for(int i = 0; i < 8; i++) {
		if(was[i]) {
			count++;
		}
	}
	cout << max(1,count) << " " << (count+count3200);
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:76:20: error: 'max' cannot be used as a function
   76 |         cout << max(1,count) << " " << (count+count3200);
      |                 ~~~^~~~~~~~~
Language: C++

#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <iostream>
using namespace std;
int s[105];
int main()
{
	int n,a,cnt = 0,ma = 0,ans = 0;
	while(~scanf("%d",&n)){
		int cnt = 0, ma = 0, ans = 0;
		for(int i = 1; i <= n; i++)
		{

			scanf("%d",&a);
			if(a<400 && a>= 1) s[1] = 1;
			else if(a <= 799 && a >= 400) s[2] = 1;
			else if(a <= 1199 && a >= 800) s[3] = 1;
			else if(a <= 1599 && a >= 1200) s[4] = 1;
			else if(a <= 1999 && a >= 1600) s[5] = 1;
			else if(a <= 2399 && a >= 2000) s[6] = 1;
			else if(a <= 2799 && a >= 2400) s[7] = 1;
			else if(a <= 3199 && a >= 2800) s[8] = 1;
			else cnt++;
		}

		for(int i = 1; i <= 8; i++)
			ans += s[i];
		ma = max(ans,1);
		printf("%d %d\n",ma,ma + cnt); 
		memset(s,0,sizeof(s));
	}
return0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:1: error: 'return0' was not declared in this scope
   35 | return0;
      | ^~~~~~~
Language: C++

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);
 
#define REP(i,n)	for(int i=0;i<(int)n;++i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define FOR(i,s,n)	for(int i=s;i<(int)n;++i)
 
int n, a;
int cnt[9];
 
int main(int argc, char **argv) {
	cin >> n;
	clear(cnt);
	REP(i, n) {
		cin >> a;
		++cnt[min(3200, a) / 400];
	}
	int res = 0;
	REP(i, 8) if (cnt[i] != 0) ++res;
	if (res == 0)  cout << (cnt[8] != 0 ? 1 : 0) << ' ' << min(8, cnt[8]) << endl;
	else cout << res << ' ' << min(8, res + cnt[8]) << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:45:9: error: 'clear' was not declared in this scope
   45 |         clear(cnt);
      |         ^~~~~
Language: C++

#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<count>
using namespace std;

int main(void)
{
	int N;
	cin >> N;

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

		cnt[min((int)cnt.size()-1, a/400)]++;
	}

	int ret_min, ret_max;
	ret_min = cnt.size()-1 - count(cnt.begin(), cnt.end()-1, 0);

	ret_max = min((int)cnt.size(), ret_min + cnt[cnt.size()-1]);
	if(ret_min == 0)
		ret_min = 1;

	cout << ret_min << " " << ret_max << endl;

	return 0;
}


Compiler output:
a.cc:5:9: fatal error: count: No such file or directory
    5 | #include<count>
      |         ^~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

int main(void)
{
	int N;
	cin >> N;

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

		cnt[min((int)cnt.size()-1, a/400)]++;
	}

	int ret_min, ret_max;
	ret_min = cnt.size()-1 - count(cnt.begin(), cnt.end()-1, 0);

	ret_max = min((int)cnt.size(), ret_min + cnt[cnt.size()-1]);
	if(ret_min == 0)
		ret_min = 1;

	cout << ret_min << " " << ret_max << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:34: error: 'count' was not declared in this scope; did you mean 'cnt'?
   22 |         ret_min = cnt.size()-1 - count(cnt.begin(), cnt.end()-1, 0);
      |                                  ^~~~~
      |                                  cnt
Language: C

#include <stdio.h>
int main()
{
  int N,a[100],i,j,gle=0,bro=0,gr=0,miz=0,blue=0,yel=0,dai=0,red=0,min=0,max=0,cnt=0;
  scanf("%d",&N);
  for(i=0;i<N;i++)
    {
      scanf("%d",&a[i]);
    }
  for(i=0;i<N;i++)
    {
      if(a[i]<399)
	{
	  if(gle==0)
	    {
	      cnt++;
	      gle++;
	      max++;
	      min++;
	    }
	}
      else if(a[i]<799)
	{
	  if(bro==0)
	    {
	      cnt++;
	      bro++;
	      max++;
	      min++;
	    }
	}
      else if(a[i]<1199)
	{
	  if(gr==0)
	    {
	      cnt++;
	      gr++;
	      max++;
	      min++;
	    }
	}
      else if(a[i]<1599)
	{
	  if(miz==0)
	    {
	      cnt++;
	      miz++;
	      max++;
	      min++;
	    }
	}
      else if(a[i]<1999)
	{
	  if(blue==0)
	    {
	      cnt++;
	      blue++;
	      max++;
	      min++;
	    }
	}
      else if(a[i]<2399)
	{
	  if(yel==0)
	    {
	      cnt++;
	      yel++;
	      max++;
	      min++;
	    }
	}
      else if(a[i]<2799)
	{
	  if(dai==0)
	    {

	      cnt++;
	      dai++;
	      max++;
	      min++;
	    }
	}
      else if(a[i]<3199)
	{
	  if(red==0)
	    {
	      cnt++;
	      red++;
	      max++;
	      min++;
	    }
	}
    }
  for(i=0;i<N;i++)
    {
      if(a[i]>=3200)
	{
	  if(cnt<7)
	    {
	      cnt++;
	      max++;
	    }
	  if(cnt<2)
	    {
	      cnt++;
	      min++;
	      max++;
	}
    }
  printf("%d %d\n",min,max);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:112:1: error: expected declaration or statement at end of input
  112 | }
      | ^
Language: C++

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

int main()
{
    vector<int> num(9, 0);

    int N;
    cin >> N;
    for (int i = 0, a; i < N; i++) {
        cin >> a;
        num[min(a / 400, 8)]++;
    }

    int mini = 0, maxi;
    for (int i = 0; i < 8; i++)
        if (num[i])
            mini++;
    if (mini == 0) {
        mini = 1;
        maxi = min(num[8], 8);
    } else
        maxi = min(mini + num[8], 8);

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> num(9, 0);
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> num(9, 0);
      |            ^~~
a.cc:13:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   13 |         num[min(a / 400, 8)]++;
      |         ^~~
      |         enum
a.cc:18:13: error: 'num' was not declared in this scope; did you mean 'enum'?
   18 |         if (num[i])
      |             ^~~
      |             enum
a.cc:22:20: error: 'num' was not declared in this scope; did you mean 'enum'?
   22 |         maxi = min(num[8], 8);
      |                    ^~~
      |                    enum
a.cc:24:27: error: 'num' was not declared in this scope; did you mean 'enum'?
   24 |         maxi = min(mini + num[8], 8);
      |                           ^~~
      |                           enum
Language: C++

#include<stdio.h>


int main()
{
	int x = 0;
	int y = 0;
	int n,z;
	int a = 0;
	int b = 0;
	int c = 0;
	int d = 0;
	int e = 0;
	int f = 0;
	int g = 0;
	int h = 0;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &z);
		if (400>z && a == 0) {
			x++;
			a++;
		}
		if (z>=400 &&z < 800 && b ==0) {
			x++;
			b++;
		}
		if ( z>=800 && z < 1200 && c == 0) {
			x++;
			c++;
		}
		if (z>=1200&& z < 1600 && d == 0) {
			x++;
			d++;
		}
		if (z>=1600 && z < 2000 && e == 0) {
			x++;
			e++;
		}
		if (z >= 2000 && z < 2400 && f == 0) {
			x++;
			f++;
		}
		if (z >= 2400 && z < 2800 && g == 0) {
			x++;
			g++;
		}
		if (z >= 2800 && z < 3200 && h == 0) {
			x++;
			h++;
		}
		if (z >= 3200) {
			y++;
		}
	}
if(x==0){
printf("%d %d",1,y)}else{
	printf("%d %d", x, x + y);
}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:20: error: expected ';' before '}' token
   57 | printf("%d %d",1,y)}else{
      |                    ^
      |                    ;
Language: Java

//C問題
public class Main {
	public static void main(String[] args) {

		//レートで区分をわける
		//
		int rate[] = new int[10];

		//配列を0で初期化
		for(int cnt = 0;cnt < 10; cnt++) {
			rate[cnt] = 0;
		}

		//スキャナーを宣言する
	    Scanner sc = new Scanner(System.in);

	    //入力を受け取る
	    int N = Integer.parseInt(sc.next());
	    int a;

	    for(int cnt = 0; cnt < N; cnt++) {
	    	a = Integer.parseInt(sc.next());
	    	//レートで区分分け
	    	if((1 <= a)&&(a <= 399)){
	    		rate[0] = 1;
	    	}
	    	else if((400 <= a)&&(a <= 799)){
	    		rate[1] = 1;
	    	}
	    	else if((800 <= a)&&(a <= 1199)){
	    		rate[2] = 1;
	    	}
	    	else if((1200 <= a)&&(a <= 1599)){
	    		rate[3] = 1;
	    	}
	    	else if((1600 <= a)&&(a <= 1999)){
	    		rate[4] = 1;
	    	}
	    	else if((2000 <= a)&&(a <= 2399)){
	    		rate[5] = 1;
	    	}
	    	else if((2400 <= a)&&(a <= 2799)){
	    		rate[6] = 1;
	    	}
	    	else if((2800 <= a)&&(a <= 3199)){
	    		rate[7] = 1;
	    	}
	    	else if((3200 <= a)&&(a <= 4800)){
	    		rate[8] = rate[8] + 1;
	    	}
	    }

	    //スキャナーを閉じる
	    sc.close();
	    //色の合計
	    int sum = 0;

	    for (int cnt = 0;cnt < 10; cnt++) {
	    	sum = sum + rate[cnt];
	    }

	    //出力
	    //最小値
	    if((sum-rate[8]) == 0) {
	    	//sumが0の時
	    	System.out.print((sum-rate[8] + 1));
	    }
	    else {
	    	System.out.print((sum-rate[8]));
	    }

	    //最大値
	    System.out.print(" "+sum);
	}
}


Compiler output:
Main.java:15: error: cannot find symbol
	    Scanner sc = new Scanner(System.in);
	    ^
  symbol:   class Scanner
  location: class Main
Main.java:15: error: cannot find symbol
	    Scanner sc = new Scanner(System.in);
	                     ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

// 7/4 Tuesday
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main() {
	int n,ans,x=0,kizon=0;
	int color[8] = {};
	cin >> n;
	vector <int> rate(n);
	for (int i = 0; i < n; i++) {
		cin >> rate[i];
	}

	for (int i = 0; i < n; i++) {
		if (rate[i] <= 399) { color[0] = 1; }
		else if (rate[i] <= 799) { color[1] = 1; }
		else if (rate[i] <= 1199) { color[2] = 1; }
		else if (rate[i] <= 1599) { color[3] = 1; }
		else if (rate[i] <= 1999) { color[4] = 1; }
		else if (rate[i] <= 2399) { color[5] = 1; }
		else if (rate[i] <= 2799) { color[6] = 1; }
		else if (rate[i] <= 3199) { color[7] = 1; }
		else x++;
	}

	for (int i = 0; i < 8; i++) {
		if (color[i] == 1) { kizon++; }
	}

	if (kizon == 0) kizon = x; ans = kizon;
	else  ans = kizon + x;

	cout << kizon << " " << ans<< endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'else' without a previous 'if'
   35 |         else  ans = kizon + x;
      |         ^~~~
Language: C++

// 7/4 Tuesday
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main() {
	int n,x=0,kizon=0;
	int color[8] = {};
	cin >> n;
	vector <int> rate(n);
	for (int i = 0; i < n; i++) {
		cin >> rate[i];
	}

	for (int i = 0; i < n; i++) {
		if (rate[i] <= 399) { color[0] = 1; }
		else if (rate[i] <= 799) { color[1] = 1; }
		else if (rate[i] <= 1199) { color[2] = 1; }
		else if (rate[i] <= 1599) { color[3] = 1; }
		else if (rate[i] <= 1999) { color[4] = 1; }
		else if (rate[i] <= 2399) { color[5] = 1; }
		else if (rate[i] <= 2799) { color[6] = 1; }
		else if (rate[i] <= 3199) { color[7] = 1; }
		else x++;
	}

	for (int i = 0; i < 8; i++) {
		if (color[i] == 1) { kizon++; }
	}

	if (kizon == 0) kizon = x; ans = kizon;
	else  ans = kizon + x;

	cout << kizon << " " << ans<< endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:36: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |         if (kizon == 0) kizon = x; ans = kizon;
      |                                    ^~~
      |                                    abs
a.cc:35:9: error: 'else' without a previous 'if'
   35 |         else  ans = kizon + x;
      |         ^~~~
Language: Java

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

public class Main {

    public static void main(String[] args) {
	// write your code here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        List<Integer> points = new ArrayList<>();
        for(int i=0; i<n; i++) {
            points.add(sc.nextInt());
        }

        int range[] = {0,0,0,0,0,0,0,0,0};

        for(int p: points) {
            if (p < 400) range[0]++;
            else if (p < 800) range[1]++;
            else if (p < 1200) range[2]++;
            else if (p < 1600) range[3]++;
            else if (p < 2000) range[4]++;
            else if (p < 2400) range[5]++;
            else if (p < 2800) range[6]++;
            else if (p < 3200) range[7]++;
            else range[8]++;
        }

        int count = 0;

        for(int i=0; i<8; i++) {
            if (range[i] > 0) count++;
        }

//        int max = count + range[8] < 9 ? count + range[8] : 8;
        int max = count + range[8];
        System.out.println(count + " " + max);
    }

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

#include<iostream>
using namespace std;
int main()
{
    
    int arlong;
    cin >> arlong;
    int ar[arlong];
    int color[8]={0};
    int more=0;
    for (int i=0; i<arlong; i++) {
        cin >>ar[i];
    }
    for(int i = 0; i < arlong; ++i) {
        if(ar[i]<3200){
            if(color[ar[i]/400]==0){
                color[ar[i]/400]=1;
            }
        }else{
            more++;
        }
    }
    int sum = 0;
    for(int i = 0; i < 8; ++i) {
        sum += color[i];    // 合計に追加
    }
    
    if(sum==0){
        sum=1;
        more--;
    }

    cout << sum <<" "<< (sum+more)<<endl;
    return 0;

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

#include <bits/stdc++.h>  
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define FORr(i, j, k) for(int i = j; i >= k; --i)
#define repr(i, j) FOR(i, j, 0)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;
 
int N, color[9];
 
int main() {
	scanf("%d", &N);
	rep(i, N) {
		int a;
		scanf("%d", &a);
		if(1 <= a && a <= 399) ++color[0];
		else if(400 <= a && a <= 700) ++color[1];
		else if(800 <= a && a <= 1199) ++color[2];
		else if(1200 <= a && a <= 1599) ++color[3];
		else if(1600 <= a && a <= 1999) ++color[4];
		else if(2000 <= a && a <= 2399) ++color[5];
		else if(2400 <= a && a <= 2799) ++color[6];
		else if(2800 <= a && a <= 3199) ++color[7];
		else ++color[8];
	}
	int ans = 0;
	rep(i, 8) if(color[i]) ++ans;
	
	if(ans == 0) {
            ans = 1;
            --color[8];

	printf("%d %d\n", ans, maxi);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:32: error: 'maxi' was not declared in this scope
   41 |         printf("%d %d\n", ans, maxi);
      |                                ^~~~
a.cc:43:2: error: expected '}' at end of input
   43 | }
      |  ^
a.cc:19:12: note: to match this '{'
   19 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
using namespace std;

int N;
bool Count[8] = {false, false, false, false, false, false, false. false};

int color(int rate) {
	return rate / 400;
}

int main() {
	cin >> N;
	int countEx = 0;
	int rate;
	for (int i = 0; i < N; i++) {
		cin >> rate;
		if (rate < 3200) Count[color(rate)] = true;
		else countEx++;
	}
	int countColors = 0;
	for (int i = 0; i < 8; i++) {
		if (Count[i]) countColors++;
	}
	cout << max(countColors, 1) << " " << countEx + countColors << endl;
	return 0;
}

Compiler output:
a.cc:10:67: error: expected unqualified-id before 'false'
   10 | bool Count[8] = {false, false, false, false, false, false, false. false};
      |                                                                   ^~~~~
a.cc:10:67: error: expected '}' before 'false'
   10 | bool Count[8] = {false, false, false, false, false, false, false. false};
      |                 ~                                                 ^~~~~
a.cc:10:72: error: expected declaration before '}' token
   10 | bool Count[8] = {false, false, false, false, false, false, false. false};
      |                                                                        ^
Language: C

    #include<stdio.h>
    #include<stdlib.h>
    #include<string.h>
    
    int main(void){
		int ai[100],c[9];
		int N,i,sum,max,min;
		scanf("%d",&N);
		for(i = 0;i < 9; i++) c[i] = 0;
		
		for(i = 0;i < N; i++){
		scanf("%d",&ai[i])
		if((ai[i] / 400) < 8) c[ai[i] / 400] = 1;
		else c[ai[9] / 400]++;
		}
		
		for(i = 0;i < 8; i++) sum += c[i];
		
		min = sum;
		max = sum;
		
		if(c[ai[9]] > 0){ 
			min++; 
			max + c[ai[9]];
		} 
		
		if(min > 8) min = 8;
		if(max > 8) max = 8;
    }

Compiler output:
main.c: In function 'main':
main.c:12:35: error: expected ';' before 'if'
   12 |                 scanf("%d",&ai[i])
      |                                   ^
      |                                   ;
   13 |                 if((ai[i] / 400) < 8) c[ai[i] / 400] = 1;
      |                 ~~                 
main.c:14:17: error: 'else' without a previous 'if'
   14 |                 else c[ai[9] / 400]++;
      |                 ^~~~
Language: C

include<stdio.h>

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

    int a, i, kind[9];
    for(i = 0; i < N; i++){
        scanf("%d", &a);
        switch(a / 400){
          case 0 : kind[0] = 1; break;
          case 1 : kind[1] = 1; break;
          case 2 : kind[2] = 1; break;
          case 3 : kind[3] = 1; break;
          case 4 : kind[4] = 1; break;
          case 5 : kind[5] = 1; break;
          case 6 : kind[6] = 1; break;
          case 7 : kind[7] = 1; break;
          default : kind[8] ++; break;
          }
    }

    int sum, min, max;

    for(i=0; i<8; i++)sum += kind[i];
    if(sum + kind[8] <= 8) max = sum + kind[8];
    else max = 8;

    if(sum = 0)min = 1;
    else min = sum;

    printf("%d %d", min, max);

    return 0;
}

    

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: Java

import java.io.IOException;
import java.util.Scanner;

public class ABC064_C {

    private static int color[] = {0,0,0,0,0,0,0,0,0};

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

        for(int i=0;i<count;i++){
            int rate = sc.nextInt();

            if(rate>=1 && rate<=399){
                color[0]=1;
            }
            else if(rate>=400 && rate<=799){
                color[1]=1;
            }
            else if(rate>=800 && rate<=1199){
                color[2]=1;
            }
            else if(rate>=1200 && rate<=1599){
                color[3]=1;
            }
            else if(rate>=1600 && rate<=1999){
                color[4]=1;
            }
            else if(rate>=2000 && rate<=2399){
                color[5]=1;
            }
            else if(rate>=2400 && rate<2799){
                color[6]=1;
            }
            else if(rate>=2400 && rate<3199){
                color[7]=1;
            }
            else if(rate>=3200){
                color[8]++;
            }
        }

        int min = 0;
        for(int j=0;j<8;j++){
            if(color[j]>0){
                min+=1;
            }
        }

        int max = min + color[8];


        System.out.println(min + " " + max);
    }
}


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

import jdk.internal.cmm.SystemResourcePressureImpl;

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int[] rates = new int[N];

        for (int i = 0; i < N; i++) {
            rates[i] = sc.nextInt();
        }

        int[] pointFlag = new int[9];
        for (int i = 0; i < 9; i++) {
            pointFlag[i] = 0;
        }

        for(int i = 0; i<N; i++){
            if(rates[i] >= 1 && rates[i] <= 399){
                pointFlag[0] = 1;
            }else if(rates[i] >= 400 && rates[i] <= 799){
                pointFlag[1] = 1;
            }else if(rates[i] >= 800 && rates[i] <= 1199){
                pointFlag[2] = 1;
            }else if(rates[i] >= 1200 && rates[i] <= 1599){
                pointFlag[3] = 1;
            }else if(rates[i] >= 1600 && rates[i] <= 1999){
                pointFlag[4] = 1;
            }else if(rates[i] >= 2000 && rates[i] <= 2399){
                pointFlag[5] = 1;
            }else if(rates[i] >= 2400 && rates[i] <= 2799){
                pointFlag[6] = 1;
            }else if(rates[i] >= 2800 && rates[i] <= 3199){
                pointFlag[7] = 1;
            }else if(rates[i] >= 3200){
                pointFlag[8] += 1;
            }
        }
        int minAns = 0;
        int maxAns = 0;
        for (int i = 0; i < 8; i++) {
            minAns += pointFlag[i];
            maxAns += pointFlag[i];
        }
        maxAns += pointFlag[8];

        System.out.println(minAns+" "+maxAns);
    }
}

Compiler output:
Main.java:1: error: package jdk.internal.cmm does not exist
import jdk.internal.cmm.SystemResourcePressureImpl;
                       ^
1 error
Language: C++

#include <iostream>
 
 
using namespace std;
 
 
 
int main (){
    int n;
    int a,temp;
    int b[9] = {0};
    
    cin >> n;
    for (int i = 0; i < n; i++ ){
        cin >> a;
        temp = a / 400;
        if (temp < 8)
            b[temp]++;
        else
            b[8]++;
    }
    
    int min = 0;
    
    
    for (int i = 0; i < 8; i++){
        if (b[i] != 0){
            min++;
        }
    }
    
    cout << min < << min + b[8] << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: expected primary-expression before '<<' token
   32 |     cout << min < << min + b[8] << endl;
      |                   ^~
Language: C

#include<stdio.h>

int main(){
int n,a,b,ct = 0,count = 0;
int flag[8] = {0,0,0,0,0,0,0,0}

scanf("%d",&n);
for(;n > 0;n--){
scanf("%d",&a);
if(a < 3200){flag[a /400] = 1;}
else{ct++;}
}
for(n = 0;n < 8;n++){
count += flag[n];
}
if(count != 0){a = count;}
else{a = 1;}
if(count + ct > 8){b = 8;}
else{b = count + ct;}
printf("%d %d\n",a,b);
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:1: error: expected ',' or ';' before 'scanf'
    7 | scanf("%d",&n);
      | ^~~~~
Language: C++

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

int N;
int mem[10] = {0};
int ans = 0;
int sum = 0;

int main()
{
    scanf("%d",&N);
    for(int i = 0; i < N; i++)
    {
        int a;
        scanf("%d",&a);
        if(a >= 3200)
        {
            sum++;
        }
        else if(mem[a / 400] == 0)
        {
            ans++;
            mem[a / 400] = 1;
        }
    }
    printf("%d %d\n",max(ans,1),min(ans + sum));
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:36: error: no matching function for call to 'min(int)'
   26 |     printf("%d %d\n",max(ans,1),min(ans + sum));
      |                                 ~~~^~~~~~~~~~~
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:26:36: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   26 |     printf("%d %d\n",max(ans,1),min(ans + sum));
      |                                 ~~~^~~~~~~~~~~
/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<iostream>
#include<algorithm>
using namespace std;
#define int long long
int cnt[9] = {};

signed main(){
	int N;
	cin >> N;
	for (int i = 0; i < N; i++){
		int tmp;
		cin >> tmp;
		if (1 <= tmp&&tmp <= 399) cnt[0]++;
		else if (400 <= tmp&&tmp <= 799) cnt[1]++;
		else if(800 <= tmp&&tmp <= 1199) cnt[2]++;
		else if (1200 <= tmp&&tmp <= 1599) cnt[3]++;
		else if (1600 <= tmp&&tmp <= 1999) cnt[4]++;
		else if (2000 <= tmp&&tmp <= 2399) cnt[5]++;
		else if (2400 <= tmp&&tmp <= 2799) cnt[6]++;
		else if (2800 <= tmp&&tmp <= 3199) cnt[7]++;
		else if (3200 <= tmp)cnt[8]++;
	}
	int min = 0 , max = 0,now=0;
	for (int i = 0; i < 8; i++){
		if (cnt[i]!=0) now++;
	}
	if (now == 0 && tmp[8] != 0){
		cout << "1  1" << endl;
		return 0;
	}
	max = now + cnt[8];
	if (max>8) max = 8;
	min = now;
	cout << min <<" "<< max << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:25: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   27 |         if (now == 0 && tmp[8] != 0){
      |                         ^~~
      |                         tm
Language: C++

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

int main(){
	int n;
	cin >> n;
	vector<int> rate(8, 0);
	int in;
	int over = 0;
	int cnt = 0;
	for(int i = 0; i < n; i++){
		cin >> in;
		if(in >= 3200)over++;
		else rate[a / 400]++;
	}

	for(int i = 0; i < n; i++)if(rate[i] > 0)cnt++;

	cout << max(1, cnt) << ' ' << cnt + over << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:27: error: 'a' was not declared in this scope
   14 |                 else rate[a / 400]++;
      |                           ^
Language: C++

#include<stdio.h>
int n,a,i,si,br,gr,sk,bl,ye,ol,re,t,g,p,x,y,o;
int main()
{
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a);
			if(a<400){
				si=1;
			}else if(400<=a&&a<800){
				br=1;
			}else if(800<=a&&a<1200){
				gr=1;
			}else if(1200<=a&&a<1600){
				sk=1;
			}else if(1600<=a&&a<2000){
				bl=1;
			}else if(2000<=a&&a<2400){
				ye=1;
			}else if(2400<=a&&a<2800){
				ol=1;
			}else if(2800<=a&&a<3200){
				re=1;
			}else if(3200<=a){
				t++;
			}
	}
	g=si+br+gr+sk+bl+ye+ol+re;
	o=g+t;
	if(g==0&&t>0){
		g=1;
	}
	if(o=>8){
		o=8;
	}
	printf("%d %d\n",g,o);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:14: error: expected primary-expression before '>' token
   33 |         if(o=>8){
      |              ^
Language: C++

#include <iostream>
using namespace std;

bool ary[8];
int main(){
	int N,sum=0;
	cin>>N;
	int tmp;
	for(int i=1;i<=N;i++){
		cin>>tmp;
		if(tmp<3200)ary[(tmp-1)/400]|=true;
		else sum++;
	}
	int num=0;
	for(int i=0;i<8;i++) if(ary[i]) num++;

	if(!res) cout<<1<<" "<<sum<<endl;
	else cout<<res<<" "<<res+sum<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: 'res' was not declared in this scope
   17 |         if(!res) cout<<1<<" "<<sum<<endl;
      |             ^~~
Language: Java

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		int[] a = new int[n];
		int wildCount = 0;
		for(int i=0;i<n;i++){
			a[i] = Integer.parseInt(scan.next());
			if(a[i]>=3200)wildCount++;
		}
		int min,sum = 0;
		for(int j=0;j<8;j++){//jは色
			if(check(a,j))sum ++;
		}
		//最小値
		if(sum==0){
			min = 1;
		}else{
			min = sum;
		}
		//最大値
		int max = sum;
		max += wildCount;
 
 
		System.out.println(min+" "+max);
 
 
	}
 
	static boolean check(int[] a,int b){
		for(int i=0;i<a.length;i++){
			if(400*b<=a[i] && a[i]<400*(b+1)){
				return true;
			}
		}
		return false;
	}
}

Compiler output:
Main.java:24: error: illegal character: '\u00a0'
?
^
Main.java:25: error: illegal character: '\u00a0'
?
^
Main.java:27: error: illegal character: '\u00a0'
?
^
Main.java:28: error: illegal character: '\u00a0'
?
^
Main.java:30: error: illegal character: '\u00a0'
?
^
5 errors
Language: C

#include<stdio.h>
#define scanf scanf_s

int main(void) {
	int N = 0;
	int a[4801];
	int hai = 0, tya = 0, midori = 0, mizu = 0, ao = 0, ki = 0, daidai = 0, aka = 0, over = 0;
	int kinds = 0, max = 0;

	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d", &a[i]);
		switch (a[i] / 400) {
		case 0:	hai++;
				break;

		case 1:	tya++;
				break;

		case 2:	midori++;
				break;

		case 3:	mizu++;
				break;

		case 4:	ao++;
				break;

		case 5:	ki++;
				break;

		case 6:	daidai++;
				break;

		case 7:	aka++;
				break;

		default:over++;
				break;
		}
	}

	if (hai > 0)	kinds++;
	if (tya > 0)	kinds++;
	if (midori > 0)	kinds++;
	if (mizu > 0)	kinds++;
	if (ao > 0)		kinds++;
	if (ki > 0)		kinds++;
	if (daidai > 0)	kinds++;
	if (aka > 0)	kinds++;

	max = kinds + over;
	if (max > 7)max = 7;

	printf("%d %d", kinds, max);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:2:15: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    2 | #define scanf scanf_s
      |               ^~~~~~~
main.c:10:9: note: in expansion of macro 'scanf'
   10 |         scanf("%d", &N);
      |         ^~~~~
Language: C

#include<stdio.h>
#define scanf scanf_s

int main(void) {
	int N = 0;
	int a[4801];
	int hai = 0, tya = 0, midori = 0, mizu = 0, ao = 0, ki = 0, daidai = 0, aka = 0, over = 0;
	int kinds = 0, max = 0;

	scanf("%d", &N);
	for (int i = 0; i < N; i++) {
		scanf("%d", &a[i]);
		switch (a[i] / 400) {
		case 0:	hai++;
				break;

		case 1:	tya++;
				break;

		case 2:	midori;
				break;

		case 3:	mizu++;
				break;

		case 4:	ao++;
				break;

		case 5:	ki++;
				break;

		case 6:	daidai++;
				break;

		case 7:	aka++;
				break;

		default:over++;
				break;
		}
	}
	if (hai > 0)	kinds++;
	if (tya > 0)	kinds++;
	if (midori > 0)	kinds++;
	if (mizu > 0)	kinds++;
	if (ao > 0)		kinds++;
	if (ki > 0)		kinds++;
	if (daidai > 0)	kinds++;
	if (aka > 0)	kinds++;

	max = kinds + over;
	if (max > 7)max = 7;

	printf("%d %d", kinds, max);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:2:15: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    2 | #define scanf scanf_s
      |               ^~~~~~~
main.c:10:9: note: in expansion of macro 'scanf'
   10 |         scanf("%d", &N);
      |         ^~~~~
Language: C++

#include <iostream>
#include <map>
#include <algorithm>

using namespace std;

int main()
{
	int N;
	cin >> N;
	map<int, int> r;
	int x = 0;
	for (int i = 0; i < N; ++i) {
		int a;
		cin >> a;
		if (a < 3200) {
			++r[a / 400];
		}
		else {
			++x;
		}
	}
	int mn = r.size();
	int mx = min(8u, r.size() + x);
	cout << mn << " " << mx << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:21: error: no matching function for call to 'min(unsigned int, std::map<int, int>::size_type)'
   24 |         int mx = min(8u, r.size() + x);
      |                  ~~~^~~~~~~~~~~~~~~~~~
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: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:24:21: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'std::map<int, int>::size_type' {aka 'long unsigned int'})
   24 |         int mx = min(8u, r.size() + x);
      |                  ~~~^~~~~~~~~~~~~~~~~~
/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,
                 from a.cc:3:
/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:24:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned int'
   24 |         int mx = min(8u, r.size() + x);
      |                  ~~~^~~~~~~~~~~~~~~~~~
Language: C++

#include<stdio.h>
int n,a,i,si,br,gr,sk,bl,ye,or,re,t;
int main()
{
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a);
			if(a<400){
				si=1;
			}else if(400<=a&&a<800){
				br=1;
			}else if(800<=a&&a<1200){
				gr=1;
			}else if(1200<=a&&a<1600){
				sk=1;
			}else if(1600<=a&&a<2000){
				bl=1;
			}else if(2000<=a&&a<2400){
				ye=1;
			}else if(2400<=a&&a<2800){
				or=1;
			}else if(2800<=a&&a<3200){
				re=1;
			}else if(3200<=a){
				t++;
			}
	}
	
	printf("%d %d\n",si+br+gr+sk+bl+ye+or+re,(si+br+gr+sk+bl+ye+or+re+t)%9);
	return 0;
}

Compiler output:
a.cc:2:29: error: expected unqualified-id before 'or' token
    2 | int n,a,i,si,br,gr,sk,bl,ye,or,re,t;
      |                             ^~
a.cc: In function 'int main()':
a.cc:21:33: error: expected primary-expression before 'or' token
   21 |                                 or=1;
      |                                 ^~
a.cc:21:35: error: expected primary-expression before '=' token
   21 |                                 or=1;
      |                                   ^
a.cc:23:33: error: 're' was not declared in this scope; did you mean 'ye'?
   23 |                                 re=1;
      |                                 ^~
      |                                 ye
a.cc:25:33: error: 't' was not declared in this scope
   25 |                                 t++;
      |                                 ^
a.cc:29:44: error: expected primary-expression before 'or' token
   29 |         printf("%d %d\n",si+br+gr+sk+bl+ye+or+re,(si+br+gr+sk+bl+ye+or+re+t)%9);
      |                                            ^~
a.cc:29:47: error: 're' was not declared in this scope; did you mean 'ye'?
   29 |         printf("%d %d\n",si+br+gr+sk+bl+ye+or+re,(si+br+gr+sk+bl+ye+or+re+t)%9);
      |                                               ^~
      |                                               ye
a.cc:29:69: error: expected primary-expression before 'or' token
   29 |         printf("%d %d\n",si+br+gr+sk+bl+ye+or+re,(si+br+gr+sk+bl+ye+or+re+t)%9);
      |                                                                     ^~
a.cc:29:75: error: 't' was not declared in this scope
   29 |         printf("%d %d\n",si+br+gr+sk+bl+ye+or+re,(si+br+gr+sk+bl+ye+or+re+t)%9);
      |                                                                           ^
Language: C++

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

using namespace std;

int Rate(int rate){
	rate = rate/400;
	if (rate > 8) {
		return 8;
	}
	return rate;
}

int main(int argc, char const *argv[]) {
	int count,temp,color,over;
	color = over = 0;
	std::vector<int> v = {0,1,2,3,4,5,6,7};
	std::cin >> count;
	vec.resize(count);
	for (size_t i = 0; i < count; i++) {
		std::cin >> temp;
		temp = Rate(temp);
		if (temp == 8) {
			over++;
		}
		for (size_t j = 0; j < v.size(); j++) {
			if (temp == v[j]) {
				color++;
				v.erase(j);
				break;
			}
		}
	}
	std::cout << color << " " << min(color+over,8) << '\n';
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:20:9: error: 'vec' was not declared in this scope
   20 |         vec.resize(count);
      |         ^~~
a.cc:30:40: error: no matching function for call to 'std::vector<int>::erase(size_t&)'
   30 |                                 v.erase(j);
      |                                 ~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from 'size_t' {aka 'long unsigned int'} to 'std::vector<int>::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

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

int main( void ) {
    int N;
    std::cin >> N;

    // ただし便宜的に色が9色あることにする。
    // 最後の色は、実は色ではなくて、「好きな色を使える」ことなので注意。
    std::vector<bool> color_used = std::vector<bool>(8, false);  // 8色あって、初期値はfalseです。と言う指定

    // 自由な色を使って良いメンバーが何人いるか
    // 基本的に、みんな自由な色を使えることにしてしまう。
    // しかし、「使わなきゃいけない色」が見つかったら、ここから減らす。
    int free_color_members = N;

    // 入力しながら色を振り分けていく
    for( size_t i = 0; i < N; ++i ) {
        int rate;
        std::cin >> rate;

        // よくみるとレートの変化するところは400区切りだから、400で割って割り振ってもOK
        if( rate < 3200 ) {
            color_used[ rate / 400 ] = true;
            free_color_members -= 1;
        }
    }

    // 何種類の色が、決め打ちで使用済みなのか調べる
    int used_colors = 0;
    for( size_t i = 0; i < 8; ++i ) {
        if( color_used[ i ] > 0 ) {
            used_colors += 1;
        }
    }

    // 少なくとも一人のユーザがこの問題ではいることを考えると
    // 「決め打ちの色が1つもない」のであれば
    // 「自由な色の人が何か1つ決め打ちの色をとる」ようになるということ
    // なので自由な色を使える人の数を1つ減らして、used_colorを1にすることで問題を帰着できる。
    if( used_color == 0 ) {
        free_color_members -= 1;
        used_color = 1;
    }

    std::cout << used_color << " " << free_color_members << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:9: error: 'used_color' was not declared in this scope; did you mean 'used_colors'?
   42 |     if( used_color == 0 ) {
      |         ^~~~~~~~~~
      |         used_colors
a.cc:47:18: error: 'used_color' was not declared in this scope; did you mean 'used_colors'?
   47 |     std::cout << used_color << " " << free_color_members << std::endl;
      |                  ^~~~~~~~~~
      |                  used_colors
Language: C++

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

int main( void ) {
    int N;
    std::cin >> N;

    // ただし便宜的に色が9色あることにする。
    // 最後の色は、実は色ではなくて、「好きな色を使える」ことなので注意。
    std::vector<bool> color_used = std::vector<bool>(8, false);  // 8色あって、初期値はfalseです。と言う指定

    // 自由な色を使って良いメンバーが何人いるか
    // 基本的に、みんな自由な色を使えることにしてしまう。
    // しかし、「使わなきゃいけない色」が見つかったら、ここから減らす。
    int free_color_members = N;

    // 入力しながら色を振り分けていく
    for( size_t i = 0; i < N; ++i ) {
        int rate;
        std::cin >> rate;

        // 上のテーブルを使って各メンバーを色に振り分けていきます。
        // もちろん配列を使わずにif文で地道に振り分けてもOKです。(大変ですけどね!)
        for( size_t j = 0; j < color_ranges.size() - 1; ++j ) {
            // よくみるとレートの変化するところは400区切りだから、400で割って割り振ってもOK
            
            if( rate < 3200 ) {
                color_used[ rate / 400 ] = true;
                free_color_members -= 1;
                break;
            }
        }
    }

    // 何種類の色が、決め打ちで使用済みなのか調べる
    int used_colors = 0;
    for( size_t i = 0; i < 8; ++i ) {
        if( color_used[ i ] > 0 ) {
            used_colors += 1;
        }
    }

    // 少なくとも一人のユーザがこの問題ではいることを考えると
    // 「決め打ちの色が1つもない」のであれば
    // 「自由な色の人が何か1つ決め打ちの色をとる」ようになるということ
    // なので自由な色を使える人の数を1つ減らして、used_colorを1にすることで問題を帰着できる。
    if( used_color == 0 ) {
        free_color_members -= 1;
        used_color = 1;
    }

    std::cout << used_color << " " << free_color_members << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:32: error: 'color_ranges' was not declared in this scope
   25 |         for( size_t j = 0; j < color_ranges.size() - 1; ++j ) {
      |                                ^~~~~~~~~~~~
a.cc:48:9: error: 'used_color' was not declared in this scope; did you mean 'used_colors'?
   48 |     if( used_color == 0 ) {
      |         ^~~~~~~~~~
      |         used_colors
a.cc:53:18: error: 'used_color' was not declared in this scope; did you mean 'used_colors'?
   53 |     std::cout << used_color << " " << free_color_members << std::endl;
      |                  ^~~~~~~~~~
      |                  used_colors
Language: C++

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

int main( void ) {
    int N;
    std::cin >> N;

    std::vector<int> a;
    for( size_t i = 0; i < N; ++i ) {
        int rate;
        std::cin >> rate;
        a.push_back( rate );
    }

    // 色が変わるところを示すテーブル
    // i番目のレート以上、i+1番目のレート以下で、i番の色
    // ただし3200を超えたら、好きな色をつけることができます。
    // 問題の要請では、レートの値は4800点が最大のレートなので、
    // その時も問題なく検索できるように、最後には4801を置いておきます。
    const std::vector<int> color_table = { 1, 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 4801 };

    // 便宜的に色が9色あることにする。
    // ただし最後の人は好きな色を使えるので注意。
    int color_count[ 9 ] = { 0 };

    // 上のテーブルを使って各メンバーを色に振り分けていきます。
    for( size_t i = 0; i < N; ++i ) {
        const int rate = a[i];
        for( size_t j = 0; j < rate_table.size() - 1; ++j ) {
            const int min = rate_table[ j ];
            const int max = rate_table[ j + 1 ];

            if( min <= rate && rate < max ) {
                color = j;
                break;
            }
        }
        // 指定の色を持った人を1人増やす
        color_count[ color ] += 1;
    }

    // 決め打ちの色になってる人がいるなら、その個数をみる
    int constant_color_count = 0;
    for( size_t i = 0; i < 8; ++i ) {
        if( color_count [ i ] > 0 ) {
            constant_color_count += 1;
        }
    }

    if( constant_color_count == 0 && color_count[ 8 ] == 0 ) {
        std::cout << 0 << " " << 0 << std::endl;
    } else if ( constant_color_count == 0 && color_count[ 8 ] != 0 ) {
        std::cout << 1 << " " << color_count[ 8 ] << std::endl;
    } else if ( constant_color_count != 0 && color_count[ 8 ] == 0 ) {
        std::cout << constant_color_count << " " << constant_color_count << std::endl;
    } else if ( constant_color_count != 0 && color_count[ 8 ] != 0 ) {
        std::cout << constant_color_count << " " << constant_color_count + color_count[ 8 ] << std::endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:32: error: 'rate_table' was not declared in this scope
   30 |         for( size_t j = 0; j < rate_table.size() - 1; ++j ) {
      |                                ^~~~~~~~~~
a.cc:35:17: error: 'color' was not declared in this scope; did you mean 'tolower'?
   35 |                 color = j;
      |                 ^~~~~
      |                 tolower
a.cc:40:22: error: 'color' was not declared in this scope; did you mean 'tolower'?
   40 |         color_count[ color ] += 1;
      |                      ^~~~~
      |                      tolower