criyle/codenet-compile-errors huggingface dataset:
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 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:29:15: error: 'rate' does not name a type
   29 |         const rate = a[i];
      |               ^~~~
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:34:24: error: 'rate' was not declared in this scope
   34 |             if( min <= rate && rate < max ) {
      |                        ^~~~
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
Language: C++

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

int main( void ) {
    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 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:7:28: error: 'N' was not declared in this scope
    7 |     for( size_t i = 0; i < N; ++i ) {
      |                            ^
a.cc:25:28: error: 'N' was not declared in this scope
   25 |     for( size_t i = 0; i < N; ++i ) {
      |                            ^
a.cc:26:15: error: 'rate' does not name a type
   26 |         const rate = a[i];
      |               ^~~~
a.cc:27:32: error: 'rate_table' was not declared in this scope
   27 |         for( size_t j = 0; j < rate_table.size() - 1; ++j ) {
      |                                ^~~~~~~~~~
a.cc:31:24: error: 'rate' was not declared in this scope
   31 |             if( min <= rate && rate < max ) {
      |                        ^~~~
a.cc:32:17: error: 'color' was not declared in this scope; did you mean 'tolower'?
   32 |                 color = j;
      |                 ^~~~~
      |                 tolower
a.cc:37:22: error: 'color' was not declared in this scope; did you mean 'tolower'?
   37 |         color_count[ color ] += 1;
      |                      ^~~~~
      |                      tolower
Language: C++

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

int main( void ) {

    for( size_t i = 0; i < N; ++i ) {
        int rate;
        std::cin >> 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 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:7:28: error: 'N' was not declared in this scope
    7 |     for( size_t i = 0; i < N; ++i ) {
      |                            ^
a.cc:24:28: error: 'N' was not declared in this scope
   24 |     for( size_t i = 0; i < N; ++i ) {
      |                            ^
a.cc:25:15: error: 'rate' does not name a type
   25 |         const rate = a[i];
      |               ^~~~
a.cc:26:32: error: 'rate_table' was not declared in this scope
   26 |         for( size_t j = 0; j < rate_table.size() - 1; ++j ) {
      |                                ^~~~~~~~~~
a.cc:30:24: error: 'rate' was not declared in this scope
   30 |             if( min <= rate && rate < max ) {
      |                        ^~~~
a.cc:31:17: error: 'color' was not declared in this scope; did you mean 'tolower'?
   31 |                 color = j;
      |                 ^~~~~
      |                 tolower
a.cc:36:22: error: 'color' was not declared in this scope; did you mean 'tolower'?
   36 |         color_count[ color ] += 1;
      |                      ^~~~~
      |                      tolower
Language: C++

#include <iostream>
using namespace std;
int main(void){
  int n,min=0,max=0;
  cin>>n;
  int a[n],c[10]=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    if(a[i]<400)c[0]=1;
    else if(a[i]<800)c[1]=1;
    else if(a[i]<1200)c[2]=1;
    else if(a[i]<1600)c[3]=1;
    else if(a[i]<2000)c[4]=1;
    else if(a[i]<2400)c[5]=1;
    else if(a[i]<2800)c[6]=1;
    else if(a[i]<3200)c[7]=1;
    else c[8]++;
  }
  for(int i=0;i<8;i++){
    min+=c[i];
    if(c[i]==0)max++;
  }
  if(min==0)min++;
  if(c[8]>max)max=8;
  else max=8-(max-c[8]);

  cout<<min<<" "<<max<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: array must be initialized with a brace-enclosed initializer
    6 |   int a[n],c[10]=0;
      |                  ^
Language: C++

#include<bits/stdc++.h>
#define up(j,k,i) for(i=j;i<k;i++)
#define down(j,k,i) for(i=j;i>k;i--)
#define pp(n) printf("%lld\n",n)
#define ps(s) printf("%s",s)
#define is(n) scanf("%lld",&n)
#define ips(n) scanf("%lld",n)
#define ss(s) scanf("%s",s)
#define cool 0
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define f(i) cout<<i<<endl;
#define pll pair<lld,lld> 
#define pi acos(-1)
#ifdef G
#define dg(x) cout<<#x<<' '<<x<<endl;
#define dg2(x,y) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<endl;
#define dg3(x,y,z) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<endl;
#define dg4(x,y,z,zz) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<' '<<#zz<<' '<<zz<<endl;
#else
#define dg(x) ;
#define dg2(x,y) ;
#define dg3(x,y,z) ;
#define dg4(x,y,z,zz) ;
#endif
#define ds(n,m) scanf("%lld %lld",&n,&m)
#define ts(n,m,k) scanf("%lld %lld %lld",&n,&m,&k)
#define yes printf("YES\n")
#define no printf("NO\n")
typedef long double ld;
typedef long long int lld;
using namespace std;
const lld M =1e6+7;
const lld mod=1e9+7;
const lld infi =LLONG_MAX;
lld ans,k,n,x,y,m,mymax=LLONG_MIN,mymin=LLONG_MAX,b,c,z,sum;
lld a[M];
lld cnt[10];
int main()
{
      lld i,j;
        is(n);
        up(1,n+1,i)
        {
          is(a[i]);
          lld temp=a[i]/400;
          cnt[temp]++;
        }
        ans=0;
        up(0,8,i)
        {
          if(cnt[i]!=0)
          {
            ans++;
          }
        }
        lld ans1=ans;
        if(ans==0)
        ans1=1,;
         cout<<ans1<<' ';
        ans=ans+cnt[8];
        cout<<ans<<endl;
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:16: error: expected primary-expression before ';' token
   61 |         ans1=1,;
      |                ^
Language: C++

#include<stdio.h>
int main()
{
	int N;
	while(scanf("%d",&N)!=EOF)
	{
		int max=0;
		int min=0;
		int n;
		int a[1000+20];
		for (i=0;i<N;i++)
		{
			scanf("%d",&n);
			if(n/400<8)
				a[n/400]++;
			else
				max++;
		}
		for(i=0;i<9;i++)
		{
			if(a[i]!=0)
				min++;
		}
		max=min+max;
		if(min==0)
			min=1;
		printf("%d %d\n",min,max);	
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: 'i' was not declared in this scope
   11 |                 for (i=0;i<N;i++)
      |                      ^
a.cc:19:21: error: 'i' was not declared in this scope
   19 |                 for(i=0;i<9;i++)
      |                     ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static final Scanner s=new Scanner(System.in);
	static int getInt(){
		return Integer.parseInt(s.next());
	}
	static IntStream REPS(int r){
		return IntStream.range(0,r);
	}
	static IntStream REPS(int l,int r){
		return IntStream.rangeClosed(l,r);
	}
	static IntStream INTS(int l){
		return REPS(l).map(i->getInt());
	}
	public static void main(String[] __){
		int n=s.nextInt();
		int[] color=new int[9];
		for(int i=0;i<n;i++){
			int latte=getInt();
			if(latte<400)
				color[0]++;
			else if(latte<800)
				color[1]++;
			else if(latte<1200)
				color[2]++;
			else if(latte<1600)
				color[3]++;
			else if(latte<2000)
				color[4]++;
			else if(latte<2400)
				color[5]++;
			else if(latte<2800)
				color[6]++;
			else if(latte<3200)
				color[7]++;
			else
				color[8]++;
		}
		
		
		long v=Arrays.stream(color).limit(8).filter(i->i>0).count();
		System.out.printf("%d %d\n",
				Math.max(1,v)
				Math.max(1,v+color[8])
				);
	}
}


Compiler output:
Main.java:47: error: ')' or ',' expected
				Math.max(1,v)
				             ^
Main.java:48: error: ';' expected
				Math.max(1,v+color[8])
				                      ^
2 errors
Language: C++

// AtCoder Beginner Contest 064
// C - Colorful Leaderboard

#include <cstdio>
#include <cstring>
#include <algprithm>
using namespace std;
typedef long long int ll;

const int R = 8;
const int R_STEP = 400;

int N;
int counts[R + 1];

int main() {

    int a;
    int rates;

    scanf("%d", &N);
    memset(counts, 0, sizeof(counts));
    for (int i = 0; i < N; i++) {
        scanf("%d", &a);
        if (a >= R * R_STEP) {
            counts[R]++;
        } else {
            for (int j = 0; j < R; j++) {
                if (a < (j + 1) * R_STEP) {
                    counts[j]++;
                    break;
                }
            }
        }
    }

    rates = 0;
    for (int j = 0; j < R; j++) {
        if (counts[j] > 0) {
            rates++;
        }
    }
    printf("%d %d\n", max(rates, 1), rates + counts[R]);

    return 0;

}





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

#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>

#define rep(i,n) for(i=0;i<(n);i++)
using namespace std;

int main() {
    int n,min=0,max=0,f[9]={0},i;
    cin>>n;
    int a[n];
    rep(i,n){
    	
    	cin>>a[i];
    	
    	if(a[i]<=399){
    		f[0]=1;
    	}
    	else if( a[i]<=799){
    		f[1]=1;
    	}
    	else if(a[i]<=1199){
    	    f[2]=1;
    	}
    	else if(a[i]<=1599){
    	    f[3]=1;
    	}
    	else if(a[i]<=1999){
    	    f[4]=1;
    	}
    	else if(a[i]<=2399){
    	    f[5]=1;
    	}
    	else if(a[i]<=2799){
    	    f[6]=1;
    	}
    	else if(a[i]<=3199){
    	    f[7]=1;
    	}
    	else{
    		f[8]++;
    	}
    }
    rep(i,9){
    		if(i!=8){
    		  min+=f[i];
    		  max+=f[i];
    		}
    		else{
    			max=min+f[8];
    			if(min==0 && any>0){
    				min=1;
    				max=f[8];
    			}
    		}
    }
    cout<<min<<" "<<max<<endl;
	// your code goes here
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:38: error: 'any' was not declared in this scope
   53 |                         if(min==0 && any>0){
      |                                      ^~~
a.cc:6:1: note: 'std::any' is defined in header '<any>'; this is probably fixable by adding '#include <any>'
    5 | #include <queue>
  +++ |+#include <any>
    6 |
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>

#define rep(i,n) for(i=0;i<(n);i++)
using namespace std;

int main() {
    int n,min=0,max=0,f[9]={0},i;
    cin>>n;
    int a[n];
    rep(i,n){
    	
    	cin>>a[i];
    	
    	if(a[i]>=1 && a[i]<=399){
    		f[0]=1;
    	}
    	else if(a[i]>=400 && a[i]<=799){
    		f[1]=1;
    	}
    	else if(a[i]>=800 && a[i]<=1199){
    	    f[2]=1;
    	}
    	else if(a[i]>=1200 && a[i]<=1599){
    	    f[3]=1;
    	}
    	else if(a[i]>=1600 && a[i]<=1999){
    	    f[4]=1;
    	}
    	else if(a[i]>=2000 && a[i]<=2399){
    	    f[5]=1;
    	}
    	else if(a[i]>=2400 && a[i]<=2799){
    	    f[6]=1;
    	}
    	else if(a[i]>=2800 && a[i]<=3199){
    	    f[7]=1;
    	}
    	else{
    		f[8]++;
    	}
    }
    rep(i,9){
    		if(i!=8){
    		  min+=f[i];
    		  max+=f[i];
    		}
    		else{
    			if(min==0 && any>0){
    				min=1;
    				max=f[8];
    			}
    		}
    }
    cout<<min<<" "<<max<<endl;
	// your code goes here
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:38: error: 'any' was not declared in this scope
   52 |                         if(min==0 && any>0){
      |                                      ^~~
a.cc:6:1: note: 'std::any' is defined in header '<any>'; this is probably fixable by adding '#include <any>'
    5 | #include <queue>
  +++ |+#include <any>
    6 |
Language: C

#include<stdio.h>


int main(){

  int n, a, i, hai=0, cha=0, mid=0, miz=0, ao=0, ki=0, o=0, aka=0, c=0, min;

  scanf("%d", &n);

  for(i=0;i<n;i++){
    scanf("%d", &a);
    if(1<=a&&a<=399) hai=1;
    if(400<=a&&a<=799) cha=1;
    if(800<=a&&a<=1199) mid=1;
    if(1200<=a&&a<=1599) miz=1;
    if(1600<=a&&a<=1999) ao=1;
    if(2000<=a&&a<=2399) ki=1;
    if(2400<=a&&a<=2799) o=1;
    if(2800<=a&&a<=3199) aka=1;
    if(3200<=a) c++;
  }

  min=hai+cha+mid+miz+ao+ki+o+aka;
  if(min=0) printf("%d %d\n", min+1, min+c);
  else printf("%d %d\n", min, min+c)

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:25:37: error: expected ';' before 'return'
   25 |   else printf("%d %d\n", min, min+c)
      |                                     ^
      |                                     ;
   26 | 
   27 |   return 0;
      |   ~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
        int n,a[100]={0};
        cin>>n;
        int b[9]={0};
        for(int i=0;i<n;i++){
                cin>>a[i];
                if(a[i]<3200){
                        a[i]/=400;
                }
                else{
                        a[i]=8;
                }
        }
        int max=a[0];
        for(int i=1;i<n;i++){
                if(max<a[i]){
                        max=a[i];
                }
        }
        for(int i=0;i<n;i++){
                b[a[i]]+=1;
"gc.cpp" 40L, 493C                                            1,1          先頭


Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: expected ';' before numeric constant
   24 | "gc.cpp" 40L, 493C                                            1,1          先頭
      |         ^~~~
      |         ;
a.cc:24:80: error: expected '}' at end of input
   24 | "gc.cpp" 40L, 493C                                            1,1          先頭
      |                                                                                ^
a.cc:22:29: note: to match this '{'
   22 |         for(int i=0;i<n;i++){
      |                             ^
a.cc:24:80: error: expected '}' at end of input
   24 | "gc.cpp" 40L, 493C                                            1,1          先頭
      |                                                                                ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<cstdio>
#include<cstring>
int main()
{
    int n,a[4850],f[9];
    while(scanf("%d",&n)==1)
    {
        int cnt=0,sum=0;
        memset(f,0,sizeof(f));
        for(int i=0; i<n; i++)
        {
            scanf("%d",&a[i]);
        }
        for(int i=0; i<n; i++)
        {
            if(a[i]>=1&&a[i]<=399)
                f[1]=1;
            if(a[i]>=400&&a[i]<=799)
                f[2]=1;
            if(a[i]>=800&&a[i]<=1199)
                f[3]=1;
            if(a[i]>=1200&&a[i]<=1599)
                f[4]=1;
            if(a[i]>=1600&&a[i]<=1999)
                f[5]=1;
            if(a[i]>=2000&&a[i]<=2399)
                f[6]=1;
            if(a[i]>=2400&&a[i]<=2799)
                f[7]=1;
            if(a[i]>=2800&&a[i]<=3199)
                f[8]=1;
            if(a[i]>3199)
                cnt++;
        }
        for(int i=1; i<9; i++)
        {
            if(f[i]==1)
                sum++;
        }
        cnt+=sum;
        if (cnt > 0)
		{
			if (sum > 1)
				sum -= 1;
			cnt += k - 1;
		}
        printf("%d %d\n",sum,cnt);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:32: error: 'k' was not declared in this scope
   45 |                         cnt += k - 1;
      |                                ^
Language: C++

#include<cstdio>
#include<cstring>
int main()
{
    int n,a[4850],f[9];
    while(scanf("%d",&n)==1)
    {
        int cnt=0,sum=0;
        memset(f,0,sizeof(f));
        for(int i=0; i<n; i++)
        {
            scanf("%d",&a[i]);
        }
        for(int i=0; i<n; i++)
        {
            if(a[i]>=1&&a[i]<=399)
                f[1]=1;
            if(a[i]>=400&&a[i]<=799)
                f[2]=1;
            if(a[i]>=800&&a[i]<=1199)
                f[3]=1;
            if(a[i]>=1200&&a[i]<=1599)
                f[4]=1;
            if(a[i]>=1600&&a[i]<=1999)
                f[5]=1;
            if(a[i]>=2000&&a[i]<=2399)
                f[6]=1;
            if(a[i]>=2400&&a[i]<=2799)
                f[7]=1;
            if(a[i]>=2800&&a[i]<=3199)
                f[8]=1;
            if(a[i]>3199)
                cnt++;
        }
        for(int i=1; i<9; i++)
        {
            if(f[i]==1)
                sum++;
        }
        cnt+=sum;
        if (cnt > 0)
		{
			if (sum > 1)
				sum -= 1;
			cnt += k - 1;
		}
        /*if(sum==0)
            sum=1;
        if(cnt>8)
            cnt=8;*/
        printf("%d %d\n",sum,cnt);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:32: error: 'k' was not declared in this scope
   45 |                         cnt += k - 1;
      |                                ^
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
	char a[1000000],w[10];
	int n, num[101],i,j,k,color[10], min = 0, max = 0;
	for(i = 0; i < 10; i++)
		color[i] = 0;
	scanf("%d", &n);
	rewind(stdin);
	gets(a);
	j=0;
	k=0;
	for(i=0;a[i]!='\0';i++){
 		if(a[i]==' '){
 		w[j]='\0';
 		num[k++]=atoi(w);
 		j=0;
 		}
 		w[j++]=a[i];
 	}
 	w[j]='\0';
 	num[k++]=atoi(w);

	for(i = 0; i < n; i++){
		switch (i/400){
			case 0:
				color[0]++;
				break;
			case 1:
				color[1]++;
				break;
			case 2:
				color[2]++;
				break;
			case 3:
				color[3]++;
				break;
			case 4:
				color[4]++;
				break;
			case 5:
				color[5]++;
				break;
			case 6:
				color[6]++;
				break;
			case 7:
				color[7]++;
				break;
			default:
				color[8]++;
				break;
		}
	}
	for(i = 0; i < 8; i++){
		if(color[i] > 0)
			min++;
			max++;
		}
	}
	if(color[8] > 0){
		if(8-max < color[8])
			max = 8;
		else
			max = max + color[8];
	}
	printf("%d %d", min, max);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   12 |         gets(a);
      |         ^~~~
      |         fgets
main.c: At top level:
main.c:63:9: error: expected identifier or '(' before 'if'
   63 |         if(color[8] > 0){
      |         ^~
main.c:69:16: error: expected declaration specifiers or '...' before string constant
   69 |         printf("%d %d", min, max);
      |                ^~~~~~~
main.c:69:25: error: unknown type name 'min'
   69 |         printf("%d %d", min, max);
      |                         ^~~
main.c:69:30: error: unknown type name 'max'
   69 |         printf("%d %d", min, max);
      |                              ^~~
main.c:71:9: error: expected identifier or '(' before 'return'
   71 |         return 0;
      |         ^~~~~~
main.c:72:1: error: expected identifier or '(' before '}' token
   72 | }
      | ^
Language: C++

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

int main() {
	int n;
	int a[1000];
	int gray = 0;
	int br = 0;
	int gr = 0;
	int lb = 0;
	int bl = 0, ye = 0, ora = 0, re = 0, min = 0, max = 0, god = 0;
	cin >> n ;
	for (int x = 0; x < n; ++x)cin >> a[x];
	sort(a,a+n)
	for (int x = 0; x < n; ++x) {
		if (a[x] < 400 && gray == 0)gray = 1;
		else if (a[x] >= 400 && a[x] < 800 && br == 0)br = 1;
		else if (a[x] >= 800 && a[x] < 1200 && gr == 0)gr = 1;
		else if (a[x] >= 1200 && a[x] < 1600 && lb == 0)lb = 1;
		else if (a[x] >= 1600 && a[x] < 2000 && bl == 0)bl = 1;
		else if (a[x] >= 2000 && a[x] < 2400 && ye == 0)ye = 1;
		else if (a[x] >= 2400 && a[x] < 2800 && ora == 0)ora = 1;
		else if (a[x] >= 2800 && a[x] < 3200 && re == 0)re = 1;
		else if(a[x] >= 3200 ) god = god + 1;
	}
	min = gray + br + gr + lb + bl + ye + ora +re;
	max= gray + br + gr + lb + bl + ye + ora +re+god;
	if (min<1)min=1;
	if (max > 8)max = 8;
	cout << min <<" "<< max << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: expected ';' before 'for'
   17 |         sort(a,a+n)
      |                    ^
      |                    ;
   18 |         for (int x = 0; x < n; ++x) {
      |         ~~~         
a.cc:18:25: error: 'x' was not declared in this scope
   18 |         for (int x = 0; x < n; ++x) {
      |                         ^
Language: C

#include <stdio.h>

int main(void)
{
    int N,i,M,m,a[4800];
    a[4800]={0},m=0;
    int b[9]={0};
    
    scanf("%d",&N);
    
    for(i=0;i<N;i++)
    {
        scanf("%d",&a[i]);
    }
    
    
    
    for(i=0;i<N;i++)
    {
        if(a[i]<400)
        {
            b[0]=1;
        }
        if((a[i]>=400)&&a[i]<800)
        {
            b[1]=1;
        }
        if((a[i]>=800)&&a[i]<1200)
        {
            b[2]=1;
        }
        if((a[i]>=1200)&&a[i]<1600)
        {
            b[3]=1;
        }
        if((a[i]>=1600)&&a[i]<2000)
        {
            b[4]=1;
        }
        if((a[i]>=2000)&&a[i]<2400)
        {
            b[5]=1;
        }
        if((a[i]>=2400)&&a[i]<2800)
        {
            b[6]=1;
        }
        if((a[i]>=2800)&&a[i]<3200)
        {
            b[7]=1;
        }
        if(a[i]>=3200)
        {
            b[8]++;
        }
    }
    
    
    for(i=0;i<8;i++)
    {
        m=m+b[i];
    }
    
    M=m+b[8];

    if(M>8)
    {
        M=8;
    }
    
    printf("%d %d",m,M);
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:13: error: expected expression before '{' token
    6 |     a[4800]={0},m=0;
      |             ^
Language: C++

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

int main(){

  int n, i, num, max, min;
  int gray, brown, green, lightblue, blue, yellow, orange, red, tmp;
  gray = brown = green = lightblue = blue = yellow = orange = red = tmp = 0;

  cin >> n;
  for(i = 0; i < n; i++){
    cin >> num;
    if(num >= 1 && num <= 399){
      if(gray == 0) gray++;
    }else if(num >= 400 && num <= 799){
      if(brown == 0) brown++;
    }else if(num >= 800 && num <= 1199){
      if(green == 0) green++;
    }else if(num >= 1200 && num <= 1599){
      if(lightblue == 0) lightblue++;
    }else if(num >= 1600 && num <= 1999){
      if(blue == 0) blue++;
    }else if(num >= 2000 && num <= 2399){
      if(yellow == 0) yellow++;
    }else if(num >= 2400 && num <= 2799){
      if(orange == 0) orange++;
    }else if(num >= 2800 && num <= 3199){
      if(red == 0) red++;
    }else{
      tmp++;
    }
  }
  max = gray + brown + green + lightblue + blue + yellow + orange + red;
  min = gray + brown + green + lightblue + blue + yellow + orange + red;
  if(n <= 8 || (max == 0 && tmp >= 1){
    max += tmp;
  }else if(n > 8 && max == 0){
    max = 8;
  }
  if(min == 0 && tmp >= 1) min = 1;
  cout << min << " " << max << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:38: error: expected ';' before '{' token
   36 |   if(n <= 8 || (max == 0 && tmp >= 1){
      |                                      ^
      |                                      ;
a.cc:38:4: error: expected primary-expression before 'else'
   38 |   }else if(n > 8 && max == 0){
      |    ^~~~
a.cc:38:4: error: expected ')' before 'else'
   38 |   }else if(n > 8 && max == 0){
      |    ^~~~
      |    )
a.cc:36:5: note: to match this '('
   36 |   if(n <= 8 || (max == 0 && tmp >= 1){
      |     ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <cctype>
#include <cmath>
#include <map>
#include <set>
#define rep(i, m, n) for(int i = m;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define ll long long
#define ull unsigned long long
#define pb(a) push_back(a)
#define popb(a) pop_back(a)
#define debug(x) cout<<#x<<": "<<x<<endl
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define PI 3.14159265358979
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
 
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
int main(){
  int n,a,cnt[15]={},sum1=0,sum2=0;
  bool flag=false;
  cin>>n;
  rep(i,0,n){
    cin>>a;
    a/=400;
    cnt[a]+++
    if((a>=8)flag=true;
  }
  rep(i,0,8){
    sum1+=cnt[i];
  }
  rep(i,8,13){
    sum2+=cnt[i];
  }
  if(flag){
    cout<<(++sum1)<<" "<<sum1+sum2<<endl;
  }else{
    cout<<sum1<<" "<<sum1<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:5: error: expected primary-expression before 'if'
   39 |     if((a>=8)flag=true;
      |     ^~
Language: C++

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

int N;
set<int> ratings;
int M = 0;

int main() {
	freopen("data.txt", "r", stdin);
	cin >> N;
	for (int i = 0; i < N; ++i) {
		int temp = 0; cin >> temp;
		if (temp >= 3200) {
			++M;
		} else {
			int r = temp / 400;
			ratings.insert(r);
		}
	}
	cout << max(ratings.size(), 1) << " " << (ratings.size() + M) << endl;
	return 0;
}

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <cctype>
#include <cmath>
#include <map>
#include <set>
#define rep(i, m, n) for(int i = m;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define ll long long
#define ull unsigned long long
#define pb(a) push_back(a)
#define popb(a) pop_back(a)
#define debug(x) cout<<#x<<": "<<x<<endl
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define PI 3.14159265358979
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
 
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
int main(){
  int n,a,cnt[15]={},sum1=0,sum2=0;
  bool flag=false;
  cin>>n;
  rep(i,0,n){
    cin>>a;
    cnt[a/400]+++
    if(a/400>=8)flag=true;
  }
  rep(i,0,8){
    sum1+=cnt[i];
  }
  rep(i,8,13){
    sum2+=cnt[i];
  }
  if(flag){
    cout<<(++sum1)<<" "<<sum1+sum2<<endl;
  }else{
    cout<<sum1<<" "<<sum1<<endl;
  }z
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:5: error: expected primary-expression before 'if'
   38 |     if(a/400>=8)flag=true;
      |     ^~
a.cc:50:4: error: 'z' was not declared in this scope
   50 |   }z
      |    ^
Language: C

#include <stdio.h>
int main(){
    int n, i;
    int data;
    int rate[8]={};
    int king=0;
    int ans=0;
    scanf("%d",&n);

    for(i=0;i<n;i++){
        scanf("%d",&data);
        if(data[i]<400){
            rate[0]=1;
        }else if(data<800){
            rate[1]=1;
        }else if(data<1200){
            rate[2]=1;
        }else if(data<1600){
            rate[3]=1;
        }else if(data<2000){
            rate[4]=1;
        }else if(data<2400){
            rate[5]=1;
        }else if(data<2800){
            rate[6]=1;
        }else if(data<3200){
            rate[7]=1;
        }else{
            king++;
        }
    }
    
    for(i=0;i<8;i++){
        if(rate[i]==1) ans++;
    }
    
    printf("%d ",ans);
    
    ans+=king;
    
    printf("%d\n",ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:16: error: subscripted value is neither array nor pointer nor vector
   12 |         if(data[i]<400){
      |                ^
Language: C++

#include <iostream>

using namespace std;

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

	int a[n];
	int b[9]={0};
	int total=0;
	int other=0;
	int cnt=0;
	int min=0;

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

	for(int i=0;i<n;i++){


		if(1<=a[i]&&a[i]<400){
			b[0]++;
		}
		else if(400<=a[i]&&a[i]<800){
			b[1]++;
		}
		else if(800<=a[i]&&a[i]<1200){
			b[2]++;
		}
		else if(1200<=a[i]&&a[i]<1600){
			b[3]++;
		}
		else if(1600<=a[i]&&a[i]<2000){
			b[4]++;
		}
		else if(2000<=a[i]&&a[i]<2400){
			b[5]++;
		}
		else if(2400<=a[i]&&a[i]<2800){
			b[6]++;
		}
		else if(2800<=a[i]&&a[i]<3200){
			b[7]++;
		}
		else{
			other++;
		}

		total++;
	}

	for(int i=0;i<8;i++){
		cout<<b[i]<<" ";
	}

	for(int i=0;i<8;i++){
		if(b[i]!=0){
			min++;
		}
	}
	cout<<endl;
	cout<<min<<" "l;

	// cout<<endl;

	// cout<<other<<endl;
	if(other==0){
		cout<<min<<endl;
	}else if(min+other>9){
		cout<<8<<endl;
	}else{
		cout<<other+min<<endl;
	}
	// cout<<cnt<<endl;
	// cout<<total<<endl;

	// cout<<other<<endl;


	// cout<<
	// if(other+cnt>9){
	// 	total=8;
	// }
	// cout<<cnt<<" "<<total<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:20: error: unable to find string literal operator 'operator""l' with 'const char [2]', 'long unsigned int' arguments
   64 |         cout<<min<<" "l;
      |                    ^~~~
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    for(int i=0;i < N;i++){
        cin >> a[i];
    }
    vector<bool> add_flag(8,true);
    int rate_normal_num = 0;
    int over_rate_num = 0;
    for(int i=0;i < N;i++){
        for(int j=0;j < 8;j++){
            if(j*400 <= a[i] && a[i] <= ((j+1)*400 - 1) && add_flag[j]){
                rate_normal_num ++;
                add_flag[j] = false;
            }
        }
        if(3200 <= a[i]){
            over_rate_num++;
        }
    }
    if{rate_normal_num == 0}{
        if(over_rate_num > 8){
            cout << "" << 1 << ' ' << 8;
        }else{
            cout << "" << 1 << ' ' << over_rate_num;
        }
    }else{
        if(rate_normal_num + over_rate_num > 8){
            cout << "" << rate_normal_num << ' ' << 8;
        }else{
            cout << "" << rate_normal_num << ' ' << rate_normal_num+over_rate_num;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:7: error: expected '(' before '{' token
   28 |     if{rate_normal_num == 0}{
      |       ^
      |       (
a.cc:34:6: error: 'else' without a previous 'if'
   34 |     }else{
      |      ^~~~
Language: C++

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

using namespace std;

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

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

    int sum = accumulate(c.begin(), c.end(), 0);

    if (sum + free_color <= 8) cout << sum << " " << sum + free_color << endl;
    else if (sum.size() == 0 && free_color <= 8) cout << 1 << " " << free_color << endl;
    else if (sum.size() == 0 && free_color > 8) cout << 1 << " " << 8 << endl;
    else cout << sum << " " << 8 << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:18: error: request for member 'size' in 'sum', which is of non-class type 'int'
   32 |     else if (sum.size() == 0 && free_color <= 8) cout << 1 << " " << free_color << endl;
      |                  ^~~~
a.cc:33:18: error: request for member 'size' in 'sum', which is of non-class type 'int'
   33 |     else if (sum.size() == 0 && free_color > 8) cout << 1 << " " << 8 << endl;
      |                  ^~~~
Language: C++

#include<iostream>
#include<set>
using namespace std;
 
int WhichColor(int rate) {
    if (rate >= 1 && rate <= 399)
        return 1;
    if (rate >= 400 && rate <= 799)
        return 2;
    if (rate >= 800 && rate <= 1199)
        return 3;
    if (rate >= 1200 && rate <= 1599)
        return 4;
    if (rate >= 1600 && rate <= 1999)
        return 5;
    if (rate >= 2000 && rate <= 2399)
        return 6;
    if (rate >= 2400 && rate <= 2799)
        return 7;
    if (rate >= 2800 && rate <= 3199)
        return 8;
    else
        return 0;
}
 
int main() {
    set<int> s;
    int N;
    while (cin >> N) {
        s.clear();
        int a, k = 0;
        for (int i = 1; i <= N; i++) {
            cin >> a;
            int color = WhichColor(a);
            if (color == 0)
                k++;
            s.insert(color);
        }
        int min = s.size();
        int max = min;
        if (k > 0) {
            if (min > 1)
                min -= 1;
            max += k - 1;
        }
        cout << min << " " << max << endl;
    }
    system("pause");
    return 0;
}


Compiler output:
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |  
      | ^
a.cc:25:1: error: extended character   is not valid in an identifier
   25 |  
      | ^
a.cc:4:1: error: '\U000000a0' does not name a type
    4 |  
      | ^
a.cc:25:1: error: '\U000000a0' does not name a type
   25 |  
      | ^
Language: C++

#include <iostream>
using namespace std;
int cnt=0,ans=0,n;
bool b[8];
int main(){
	cin>>n;
	memset(b,0,sizeof(b));
	for(int i=0;i<n;++i){
		int a,now;
		cin>>a;
		if(1<=a && a<=399) now=0;
		else if(400<=a && a<=799) now=1;
		else if(800<=a && a<=1199) now=2;
		else if(1200<=a && a<=1599) now=3;
		else if(1600<=a && a<=1999) now=4;
		else if(2000<=a && a<=2399) now=5;
		else if(2400<=a && a<=2799) now=6;
		else if(2800<=a && a<=3199) now=7;
		else {
			cnt++;
			continue;
		}
		if(!b[now]){
			ans++;
			b[now]=true;
		}
	}
	cout<<((!ans)?1:ans)<<" "<<min(8,ans+cnt)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'memset' was not declared in this scope
    7 |         memset(b,0,sizeof(b));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

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

int main(){
  int n;
  scanf("%d",&n);
  int a[1000]={0};
  int cnt1=0;
  int cnt2=0;
  int cnt3=0;
  int cnt4=0;
  int cnt5=0;
  int cnt6=0;
  int cnt7=0;
  int cnt8=0;
  int cnt9=0;

  for(int i = 0;i < n;i++){
    scanf("%d",&a[i]);
    if(a[i]<400){
      cnt1=1;
    }else if(a[i]<800){
      cnt2=1;
    }else if(a[i]<1200){
      cnt3=1;
    }else if(a[i]<1600){
      cnt4=1;
    }else if(a[i]<2000){
      cnt5=1;
    }else if(a[i]<2400){
      cnt6=1;
    }else if(a[i]<2800){
      cnt7=1;
    }else if(a[i]<3200){
      cnt8=1;
    }else{
      cnt9++;
    }
  }
  int res1 = cnt1+cnt2+cnt3+cnt4+cnt5+cnt6+cnt7+cnt8;

  res2 = res1 + cnt9;
  


  printf("%d %d",res1,res2);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:3: error: 'res2' was not declared in this scope; did you mean 'res1'?
   45 |   res2 = res1 + cnt9;
      |   ^~~~
      |   res1
Language: C++

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

using namespace std;

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

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

    int sum = accumulate(c.begin(), c.end(), 0);

    if (n_count + free_color <= 8) cout << sum << " " << sum + free_color << endl;
    else cout << sum << " " << 8 << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'n_count' was not declared in this scope
   31 |     if (n_count + free_color <= 8) cout << sum << " " << sum + free_color << endl;
      |         ^~~~~~~
Language: C++

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

int main(){
  int n;
  scanf("%d",&n);
  int a[1000]={0};
  int cnt1=0;
  int cnt2=0;
  int cnt3=0;
  int cnt4=0;
  int cnt5=0;
  int cnt6=0;
  int cnt7=0;
  int cnt8=0;
  int cnt9=0;

  for(int i = 0;i < n;i++){
    scanf("%d",&a[i]);
    if(a[i]<400){
      cnt1=1;
    }else if(a[i]<800){
      cnt2=1;
    }else if(a[i]<1200){
      cnt3=1;
    }else if(a[i]<1600){
      cnt4=1;
    }else if(a[i]<2000){
      cnt5=1;
    }else if(a[i]<2400){
      cnt6=1;
    }else if(a[i]<2800){
      cnt7=1;
    }else if(a[i]<3200){
      cnt8=1;
    }else{
      cnt9++;
    }
  }
  int res1 = cnt1+cnt2+cnt3+cnt4+cnt5+cnt6+cnt7+cnt8;
  int resout;
  int res2=0;
  if(res1==8){
    res2=8;
  }else if(res1==7&&cnt9>0){
    res2=8;
  }else if(res1<7&&res1/=0&&cnt9>=8-res1){
    res2=8;
  }else{
    res2 = res1 + cnt9;
  }


  printf("%d %d",res1,res2);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:24: warning: division by zero [-Wdiv-by-zero]
   50 |   }else if(res1<7&&res1/=0&&cnt9>=8-res1){
      |            ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
a.cc:50:18: error: lvalue required as left operand of assignment
   50 |   }else if(res1<7&&res1/=0&&cnt9>=8-res1){
      |            ~~~~~~^~~~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

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

	int c[9];
	memset(c, 0, sizeof c);
	for (int i = 0; i < n; i++)
	{
		int a;
		scanf("%d", &a);
		c[min(a / 400, 8)]++;
	}
	int mn = 0;
	for (int i = 0; i < 8; i++)
		mn += (c[i] > 0);
	if (mn)
		printf("%d %d\n", mn, mn + c[8]);
	else
		printf("1 %d\n", c[8]);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'nt' was not declared in this scope; did you mean 'int'?
    8 |         nt n;
      |         ^~
      |         int
a.cc:9:22: error: 'n' was not declared in this scope
    9 |         scanf("%d", &n);
      |                      ^
Language: C++

#include<iostream>
#include<vector>
#include<stack>
#include<algorithm>
#include<string>
#include<set>
#include<numeric>
#include<functional>
#include<unordered_map>
using namespace std;

int main()
{
    int N;
    cin >> N;
    int color[8];
    for (int i = 0; i < 8; i++)
        color[i] = 0;

    int free = 0;

    vector<int> a(N);

    for (int i = 0; i < N; i++) {
        cin >> a[i];
        if (0 <= a[i] && a[i] < 400)
            color[0]++;
        else if (400 <= a[i] && a[i] < 800)
            color[1]++;
        else if (800 <= a[i] && a[i] < 1200)
            color[2]++;
        else if (1200 <= a[i] && a[i] < 1600)
            color[3]++;
        else if (1600 <= a[i] && a[i] < 2000)
            color[4]++;
        else if (2000 <= a[i] && a[i] < 2400)
            color[5]++;
        else if (2400 <= a[i] && a[i] < 2800)
            color[6]++;
        else if (2800 <= a[i] && a[i] < 3200)
            color[7]++;
        else if (3200 <= a[i])
            free++;
    }
    int min_ = 0, max_;
    for (int i = 0; i < 8; i++) {
        if (color[i] > 0) min_++;
    }
    min_ max(min_, 1);
    max_ = min_ + free;
    printf("%d %d\n", min_, max_);}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:9: error: expected ';' before 'max'
   49 |     min_ max(min_, 1);
      |         ^~~~
      |         ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rFOR(i,a,b) for(int i=a;i>=b;i--)
#define rep(i,b) FOR(i,0,b)
#define INF 1e9
#define dump(x) cerr<< #x << " = "<<(x)<<endl
#define int long long

using ll = long long;
const ll mod = LLONG_MAX;

typedef pair<int,int> P;

int a[110];
bool isc[10];
int cnt,ret;
signed main(){
  int n;
  cin>>n;

  rep(i,n){
    cin>>a[i];
  }
  rep(i,10){
    isc[i]=false;
  }

  rep(i,n){
    if(a[i]<=399)isc[0]=true;
    else if(a[i]<=799)isc[1]=true;
    else if(a[i]<=1199)isc[2]=true;
    else if(a[i]<=1599)isc[3]=true;
    else if(a[i]<=1999)isc[4]=true;
    else if(a[i]<=2399)isc[5]=true;
    else if(a[i]<=2799)isc[6]=true;
    else if(a[i]<=3199)isc[7]=true;
    else cnt++;
  }

  rep(i,9){
    if(isc[i])ret++;
  }

  if(ret>0)t=0;
  else t=1;

  cout<<ret+t<<" "<<ret+cnt<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:12: error: 't' was not declared in this scope
   45 |   if(ret>0)t=0;
      |            ^
a.cc:46:8: error: 't' was not declared in this scope
   46 |   else t=1;
      |        ^
a.cc:48:13: error: 't' was not declared in this scope
   48 |   cout<<ret+t<<" "<<ret+cnt<<endl;
      |             ^