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

#include <bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main(){
	int n,m;cin>>n;m=n;
	int high=0;
	int gray=0;
	int brown=0;
	int green=0;
	int cyan=0;
	int blue=0;
	int yellow=0;
	int orange=0;
	int red=0;
	while(m--){
		int tmp;cin>>tmp;
		if(tmp<400) gray++;
		else if(tmp<800) brown++;
		else if(tmp<1200) green++;
		else if(tmp<1600) cyan++;
		else if(tmp<2000) blue++;
		else if(tmp<2400) yellow++;
		else if(tmp<2800) orange++;
		else if(tmp<3200) red++;
		else high++;
	}
	int a1=!!gray+!!brown+!!green+!!cyan+!!blue+!!yellow+!!orange+!!red;
	cout<<max(a1,1)<<" "<<a1+high;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:28:18: error: no matching function for call to 'max(long long int&, int)'
   28 |         cout<<max(a1,1)<<" "<<a1+high;
      |               ~~~^~~~~~
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:28:18: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   28 |         cout<<max(a1,1)<<" "<<a1+high;
      |               ~~~^~~~~~
/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:28:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   28 |         cout<<max(a1,1)<<" "<<a1+high;
      |               ~~~^~~~~~
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   
   boolean glay = false;
   boolean blown = false;
   boolean green = false;
   boolean sky = false;
   boolean blue = false;
   boolean yellow = false;
   boolean orange = false;
   boolean red = false;
   
   int tmp = 0;
   int allcount=0;
   for(int i = 0;i<N;i++) 
   {
     tmp = sc.nextInt();
     if(!glay&&tmp<400) glay = true;
     else if(!blown&&tmp<800) blown = true;
     else if(!green&&tmp<1200) green = true;
     else if(!sky&&tmp<1600) sky = true;
     else if(!blue&&tmp<2000) blue = true;
     else if(!yellow&&tmp<2400) yellow = true;
     else if(!orange&&tmp<2800) orange = true;
     else if(!red&&tmp<3200) red = true;
     else allcount++;
   }
   int anslow =0;
   if(glay) anslow++;
   if(blown) anslow++;
   if(green) anslow++;
   if(sky) anslow++;
   if(blue) anslow++;
   if(yellow) anslow++;
   if(orange) anslow++;
   if(red) anslow++;
   
   int  anshigh =0;
   if(anslow+allcount>=8) anshigh=8;
   else anshigh = anslow+allcount;
   System.println(anslow+" "+anshigh);
 }
}

Compiler output:
Main.java:44: error: cannot find symbol
   System.println(anslow+" "+anshigh);
         ^
  symbol:   method println(String)
  location: class System
1 error
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   
   boolean glay = false;
   boolean blown = false;
   boolean green = false;
   boolean sky = false;
   boolean blue = false;
   boolean yellow = false;
   boolean orange = false;
   boolean red = false;
   
   int tmp = 0;
   int allcount=0;
   for(int i = 0;i<N;i++) 
   {
     tmp = sc.nextInt();
     if(!glay&&tmp<400) glay = true;
     else if(!blown&&tmp<800) blown = true;
     else if(!green&&tmp<1200) green = true;
     else if(!sky&&tmp<1600) sky = true;
     else if(!blue&&tmp<2000) blue = true;
     else if(!yellow&&tmp<2400) yellow = true;
     else if(!orange&&tmp<2800) orange = true;
     else if(!red&&tmp<3200) red = true;
     else allcount++;
   }
   int anslow =0;
   if(glay) anslow++;
   if(blown) anslow++;
   if(green) anslow++;
   if(sky) anslow++;
   if(blue) anslow++;
   if(yellow) anslow++;
   if(orange) anslow++;
   if(red) anslow++;
   
   int  anshigh =0
   if(anslow+allcount>=8) anshigh=8;
   else anshigh = anslow+allcount;
   System.println(anslow+" "+anshigh);
 }
}

Compiler output:
Main.java:41: error: ';' expected
   int  anshigh =0
                  ^
1 error
Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
  int n, i, c[9], k, ans=0;
  cin >> n;
  int a[n];
  for(i=0; i<9; i++)
    c[i]=0;
  for(i=0; i<n; i++){
    cin >> a[i];
    k=a[i]/400;
    c[i]++;
  }
  sort(a, a+n);
  for(i=0; i<8; i++){
    if(c[i]>0)
      ans++;
  }
  cout << max(ans, 1) << " " << max(ans+c[8], 8);

Compiler output:
a.cc: In function 'int main()':
a.cc:21:50: error: expected '}' at end of input
   21 |   cout << max(ans, 1) << " " << max(ans+c[8], 8);
      |                                                  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:32:24: error: no matching function for call to 'max(int, std::basic_ostream<char>&)'
   32 |   if (cl.at(8) > 0) max(1, cout << sum - cl.at(8)) << " ";
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
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:32:24: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::basic_ostream<char>')
   32 |   if (cl.at(8) > 0) max(1, cout << sum - cl.at(8)) << " ";
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:32:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   32 |   if (cl.at(8) > 0) max(1, cout << sum - cl.at(8)) << " ";
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include<stdio.h>
int main(void){
	int num=0;
  	int a[num];
  	int result=0;
  int resultmin=0;	
  
  	int red=0;
  	int blue=0;
  	int yellow=0;
	int green=0;
  	int grly=0;
  	int softblue=0;
	int orange=0;
	int blown=0;
  	scanf("%d",&num);
  	for(int i=0;i<num;i++){
    	scanf("%d",&a[i]);
      	if(a[i]<399){
         	if(grly==1){
            }
          	else{
            	grly=1;
              	result++;
              	resultmin++;
            }
        }
        else if(a[i]<799){
         	if(blown==1){
            }
          	else{
            	blown=1;
              	result++;resultmin++;
            }
        }
        else if(a[i]<1199){
         	if(green==1){
            }
          	else{
            	green=1;
              	result++;resultmin++;
            }
        }
        else if(a[i]<1599){
         	if(softblue==1){
            }
          	else{
            	softblue=1;
              	result++;resultmin++;
            }
        }
        else if(a[i]<1999){
         	if(blue==1){
            }
          	else{
            	blue=1;
              	result++;resultmin++;
            }
        }     
		else if(a[i]<2399){
         	if(yellow==1){
            }
          	else{
            	yellow=1;
              	result++;resultmin++;
            }
        }     
		else if(a[i]<2799){
         	if(orange==1){
            }
          	else{
            	orange=1;
              	result++;resultmin++;
            }
        }
      	else if(a[i]<3199){
         	if(red==1){
            }
          	else{
            	red=1;
              	result++;resultmin++;
            }
        }    
      	else{result++;}
    }
  	printf("%d",resultmin,result)
}


Compiler output:
main.c: In function 'main':
main.c:86:38: error: expected ';' before '}' token
   86 |         printf("%d",resultmin,result)
      |                                      ^
      |                                      ;
   87 | }
      | ~
Language: C

#include<stdio.h>
int main(void){
	int num=0;
  	int a[num];
  	int result=0;
  int resultmin=0;	
  
  	int red=0;
  	int blue=0;
  	int yellow=0;
	int green=0;
  	int grly=0;
  	int softblue=0;
	int orange=0;
	int blown=0;
  	scanf("%d",&num);
  	for(int i=0;i<num;i++){
    	scanf("%d",a[i]);
      	if(a[i]<399){
         	if(grly==1){
            }
          	else{
            	grly=1;
              	result++;
              	resultmin++;
            }
        }
        else if(a[i]<799){
         	if(blown==1){
            }
          	else{
            	blown=1;
              	result++;resultmin++;
            }
        }
        else if(a[i]<1199){
         	if(green==1){
            }
          	else{
            	green=1;
              	result++;resultmin++;
            }
        }
        else if(a[i]<1599){
         	if(softblue==1){
            }
          	else{
            	softblue=1;
              	result++;resultmin++;
            }
        }
        else if(a[i]<1999){
         	if(blue==1){
            }
          	else{
            	blue=1;
              	result++;resultmin++;
            }
        }     
		else if(a[i]<2399){
         	if(yellow==1){
            }
          	else{
            	yellow=1;
              	result++;resultmin++;
            }
        }     
		else if(a[i]<2799){
         	if(orange==1){
            }
          	else{
            	orange=1;
              	result++;resultmin++;
            }
        }
      	else if(a[i]<3199){
         	if(red==1){
            }
          	else{
            	red=1;
              	result++;resultmin++;
            }
        }    
      	else{result++;}
    }
  	printf("%d",resultmin,result)
}

Compiler output:
main.c: In function 'main':
main.c:86:38: error: expected ';' before '}' token
   86 |         printf("%d",resultmin,result)
      |                                      ^
      |                                      ;
   87 | }
      | ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[n];
  int i;
    int color[9]={};
  for(i=0;i<n;i++){
    cin >> a[i];
    if(a[i]<3200)color[a[i]/400]++;
    else color[8]++;
  }
  int cnt = 0;
  for(i=0;i<=7;i++){
    if(color[i]>0) cnt++;
  }
  int max = min(8,cnt+color[8]);
  int min = max(1,cnt);

  cout << min << " " << max;
}

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

#include <bits/stdc++.h>
using namespace std;
const int N=1e5+5;
#define inf 0x3f3f3f3f
#define ll long long
int a[N],b[10];
int main() 
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		if(a[i]<400)
		{
			b[1]++;
		}
		else if(a[i]<800)
		{
			b[2]++;
		}
		else if(a[i]<1200)
		{
			b[3]++;
		}
		else if(a[i]<1600)
		{
			b[4]++;
		}
		else if(a[i]<2000)
			b[5]++;
		else if(a[i]<2400)
			b[6]++;
		else if(a[i]<2800)
			b[7]++;
		else if(a[i]<3200)
			b[8]++;
		else if(a[i]>=3200)
			cnt++;
	}
	int t=0;
	for(int i=1;i<=8;i++)
		if(b[i])
			t++;
	if(t==0)
		cout<<1<<" "<<cnt<<endl;
	else 
		cout<<t<<" "<<t+cnt<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   39 |                         cnt++;
      |                         ^~~
      |                         int
a.cc:46:31: error: 'cnt' was not declared in this scope; did you mean 'int'?
   46 |                 cout<<1<<" "<<cnt<<endl;
      |                               ^~~
      |                               int
a.cc:48:33: error: 'cnt' was not declared in this scope; did you mean 'int'?
   48 |                 cout<<t<<" "<<t+cnt<<endl;
      |                                 ^~~
      |                                 int
Language: C++

//#define NDEBUG
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <iostream>
#include <vector>

namespace n91 {

using i8 = std::int_fast8_t;
using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
using u8 = std::uint_fast8_t;
using u32 = std::uint_fast32_t;
using u64 = std::uint_fast64_t;
using isize = std::ptrdiff_t;
using usize = std::size_t;

struct rep {
  struct itr {
    usize i;
    constexpr itr(const usize i) noexcept : i(i) {}
    void operator++() noexcept { ++i; }
    constexpr usize operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
  };
  const itr f, l;
  constexpr rep(const usize f, const usize l) noexcept
      : f(std::min(f, l)), l(l) {}
  constexpr auto begin() const noexcept { return f; }
  constexpr auto end() const noexcept { return l; }
};
struct revrep {
  struct itr {
    usize i;
    constexpr itr(const usize i) noexcept : i(i) {}
    void operator++() noexcept { --i; }
    constexpr usize operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
  };
  const itr f, l;
  constexpr revrep(const usize f, const usize l) noexcept
      : f(l - 1), l(std::min(f, l) - 1) {}
  constexpr auto begin() const noexcept { return f; }
  constexpr auto end() const noexcept { return l; }
};
template <class T> auto md_vec(const usize n, const T &value) {
  return std::vector<T>(n, value);
}
template <class... Args> auto md_vec(const usize n, Args... args) {
  return std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
}
template <class T> constexpr T difference(const T &a, const T &b) noexcept {
  return a < b ? b - a : a - b;
}
template <class T> void chmin(T &a, const T &b) noexcept {
  if (b < a)
    a = b;
}
template <class T> void chmax(T &a, const T &b) noexcept {
  if (a < b)
    a = b;
}
template <class T> T scan() {
  T ret;
  std::cin >> ret;
  return ret;
}

} // namespace n91

#include <algorithm>
#include <array>
#include <functional>
#include <iomanip>
#include <iostream>
#include <utility>

namespace n91 {

void main_() {
  /*
  std::ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  //*/
  const usize n = scan<usize>();
  usize arbit = 0;
  std::array<usize, 8> count;
  std::fill(count.beign(), count.end(), static_cast<usize>(0));
  for (const usize i : rep(0, n)) {
    const usize a = scan<usize>();
    if (a < 3200) {
      count[a / 400] += 1;
    } else {
      arbit += 1;
    }
  }
  usize base = 0;
  for (const auto e : count) {
    if (e > 0) {
      base += 1;
    }
  }
  std::cout << std::max(base, static_cast<usize>(1)) << ' ' << base + arbit << std::endl;
}

} // namespace n91

int main() {
  n91::main_();
  return 0;
}


Compiler output:
a.cc: In function 'void n91::main_()':
a.cc:89:19: error: 'struct std::array<long unsigned int, 8>' has no member named 'beign'; did you mean 'begin'?
   89 |   std::fill(count.beign(), count.end(), static_cast<usize>(0));
      |                   ^~~~~
      |                   begin
Language: C++

#include<iostream>
#include<set>
#include<vector>
#include<string>
#include<algorithm>

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

    std::vector<int> a(n);
    for(int i = 0; i < n; i++){
        std::cin >> a.at(i);
    }

    std::set<std::string> S;
    int free = 0;

    for(int i = 0; i < n; i++){
        if(1 <= a.at(i) && a.at(i) <= 399){
            S.insert("gray");
        }
        else if(400 <= a.at(i) && a.at(i) <= 799){
            S.insert("brown");
        }
        else if(800 <= a.at(i) && a.at(i) <= 1199){
            S.insert("green");
        }
        else if(1200 <= a.at(i) && a.at(i) <= 1599){
            S.insert("light_blue");
        }
        else if(1600 <= a.at(i) && a.at(i) <= 1999){
            S.insert("blue");
        }
        else if(2000 <= a.at(i) && a.at(i) <= 2399){
            S.insert("yellow");
        }
        else if(2400 <= a.at(i) && a.at(i) <= 2799){
            S.insert("orange");
        }
        else if(2800 <= a.at(i) && a.at(i) <= 3199){
            S.insert("red");
        }
        else if(3200 <= a.at(i)){
            free++;
        }
    }

    int minN = S.size();
    int maxN;
    if(minN == 0) {
        minN = 1;
        maxN = free;
    }
    int maxN = minN + free;
    std::cout << minN << " " << maxN << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:9: error: redeclaration of 'int maxN'
   55 |     int maxN = minN + free;
      |         ^~~~
a.cc:50:9: note: 'int maxN' previously declared here
   50 |     int maxN;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define SUM(a)  accumulate((a).begin(),(a).end(),0)
#define SORT(a) sort(ALL(a))
#define REV(a) reverse(ALL(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
typedef long long ll;
const int INTINF = 1<<29;
const ll LLINF = 1LL<<61;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int DX[8]={ 0, 1, 0,-1, 1, 1,-1,-1};
const int DY[8]={ 1, 0,-1, 0, 1,-1, 1,-1};


int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  int a;
  int cnt[9] = {};
  cin >> n;
  int wild = 0;
  
  REP(i,n){
    cin >> a;
    cnt[min(a,3200)/400]++;
  }
  int sm = 0;
  REP(i,8){
      if(cnt[i]){
        sm++;
      }
  }
  cout << max(sm,1) << endl;
  cout << min(sm+cnt[8]) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:14: error: no matching function for call to 'min(int)'
   39 |   cout << min(sm+cnt[8]) << endl;
      |           ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:39:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   39 |   cout << min(sm+cnt[8]) << endl;
      |           ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define SUM(a)  accumulate((a).begin(),(a).end(),0)
#define SORT(a) sort(ALL(a))
#define REV(a) reverse(ALL(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
typedef long long ll;
const int INTINF = 1<<29;
const ll LLINF = 1LL<<61;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int DX[8]={ 0, 1, 0,-1, 1, 1,-1,-1};
const int DY[8]={ 1, 0,-1, 0, 1,-1, 1,-1};


int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  int a;
  int cnt[9] = {};
  cin >> n;
  int wild = 0;
  
  REP(i,n){
    cin >> a;
    if (a>=3200){
        cnt[8]
    }else{
      cnt[a/400]=1;
    }
  }
  int sm = 0;
  REP(i,8){
      sm+=cnt[i];
  }
  cout << max(sm,1) << " " << min(sm+cnt[8],8) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: expected ';' before '}' token
   31 |         cnt[8]
      |               ^
      |               ;
   32 |     }else{
      |     ~
Language: C

#include <stdio.h>

int main()
{
    int n,a[100],color[8] = 0;

    scanf("%d",&n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d",&a[i]);
        color[a[i] / 400] ++;
    }

    int max = 0,min = 101;

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

Compiler output:
main.c: In function 'main':
main.c:5:29: error: invalid initializer
    5 |     int n,a[100],color[8] = 0;
      |                             ^
Language: C++

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

int a[101];
int cnt,x,b,c,d,e,f,g,h,ans;
int  main()
{
    int n;  cin>>n;
    for(int i=0;i<n;i++)  cin>>a[i];
    sort(a,a+n);
    for(int i=0;i<n;i++)
    {
       if(a[i]>=0 && a[i]<=399)x=1;
       else if(a[i]>=400 && a[i]<=799)b=1;
       else if(a[i]>=800 && a[i]<=1199)c=1;
       else if(a[i]>=1200 && a[i]<=1599)d==1;
       else if(a[i]>=1600 && a[i]<=1999)e=1;
       else if(a[i]>=2000 && a[i]<=2399)f=1;
       else if(a[i]>=2400 && a[i]<=2799)h=1;
       else if(a[i]>=2800 && a[i]<=3199)g=1;
       else cnt++;
    }
   if(ans==0) return cout<<1<<' '<<cnt;
   else  cout<<ans<<' '<<cnt+ans;
   
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:34: error: cannot convert 'std::basic_ostream<char>' to 'int' in return
   23 |    if(ans==0) return cout<<1<<' '<<cnt;
      |                      ~~~~~~~~~~~~^~~~~
      |                                  |
      |                                  std::basic_ostream<char>
Language: C++

#include <bits/stdc++.h>

#define mod 1000000007

#define rep(i, n) for(int i=0; i<n; ++i)

using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
 
int main(void){
	
	int N, count = 0, ans = 0;
	
	cin >> N;
	
	bool check[8];
	check.assign(N, false);
	
	rep(i, N){
		int a;
		cin >> a;
		if(a <= 399)
			check[0] = true;
		else if(a <= 799)
			check[1] = true;
		else if(a <= 1199)
			check[2] = true;
		else if(a <= 1599)
			check[3] = true;
		else if(a <= 1999)
			check[4] = true;
		else if(a <= 2399)
			check[5] = true;
		else if(a <= 2799)
			check[6] = true;
		else if(a <= 3199)
			check[7] = true;
		else
			count++;
	}
	
	rep(i, 8)
		if(check[i])
			ans++;
		
	cout << ans << " " << ans + count << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: request for member 'assign' in 'check', which is of non-class type 'bool [8]'
   18 |         check.assign(N, false);
      |               ^~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> iro(8);
  int tuyotuyo=0;

  for(int i=0;i<n;i++){
    cin >> a.at(i);
  }
  sort(a.begin(),a.end());

  for(int k: a){
    if(1<=k && k<400){
      iro.at(0)++;
    }
    if(400<=k && k<800){
      iro.at(1)++;
    }
    if(800<=k && k<1200){
      iro.at(2)++;
    }
    if(1200<=k && k<1600){
      iro.at(3)++;
    }
    if(1600<=k && k<2000){
      iro.at(4)++;
    }
    if(2000<=k && k<2400){
      iro.at(5)++;
    }
    if(2400<=k && k<2800){
      iro.at(6)++;
    }
    if(2800<=k && k<3200){
      iro.at(7)++;
    }
    else{
      tuyotuyo++;
    }
  }
  sort(iro.begin(),iro.end())

  cout << iro(0) << iro(7)+tuyotuyo << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:30: error: expected ';' before 'cout'
   46 |   sort(iro.begin(),iro.end())
      |                              ^
      |                              ;
   47 | 
   48 |   cout << iro(0) << iro(7)+tuyotuyo << endl;
      |   ~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>



#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).end()

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;cin>>n;
  map<int,int>se;
  rep(i,n)
  {
    int a;cin>>a;
    se[a/400]++;

  }

  cout<<se.size()-se[8]>0<<" "<<max(se.size(),se.size()+se[8]-1);

  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:26: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
   45 |   cout<<se.size()-se[8]>0<<" "<<max(se.size(),se.size()+se[8]-1);
      |                         ~^~~~~
      |                         |  |
      |                         |  const char [2]
      |                         int
Language: C++

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
 
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007;

 
int main(){
    int n;cin >> n;
    int type[9] = {};
    rep(i,n){
        int rate;cin >> rate;
        rate /= 400;
        if(rate>= 8) rate = 8;
        type[rate] += 1;
    }
    int small = 0;
    for(int i = 0; i < 8; i++){
        if(type[i] > 0) small += 1;
    }
    int large = small + type[8];
    if(small == 0) small = 1;
    cout << small <<" "<< large<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:24:39: error: expected '}' at end of input
   24 |     cout << small <<" "<< large<<endl;
      |                                       ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const auto INF = (ll)1e9+7;  
using  p = pair<int,int>;
using  v = vector<int>;
auto c = vector<int>(9,0);

void color(int i){
   if(i<3200)
   		c[i/400]++;
	}else{
		c[8]++;
	}
}


int main(){
  int n;
  cin >> n;
  auto a = vector<int>(n,0);
  for (int i = 0; i < n; i++)
  {
     cin >> a[i];
     color(a[i]);
  }

  ll _min = 0;
  ll _max = 0;
  ll num = c.size()-1;
  for (int i = 0; i < c.size(); i++)
  {
     if(i!=num&&c[i]!=0){
        _min++;
     }

     if(i!=num&&c[i]==0&&c[num]>1){
        c[i]++;
        c[num]--;
     }

     if(c[i]!=0) _max++;
  }
  
  cout << _min << " " << _max<<endl;

}
  

Compiler output:
a.cc:12:10: error: expected unqualified-id before 'else'
   12 |         }else{
      |          ^~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    int N,x,ans=0;
    vector<int> a(9,0);
    cin >> N;
    for(int i=0;i<N;i++){
        cin >> x;
        for(int j=0;j<9;j++){
            if(j==8){
                if(j*400<=x){
                a[j]++;
                }
            }else(j*400<=x && x<400*(j+1)){
                a[j]++;
            }
        }
    }

    for(int i=0;i<8;i++){
        if(0<a[i]){
            ans++;
        }
    }

    cout << max(ans,1) << ' ' <<  ans + a[8] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:43: error: expected ';' before '{' token
   16 |             }else(j*400<=x && x<400*(j+1)){
      |                                           ^
      |                                           ;
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    int N,x,ans=0;
    vector<int> a(9,0);
    cin >> N;
    for(int i=0;i<N;i++){
        cin >> x;
        for(int j=0;j<9;j++){
            if(j==8){
                if(j*400<=x){
                a[j]++;
            }else(j*400<=x && x<400*(j+1)){
                a[j]++;
            }
        }
    }

    for(int i=0;i<8;i++){
        if(0<a[i]){
            ans++;
        }
    }

    cout << max(ans,1) << ' ' <<  ans + a[8] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:43: error: expected ';' before '{' token
   15 |             }else(j*400<=x && x<400*(j+1)){
      |                                           ^
      |                                           ;
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;

int a[9] = { 400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 10000 };
int b[9];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        int x;
        cin >> x;
        int j = 0;
        while (x >= a[j])
            ++j;
        b[j]++;
    }
    int sol = 0;
    for (int i = 0; i < 8; ++i)
        if (b[i])
            sol++;
    cout << max(1, sol) << ' ' << min(sol + b[8]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:38: error: no matching function for call to 'min(int)'
   31 |     cout << max(1, sol) << ' ' << min(sol + b[8]);
      |                                   ~~~^~~~~~~~~~~~
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:31:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   31 |     cout << max(1, sol) << ' ' << min(sol + b[8]);
      |                                   ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

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

int main(){
  int n;
  cin >> n;
  set<int> st;
  int cnt = 0;
  int a;
  for ( int i = 0; i < n; i++){
    cin >> a;
    if ( a/400 >= 8){
      cnt ++;
    } else {
      st.insert(a/400);
    }
  }

  cout << max(st.size(), 1) << " " << st.size() + cnt << endl;

  return 0;
}

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

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

int main(){
  int n;
  cin >> n;
  set<int> st;
  int cnt = 0;
  int a;
  for ( int i = 0; i < n; i++){
    cin >> a;
    if ( a/400 >= 8){
      cnt ++;
    } else {
      st.insert(a/400);
    }
  }

  cout << min(st.size(), 1) << " " << st.size() + cnt << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: no matching function for call to 'min(std::set<int>::size_type, int)'
   19 |   cout << min(st.size(), 1) << " " << st.size() + cnt << endl;
      |           ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:19:14: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   19 |   cout << min(st.size(), 1) << " " << st.size() + cnt << endl;
      |           ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:19:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   19 |   cout << min(st.size(), 1) << " " << st.size() + cnt << endl;
      |           ~~~^~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstring>
#define rep(i, N) for (int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
const ll LLINF = 9223372036854775807;
const int MOD = 1000000007;

int main() {
  int N; cin >> N;
  int a[N]; rep(i, N) cin >> a[i];
  int rate[9]={};
  rep(i, N) {
    if (a[i] >= 3200) rate[8]++;
    else rate[a[i]/400]++;
  }
  int r_min = 0;
  rep(i, 8) if (rate[i]!=0) r_min++;
  int r_max = r_min + rate[8];
  r_min = max(r_min, 1)
  cout << r_min << " " << r_max << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected ';' before 'cout'
   24 |   r_min = max(r_min, 1)
      |                        ^
      |                        ;
   25 |   cout << r_min << " " << r_max << endl;
      |   ~~~~
Language: C++

#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <map>

using namespace std;
 
int main() {
	int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
	cin >> N;
	vector<int> A(N,0);

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

		if(A[i] < 400){
			g = 1;
		}else if(A[i] < 800){
			b = 1;
		}else if(A[i] < 1200){
			gr = 1;
		}else if(A[i] < 1600){
			w = 1;
		}else if(A[i] < 2000){
			b = 1;
		}else if(A[i] < 2400){
			y = 1;
		}else if(A[i] < 2800){
			o = 1;
		}else if(A[i] < 3200){
			r = 1;
		}else {
			sai++;
		}
	}

	ans = g + b + gr + w + b + y + o + r;
	min = ans;
	max = ans + sai;
	if(8 <= max){
		max = 8;
	}

	cout << min << " "<< max <<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: redeclaration of 'int b'
   13 |         int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
      |                        ^
a.cc:13:17: note: 'int b' previously declared here
   13 |         int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
      |                 ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <map>

using namespace std;
 
int main() {
	int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
	cin >> N;
	vector<int> A(N,0);

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

		if(A[i] < 400){
			g = 1;
		}else if(A[i] < 800){
			b = 1;
		}else if(A[i] < 1200){
			gr = 1;
		}else if(A[i] < 1600){
			w = 1;
		}else if(A[i] < 2000){
			b = 1;
		}else if(A[i] < 2400){
			y = 1;
		}else if(A[i] < 2800){
			o = 1;
		}else if(A[i] < 3200){
			r = 1;
		}else {
			sai++;
		}
	}

	ans = g + b + gr + w + b + y + o + r;
	min = ans;
	max = ans + sai;
	if(8 <= max){
		max = 8;
	}

	cout << min << max <<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: redeclaration of 'int b'
   13 |         int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
      |                        ^
a.cc:13:17: note: 'int b' previously declared here
   13 |         int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
      |                 ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <map>

using namespace std;
 
int main() {
	int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
	cin >> N;
	vector<int> A(N,0);

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

		if(A[i] < 400){
			g = 1;
		}else if(A[i] < 800){
			b = 1;
		}else if(A[i] < 1200){
			gr = 1;
		}else if(A[i] < 1600){
			w = 1;
		}else if(A[i] < 2000){
			b = 1;
		}else if(A[i] < 2400){
			y = 1;
		}else if(A[i] < 2800){
			o = 1;
		}else if(A[i] < 3200){
			r = 1;
		}else {
			sai++;
		}
	}
	}

	

	ans = g + b + gr + w + b + y + o + r;
	min = ans;
	max = ans + sai;
	if(8 <= max){
		max = 8;
	}

	cout << min << endl;
	cout << max << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: redeclaration of 'int b'
   13 |         int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
      |                        ^
a.cc:13:17: note: 'int b' previously declared here
   13 |         int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
      |                 ^
a.cc: At global scope:
a.cc:44:9: error: 'ans' does not name a type
   44 |         ans = g + b + gr + w + b + y + o + r;
      |         ^~~
a.cc:45:9: error: 'min' does not name a type
   45 |         min = ans;
      |         ^~~
a.cc:46:9: error: 'max' does not name a type
   46 |         max = ans + sai;
      |         ^~~
a.cc:47:9: error: expected unqualified-id before 'if'
   47 |         if(8 <= max){
      |         ^~
a.cc:51:9: error: 'cout' does not name a type
   51 |         cout << min << endl;
      |         ^~~~
a.cc:52:9: error: 'cout' does not name a type
   52 |         cout << max << endl;
      |         ^~~~
a.cc:53:9: error: expected unqualified-id before 'return'
   53 |         return 0;
      |         ^~~~~~
a.cc:54:1: error: expected declaration before '}' token
   54 | }
      | ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <new>
#include <map>

using namespace std;
 
int main() {
	int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
	cin >> N;
	vector<int> A(N,0);

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

	for(int j = 0;j < N;j++){
		if(A[j] < 400){
			g = 1;
		}else if(A[j] < 800){
			b = 1;
		}else if(A[j] < 1200){
			gr = 1;
		}else if(A[j] < 1600){
			w = 1;
		}else if(A[j] < 2000){
			b = 1;
		}else if(A[j] < 2400){
			y = 1;
		}else if(A[j] < 2800){
			o = 1;
		}else if(A[j] < 3200){
			r = 1;
		}else {
			sai++;
		}
	}

	ans = g + b + gr + w + b + y + o + r;
	min = ans;
	max = ans + sai;
	if(8 <= max){
		max = 8;
	}

	cout << min << endl;
	cout << max << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: redeclaration of 'int b'
   13 |         int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
      |                        ^
a.cc:13:17: note: 'int b' previously declared here
   13 |         int N,g,b,gr,w,b,y,o,r,ans,sai,max,min;
      |                 ^
Language: Java

import java.util.*;
 
public class Main{

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

        int N = sc.nextInt();
        int[] a = new int[N];
        Map<String, Integer> map = new HashMap<>();
        for(int i = 0; i < N; i++){
            a[i] = sc.nextInt();
            if(1 <= a[i] && a[i] <= 399){
                map.put("grey", 1);
            } else if(a[i] <= 799){
                map.put("brown", 1);
            } else if(a[i] <= 1199){
                map.put("green", 1);
            } else if(a[i] <= 1599){
                map.put("mizu", 1);
            } else if(a[i] <= 1999){
                map.put("blue", 1);
            } else if(a[i] <= 2399){
                map.put("yellow", 1);
            } else if(a[i] <= 2799){
                map.put("orange", 1);
            } else if(a[i] <= 3199){
                map.put("red", 1);
            } else {
                if(map.containsKey("all"))
                    map.put("all", map.get("all") + 1);
                else
                    map.put("all", 1);
            }
        }
        sc.close();

        int min = 0;
        int max = 0;
        if(map.size() == 1 && !(map.containKey("all"))){
            min = 1;
            max = 1;
        } else if(map.size() == 1){
            min = 1;
            max = map.get("all");
        }else{
            for(String key: map.keySet()){
                if(key.equals("all")){
                    max += map.get(key);
                } else {
                    min += map.get(key);
                    max += map.get(key);
                }
            }
        }
        System.out.println(min + " " + max);
    }
}

Compiler output:
Main.java:40: error: cannot find symbol
        if(map.size() == 1 && !(map.containKey("all"))){
                                   ^
  symbol:   method containKey(String)
  location: variable map of type Map<String,Integer>
1 error