criyle/codenet-compile-errors huggingface dataset:
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){
            min = 1;
            max = 1;
        } 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);s
    }
}

Compiler output:
Main.java:53: error: not a statement
        System.out.println(min + " " + max);s
                                            ^
Main.java:53: error: ';' expected
        System.out.println(min + " " + max);s
                                             ^
2 errors
Language: Java

mport 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;
        for(String key: map.keySet()){
            if(key.equals("all")){
                max += map.get(key);
            } else {
                min += map.get(key);
                max += map.get(key);
            }
        }
        if(map.size() == 1 && !(map.containsKey("all")))
            System.out.println(min + " " + max);
        else
            System.out.println(1 + " " + max);
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <map>

using namespace std;

int N;

int main(){
  cin >> N;
  map<char,int> m;
  
  for(int i = 0; i < N; i++){
    int tmp;
    cin >> tmp;
    
    if(tmp >= 1 && tmp < 400)m['g']++;
    else if(tmp >= 400 && tmp < 800)m['n']++;
    else if(tmp >= 800 && tmp < 1200)m['e']++;
    else if(tmp >= 1200 && tmp < 1600)m['a']++;
    else if(tmp >= 1600 && tmp < 2000)m['b']++;
    else if(tmp >= 2000 && tmp < 2400)m['y']++;
    else if(tmp >= 2400 && tmp < 2800)m['o']++;
    else if(tmp >= 2800 && tmp < 3200)m['r']++;
    else if(tmp >= 3200)m['f']++;
  }
  
  int fixed = 0;
  int free = 0;
  
  for(auto iter = m.begin(); iter != m.end(); i++){   
    if(iter->first != 'f' && iter->second != 0) fixed++;
    else if(iter->first == 'f') free = iter->second;
  }
  int minc, maxc;
  minc = fixed + min(1,free);
  maxc = fixed + min((8-fixed), free);
  cout << minc << " " << maxc;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:47: error: 'i' was not declared in this scope
   31 |   for(auto iter = m.begin(); iter != m.end(); i++){
      |                                               ^
Language: C++

#include <iostream>
#include <vector>
#include <map>

using namespace std;

int N;

int main(){
  cin >> N;
  map<char,int> m;
  
  for(int i = 0; i < N; i++){
    int tmp;
    cin >> tmp;
    
    if(tmp >= 1 && tmp < 400)m['g']++;
    else if(tmp >= 400 && tmp < 800)m['n']++;
    else if(tmp >= 800 && tmp < 1200)m['e']++;
    else if(tmp >= 1200 && tmp < 1600)m['a']++;
    else if(tmp >= 1600 && tmp < 2000)m['b']++;
    else if(tmp >= 2000 && tmp < 2400)m['y']++;
    else if(tmp >= 2400 && tmp < 2800)m['o']++;
    else if(tmp >= 2800 && tmp < 3200)m['r']++;
    else if(tmp >= 3200)m['f']++;
  }
  
  int fixed = 0;
  int free = 0;
  
  for(auto iter = m.begin(), iter != m.end(), i++){   
    if(iter->first != 'f' && iter->second != 0) fixed++;
    else if(iter->first == 'f') free = iter->second;
  }
  int minc, maxc;
  minc = fixed + min(1,free);
  maxc = fixed + min((8-fixed), free);
  cout << minc << " " << maxc;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:34: error: expected ';' before '!=' token
   31 |   for(auto iter = m.begin(), iter != m.end(), i++){
      |                                  ^~~
      |                                  ;
a.cc:31:35: error: expected primary-expression before '!=' token
   31 |   for(auto iter = m.begin(), iter != m.end(), i++){
      |                                   ^~
a.cc:31:47: error: 'i' was not declared in this scope
   31 |   for(auto iter = m.begin(), iter != m.end(), i++){
      |                                               ^
a.cc:31:50: error: expected ';' before ')' token
   31 |   for(auto iter = m.begin(), iter != m.end(), i++){
      |                                                  ^
      |                                                  ;
Language: C++

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

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

  const segNum 8;
  int colorCnt[segNum+1];

  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    for (int j = 0; j < segNum; j++) {
      if (j*400 <= a && a < (j+1)*400) {
        colorCnt[j] = 1;
      }
    }
    if (a >= 400*segNum) {
      colorCnt[segNum+1]++;
    }
  }

  int max, min;
  for (int i = 0; i < segNum; i++) {
    if (colorCnt) {
      max++;
      min++;
    }
}
max += colorCnt[segNum+1];
if (min == 0) {
  min = 1;
}

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

return 0;
}


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

#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int n;
    cin >> n;
    int b[9];
    for(int i = 0; i < 9; i++) {
        b[i] = 0;
    }
    for(int i = 0; i < n; i++) {
        cin >> buf;
        if(buf < 400) {
            b[0]++;
        } else if(buf < 800) {
            b[1]++;
        } else if(buf < 1200) {
            b[2]++;
        } else if(buf < 1600) {
            b[3]++;
        } else if(buf < 2000) {
            b[4]++;
        } else if(buf < 2400) {
            b[5]++;
        } else if(buf < 2800) {
            b[6]++;
        } else if(buf < 3200) {
            b[7]++;
        } else if(buf >= 3200) {
            b[8]++;
        }
    }
    int cnt = 0;
    for(int i = 0; i < 8; i++) {
        if(b[i] != 0) {
            cnt += 1;
        }
    }
    ans1 = cnt;
    ans2 = cnt + b[8];
    cout << max(ans1, 1) << " " << min(ans2, 8) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:16: error: 'buf' was not declared in this scope
   41 |         cin >> buf;
      |                ^~~
a.cc:68:5: error: 'ans1' was not declared in this scope
   68 |     ans1 = cnt;
      |     ^~~~
a.cc:69:5: error: 'ans2' was not declared in this scope
   69 |     ans2 = cnt + b[8];
      |     ^~~~
Language: C++

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

int main() {
  int n;
  int vip=0;
  set<int> s;
  for (int i=0; i<n; i++) {
    int c;
    cin >> c;
    if (c < 400) s.insert(1);
    for (int j=1; j<=7; j++) {
    	if (400*j <= c && c < 400*j+400) s.insert(j+1);
    }
    if (c >= 3200) vip++;
  }
  int so = s.size(), p;
  if (so == 8) vip = 0;
  else if (8-so <= vip) p = 8-so;
  else p = vip;
  cout << so << " " << so+p << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'set' was not declared in this scope
    8 |   set<int> s;
      |   ^~~
a.cc:3:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    2 | #include <map>
  +++ |+#include <set>
    3 | using namespace std;
a.cc:8:7: error: expected primary-expression before 'int'
    8 |   set<int> s;
      |       ^~~
a.cc:12:18: error: 's' was not declared in this scope
   12 |     if (c < 400) s.insert(1);
      |                  ^
a.cc:14:42: error: 's' was not declared in this scope
   14 |         if (400*j <= c && c < 400*j+400) s.insert(j+1);
      |                                          ^
a.cc:18:12: error: 's' was not declared in this scope; did you mean 'so'?
   18 |   int so = s.size(), p;
      |            ^
      |            so
a.cc:20:25: error: 'p' was not declared in this scope
   20 |   else if (8-so <= vip) p = 8-so;
      |                         ^
a.cc:21:8: error: 'p' was not declared in this scope
   21 |   else p = vip;
      |        ^
a.cc:22:27: error: 'p' was not declared in this scope
   22 |   cout << so << " " << so+p << endl;
      |                           ^
Language: C++

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


int main() {
  int N;
  cin >> N;
  vector<int> cols(9);
  for (int i=0; i<N; ++i) {
    int rate;
    cin >> rate;
    int start = 0;
    for (int j=0; start!=2800; start+=400, ++j) {
      if (start <= rate <= start + 399) {
        ++cols[j];
        break;
      }
    }
    if (3200 <= rate) {
      ++cols[j+1];
    }
  }
  int min_n = 0, max_n = 0;
  int cnt = 0;
  for (int i=0; i<9; ++i) {
    if (i != 8) {
      if (0 < cols[i]) {
        ++min_n, ++max_n;
        ++cnt;
      }
    } else {
      min_n += max(0, 2 - cnt);
      max_n += cols[i];
    }
  }
  cout << min_n << " " << max_n << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: 'j' was not declared in this scope
   20 |       ++cols[j+1];
      |              ^
Language: C++

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> TUP;
#define a first
#define b second
#define sz size()
#define pb(x) push_back(x) 
#define bg begin()
#define ed end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define mp(x,y) make_pair(x,y)
const ll MOD=1000000007;

//a,b x
int main(){
	ll N; cin>>N;
	vector<ll> A(N);
	vector<bool> color(8,false);
	rep(i,N) cin>>A[i];
	ll i=0;
	ll cnt=0;
	while(i<=N-1){
		if(A[i]<400){
			color[0]=true;
		}
		else if(A[i]<800){
			color[1]=true;
		}
		else if(A[i]<1200){
			color[2]=true;
		}
		else if(A[i]<1600){
			color[3]=true;
		}
		else if(A[i]<2000){
			color[4]=true;
		}
		else if(A[i]<2400){
			color[5]=true;
		}
		else if(A[i]<2800){
			color[6]=true;
		}
		else if(A[i]<3200){
			color[7]=true;
		}else{
			cnt++;
		}
		i++;
	}
	ll C=0;
	rep(i,8){
		if(color[i]==true) C++;
	}
	printf("%lld %lld",max(1,C),C+cnt);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:31: error: no matching function for call to 'max(int, ll&)'
   59 |         printf("%lld %lld",max(1,C),C+cnt);
      |                            ~~~^~~~~
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:59:31: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   59 |         printf("%lld %lld",max(1,C),C+cnt);
      |                            ~~~^~~~~
/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:59:31: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   59 |         printf("%lld %lld",max(1,C),C+cnt);
      |                            ~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  int a,c,d=0;
  cin>>a;
  vector<int> b(9,0);
  fo(i,a){
    cin>>c;
    b.at(min<int>(8,c/400))++;
  }
  fo(i,8){
    if(b.at(i)>0)
      d++;
  }
  if(d>0)
  cout<<d<<endl<<d+b.at(8)<<endl;
  else
    cout<<1<<<<endl<<b.at(8)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:14: error: expected primary-expression before '<<' token
   72 |     cout<<1<<<<endl<<b.at(8)<<endl;
      |              ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  int a,c,d=0;
  cin>>a;
  vector<int> b(9,0);
  fo(i,a){
    cin>>c;
    b.at(min(8,c/400))++;
  }
  fo(i,8){
    if(b.at(i)>0)
      d++;
  }
  cout<<d<<endl<<d+b.at(8)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:13: error: no matching function for call to 'min(int, long long int)'
   63 |     b.at(min(8,c/400))++;
      |          ~~~^~~~~~~~~
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:63:13: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   63 |     b.at(min(8,c/400))++;
      |          ~~~^~~~~~~~~
/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:63:13: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   63 |     b.at(min(8,c/400))++;
      |          ~~~^~~~~~~~~
Language: C

#include <stdio.h>

int main(){
  int N,a[110],i,num[10],temp,sum,max,min;
  
  //Nとa[i]を入力
  scanf("%d",&N);
  for(i=0; i<N; i++){
  	scanf("%d",&a[i]);
  }
  
  //num[i],sum,max,minを初期化
  for(i=0; i<9; i++){num[i]=0;}
  sum=0; max=-1; min=10;
  
  //a[i]がどのクラスnum[i]に入るか分別
  //num[i]該当者がいればnum[i]をインクリ
  for(i=0; i<N; i++){
  	temp=a[i]/400;
  	  if(temp>=8){temp=8;}
    num[temp]++;
  }
  
  for(i=0; i<8; i++){
  	if(num[i]!=0){sum++;}
  }
  
  min=sum;
  max=sum+temp[8];
  	if(max>8){max=8;}
  
  printf("%d %d",min,max);
  
  return(0);
}


Compiler output:
main.c: In function 'main':
main.c:29:15: error: subscripted value is neither array nor pointer nor vector
   29 |   max=sum+temp[8];
      |               ^
Language: C

#include <stdio.h>

int main(){
  int N,a[110],i,num[10],temp,sum,max,min;
  
  //Nとa[i]を入力
  scanf("%d",&N);
  for(i=0; i<N; i++){
  	scanf("%d",&a[i]);
  }
  
  //num[i],sum,max,minを初期化
  for(i=0; i<9; i++){num[i]=0;}
  sum=0; max=-1, min=10
  
  //a[i]がどのクラスnum[i]に入るか分別
  //num[i]該当者がいればnum[i]をインクリ
  for(i=0; i<N; i++){
  	temp=a[i]/400;
  	  if(temp>=8){temp=8;}
    num[temp]++;
  }
  
  for(i=0; i<8; i++){
  	if(num[i]!=0){sum++;}
  }
  
  min=sum;
  max=sum+temp[8];
  	if(max>8){max=8;}
  
  printf("%d %d",min,max);
  
  return(0);
}


Compiler output:
main.c: In function 'main':
main.c:14:24: error: expected ';' before 'for'
   14 |   sum=0; max=-1, min=10
      |                        ^
      |                        ;
......
   18 |   for(i=0; i<N; i++){
      |   ~~~                   
main.c:29:15: error: subscripted value is neither array nor pointer nor vector
   29 |   max=sum+temp[8];
      |               ^
Language: C

#include <stdio.h>

main(){
  int N,a[110],i,num[10],temp,sum,max,min;
  
  //Nとa[i]を入力
  scanf("%d",&N);
  for(i=0; i<N; i++){
  	scanf("%d",&a[i]);
  }
  
  //num[i],sum,max,minを初期化
  for(i=0; i<9; i++){num[i]=0;}
  sum=0; max=-1, min=10
  
  //a[i]がどのクラスnum[i]に入るか分別
  //num[i]該当者がいればnum[i]をインクリ
  for(i=0; i<N; i++){
  	temp=a[i]/400;
  	  if(temp>=8){temp=8;}
    num[temp]++;
  }
  
  for(i=0; i<8; i++){
  	if(num[i]!=0){sum++;}
  }
  
  min=sum;
  max=sum+temp[8];
  	if(max>8){max=8;}
  
  printf("%d %d",min,max);
  
}


Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:14:24: error: expected ';' before 'for'
   14 |   sum=0; max=-1, min=10
      |                        ^
      |                        ;
......
   18 |   for(i=0; i<N; i++){
      |   ~~~                   
main.c:29:15: error: subscripted value is neither array nor pointer nor vector
   29 |   max=sum+temp[8];
      |               ^
Language: C

#include <stdio.h>

main(){
  int N,a[110],i,num[10],temp,sum,max,min;
  
  //Nとa[i]を入力
  scanf("%d",&N);
  for(i=0; i<N; i++){
  	scanf("%d",a[i]);
  }
  
  //num[i],sum,max,minを初期化
  for(i=0; i<9; i++){num[i]=0;}
  sum=0; max=-1, min=10
  
  //a[i]がどのクラスnum[i]に入るか分別
  //num[i]該当者がいればnum[i]をインクリ
  for(i=0; i<N; i++){
  	temp=a[i]/400;
  	  if(temp>=8){temp=8;}
    num[temp]++;
  }
  
  for(i=0; i<8; i++){
  	if(num[i]!=0){sum++;}
  }
  
  min=sum;
  max=sum+temp[8];
  	if(max>8){max=8;}
  
  printf("%d %d",min,max);
  
}


Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:14:24: error: expected ';' before 'for'
   14 |   sum=0; max=-1, min=10
      |                        ^
      |                        ;
......
   18 |   for(i=0; i<N; i++){
      |   ~~~                   
main.c:29:15: error: subscripted value is neither array nor pointer nor vector
   29 |   max=sum+temp[8];
      |               ^
Language: C

#include <stdio.h>

main(){
  int N,a[100],color[8],sum,i,temp,max;
  
  scanf("%d",&N);
 
  for(i=0;i<N;i++){
  scanf("%d",&a[i]);
  }
  
  for(i=0;i<8;i++){color[i]=0;}
  sum=0; max=-1;

  for(i=0;i<N;i++){
    temp=a[i]/400;
    	if(temp>8){temp=7;}
    color[temp]++;
  }
 
  for(i=0;i<8;i++){
    if(max<=color[i]){max=clor[i];}
    if(color[i]){sum++;}
  }
  
  printf("%d %d",sum,max+color[7]);
}


Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:22:27: error: 'clor' undeclared (first use in this function); did you mean 'color'?
   22 |     if(max<=color[i]){max=clor[i];}
      |                           ^~~~
      |                           color
main.c:22:27: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

main(){
  int N,a[100],color[8],sum,i,temp,max;
  
  scanf("%d",&N);
 
  for(i=0;i<N;i++){
  scanf("%d",&a[i]);
  }
  
  for(i=0;i<8;i++){color[i]=0;}
  sum=0; max=-1;

  for(i=0;i<N;i++){
    temp=a[i]/400;
    	if(temp>8){temp=7;}
    color[temp]++;
  }
 
  for(i=0;i<7;i++){
    if(max<=color[i]){max=clor[i];}
    if(color[i]){sum++;}
  }
  
  printf("%d %d",sum,max+color[7]);
}


Compiler output:
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:22:27: error: 'clor' undeclared (first use in this function); did you mean 'color'?
   22 |     if(max<=color[i]){max=clor[i];}
      |                           ^~~~
      |                           color
main.c:22:27: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

#define LL long long
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;

int main() {
    int N;
    cin >> N;
    int a[N];
    REP(i, N)cin >> a[i];
    int c[9];
    fill(c, c + 9, 0);
    REP(i, N) {
        c[min(a[i]/400, 8)]++;
    }
    int mn = 0;
    REP(i, 8) {
        if(c[i])mn++;
    }
    mn = max(1, mn);
    int mx = mn + c[8]
    cout << mn << " " << mx << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:5: error: expected ',' or ';' before 'cout'
   28 |     cout << mn << " " << mx << endl;
      |     ^~~~
Language: C++

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

#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define mem(x,val) memset((x),(val),sizeof(x))
#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define PI acos(-1.0) 
#define N 111111

const int INF = 1 << 30 ;
typedef long long ll ;
typedef pair < int , int > pii ;

int main() {
  int n, a, sp = 0 ;
  scanf("%d", &n) ;
  set<int> color ;

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

  cout << max(color.size(),1) << ' ' << color.size()+sp << endl ;
	
  return 0 ;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: no match for 'operator[]' (operand types are 'std::set<int>' and 'int')
   23 |     if(a<=399)color[0]++ ;
      |                    ^
a.cc:34:14: error: no matching function for call to 'max(std::set<int>::size_type, int)'
   34 |   cout << max(color.size(),1) << ' ' << color.size()+sp << 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:34:14: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   34 |   cout << max(color.size(),1) << ' ' << color.size()+sp << 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:34:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   34 |   cout << max(color.size(),1) << ' ' << color.size()+sp << endl ;
      |           ~~~^~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define lp(i,n) for(int i=0;i<n;i++)
#define lps(i,j,n) for(int i=j;i<n;i++)
#define fordebug int hoge;cin>>hoge;
#define DEKAI 1000000007;
#define INF (1<<28)
#define int long long
#define double long double
#define floot10 cout<<fixed<<setprecision(10)
int x[9];


 
 
signed main(){
  int n;
  cin>>n;
  lp(i,n){
    int a;
    cin>>a;
    a/=400;
    x[min(a,8)]++;
  }
  int cnt=0;
  lp(i,8)if(x[i]>0)cnt++;
  cout<<cnt<<" "<<cnt+x[8]<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:10: error: no matching function for call to 'min(long long int&, int)'
   23 |     x[min(a,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:   template argument deduction/substitution failed:
a.cc:23:10: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   23 |     x[min(a,8)]++;
      |       ~~~^~~~~
/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:23:10: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   23 |     x[min(a,8)]++;
      |       ~~~^~~~~
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<tuple>
#define int long 
using namespace std;

signed main() {
	int N;
	cin >> N;
	int A = 0;
	int B = 0;
	int C = 0;
	int D = 0;
	int E = 0;
	int F = 0;
	int G = 0;
	int H = 0;
	int I = 0;
	for(int i = 0;i < N;i++) {
		int S;
		cin >> S;
		if(1 <= S && S <= 399) {
			A++;
		}
		else if(400 <= S && S <= 799) {
			B++;
		}
		else if(800 <= S && S <= 1199) {
			C++;
		}
		else if(1200 <= S && S <= 1599) {
			D++;
		}
		else if(1600 <= S && S <= 1999) {
			E++;
		}
		else if(2000 <= S && S <= 2399) {
			F++;
		}
		else if(2400 <= S && S <= 2799) {
			G++;
		}
		else if(2800 <= S && S <= 3199) {
			H++;
		}
		else {
			I++;
          	if(I > 8) {
              	I = 8;
            }
		}
	}
	int answer = 0;
	if(A != 0) {
		answer++;
	}
	if(B != 0) {
		answer++;
	}
	if(C != 0) {
		answer++;
	}
	if(D != 0) {
		answer++;
	}
	if(E != 0) {
		answer++;
	}
	if(F != 0) {
		answer++;
	}
	if(G != 0) {
		answer++;
	}
	if(H != 0) {
		answer++;
	}
	if(answer == 0 && I != 0) {
      	if(I > 8) {
			cout << 1 << " " << 8 << endl;
        }
      	else {
          	cout << 1 << " " << I << endl;
	}
  	else if(answer != 0 && I == 0) {
      	cout << answer << " " << answer << endl;
    }
  	else {
      	if(answer + I > 8) {
          cout << answer << " " << 8 << endl;
        }
      	else {
          cout << answer << " " << answer + I << endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:89:9: error: expected '}' before 'else'
   89 |         else if(answer != 0 && I == 0) {
      |         ^~~~
a.cc:82:35: note: to match this '{'
   82 |         if(answer == 0 && I != 0) {
      |                                   ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
signed main(){
  int a;
  int c=0;
  int d=0;
  int e=0;
  int f=0;
  int g=0;
  int h=0;
  int j=0;
  int k=0;
  int l=0;
  int m=0;
  cin>>a;
  vector<int> b(a);
  rep(i,a)
  cin>>b.at(i);
  rep(i,b.size()){
    if(b.at(i)<400){
        d++;
      if(d==1)
        c++;
        }
  if(400<=b.at(i)&&b.at(i)<800){
        m++;
      if(m==1)
        c++;
        }
  if(800<=b.at(i)&&b.at(i)<1200){
        f++;
      if(f==1)
        c++;
        }
  if(1200<=b.at(i)&&b.at(i)<1600){
        g++;
      if(g==1)
        c++;
        }
  if(1600<=b.at(i)&&b.at(i)<2000){
        h++;
      if(h==1)
        c++;
        }
  if(2000<=b.at(i)&&b.at(i)<2400){
        j++;
      if(j==1)
        c++;
        }
  if(2400<=b.at(i)&&b.at(i)<2800){
        k++;
      if(k==1)
        c++;
        }
  if(2800<=b.at(i)&&b.at(i)<3200){
        l++;
      if(l==1)
        c++;
        }
    if(3200<=b.at(i))
      e++;
    }
  if(d==0&&m==0&&f==0&&g==0&&h==0&&j==0&&k==0&&l==0)
    cout<<1<<' '<<e
    else
      cout<<c<<' '<<c+e;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:66:20: error: expected ';' before 'else'
   66 |     cout<<1<<' '<<e
      |                    ^
      |                    ;
   67 |     else
      |     ~~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
signed main(){
  int a;
  int c=0;
  int d=0;
  int e=0;
  int f=0;
  int g=0;
  int h=0;
  int j=0;
  int k=0;
  int l=0;
  cin>>a;
  vector<int> b(a);
  rep(i,a)
  cin>>b.at(i);
  rep(i,b.size()){
    if(b.at(i)<400){
        d++;
      if(d==1)
        c++;
        }
  if(400<=b.at(i)&&b.at(i)<800){
        e++;
      if(e==1)
        c++;
        }
  if(800<=b.at(i)&&b.at(i)<1200){
        f++;
      if(f==1)
        c++;
        }
  if(1200<=b.at(i)&&b.at(i)<1600){
        g++;
      if(g==1)
        c++;
        }
  if(1600<=b.at(i)&&b.at(i)<2000){
        h++;
      if(h==1)
        c++;
        }
  if(2000<=b.at(i)&&b.at(i)<2400){
        j++;
      if(j==1)
        c++;
        }
  if(2400<=b.at(i)&&b.at(i)<2800){
        k++;
      if(k==1)
        c++;
        }
  if(2800<=b.at(i)&&b.at(i)<3200){
        l++;
      if(l==1)
        c++;
        }
    cout<<c<<' '<<c+e;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:62:6: error: expected '}' at end of input
   62 |     }
      |      ^
a.cc:5:14: note: to match this '{'
    5 | signed main(){
      |              ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
signed main(){
  int a;
  int c=0;
  int d=0;
  int e=0;
  int f=0;
  int g=0;
  int h=0;
  int j=0;
  int k=0;
  int l=0;
  cin>>a;
  vector<int> b(a);
  rep(i,a)
  cin>>b.at(i);
  rep(i,b.size()){
    if(b.at(i)<400){
        d++;
      if(d==1)
        c++;
        }
  if(400<=b.at(i)&&b.at(i)<800){
        e++;
      if(e==1)
        c++;
        }
  if(800<=b.at(i)&&b.at(i)<1200){
        f++;
      if(f==1)
        c++;
        }
  if(1200<=b.at(i)&&b.at(i)<1600){
        g++;
      if(g==1)
        c++;
        }
  if(1600<=b.at(i)&&b.at(i)<2000){
        h++;
      if(h==1)
        c++;
        }
  if(2000<=b.at(i)&&b.at(i)<2400){
        j++;
      if(j==1)
        c++;
        }
  if(2400<=b.at(i)&&b.at(i)<2800){
        k++;
      if(k==1)
        c++;
        }
  if(2800<=b.at(i)&&b.at(i)<3200){
        l++;
      if(l==1)
        c++;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:60:10: error: expected '}' at end of input
   60 |         }
      |          ^
a.cc:20:18: note: to match this '{'
   20 |   rep(i,b.size()){
      |                  ^
a.cc:60:10: error: expected '}' at end of input
   60 |         }
      |          ^
a.cc:5:14: note: to match this '{'
    5 | signed main(){
      |              ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
int main(){
  int a;
  int c=0;
  int e=0;
  cin>>a;
  vector<int> b(a);
  rep(i,a)
  cin>>b.at(i);
  rep(i,b.size()){
    if(b.at(i)<400){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(400<=b.at(i)&&b.at(i)<800){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(800<=b.at(i)&&b.at(i)<1200){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(1200<=b.at(i)&&b.at(i)<1600){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(1600<=b.at(i)&&b.at(i)<2000){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(2000<=b.at(i)&&b.at(i)<2400){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(2400<=b.at(i)&&b.at(i)<2800){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(2800<=b.at(i)&&b.at(i)<3200){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(3200<b.at(i))
    e++;
  }
  cout<<c;
  cout<<c+e;
  }

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
int main{
  int a;
  int c=0;
  int e=0;
  cin>>a;
  vector<int> b(a);
  rep(i,a)
  cin>>b.at(i);
  rep(i,b.size()){
    if(b.at(i)<400){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(400<=b.at(i)&&b.at(i)<800){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(800<=b.at(i)&&b.at(i)<1200){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(1200<=b.at(i)&&b.at(i)<1600){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(1600<=b.at(i)&&b.at(i)<2000){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(2000<=b.at(i)&&b.at(i)<2400){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(2400<=b.at(i)&&b.at(i)<2800){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(2800<=b.at(i)&&b.at(i)<3200){
      int d=0;
        d++;
      if(d==1)
        c++;
        }
  if(3200<b.at(i))
    e++;
  }
  cout<<c;
  cout<<c+e;
  }

Compiler output:
a.cc:4:5: error: cannot declare '::main' to be a global variable
    4 | int main{
      |     ^~~~
a.cc:5:3: error: expected primary-expression before 'int'
    5 |   int a;
      |   ^~~
a.cc:5:3: error: expected '}' before 'int'
a.cc:4:9: note: to match this '{'
    4 | int main{
      |         ^
a.cc:8:3: error: 'cin' does not name a type
    8 |   cin>>a;
      |   ^~~
a.cc:9:17: error: 'a' was not declared in this scope
    9 |   vector<int> b(a);
      |                 ^
a.cc:2:18: error: expected unqualified-id before 'for'
    2 | #define rep(i,n) for(int i=0;i<n;++i)
      |                  ^~~
a.cc:10:3: note: in expansion of macro 'rep'
   10 |   rep(i,a)
      |   ^~~
a.cc:10:7: error: 'i' does not name a type
   10 |   rep(i,a)
      |       ^
a.cc:2:30: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;++i)
      |                              ^
a.cc:2:34: error: expected unqualified-id before '++' token
    2 | #define rep(i,n) for(int i=0;i<n;++i)
      |                                  ^~
a.cc:10:3: note: in expansion of macro 'rep'
   10 |   rep(i,a)
      |   ^~~
a.cc:2:18: error: expected unqualified-id before 'for'
    2 | #define rep(i,n) for(int i=0;i<n;++i)
      |                  ^~~
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(i,b.size()){
      |   ^~~
a.cc:12:7: error: 'i' does not name a type
   12 |   rep(i,b.size()){
      |       ^
a.cc:2:30: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i=0;i<n;++i)
      |                              ^
a.cc:2:34: error: expected unqualified-id before '++' token
    2 | #define rep(i,n) for(int i=0;i<n;++i)
      |                                  ^~
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(i,b.size()){
      |   ^~~
a.cc:64:3: error: 'cout' does not name a type
   64 |   cout<<c;
      |   ^~~~
a.cc:65:3: error: 'cout' does not name a type
   65 |   cout<<c+e;
      |   ^~~~
a.cc:66:3: error: expected declaration before '}' token
   66 |   }
      |   ^
Language: C++

#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;

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

	auto over = 0;
	set<int> s;
	for (auto i = 0; i < N; ++i)
	{
		int a;
		cin >> a;
		auto temp = a / 400;
		if (temp >= 8)
		{
			++over;
		}
		else
		{
			s.insert(temp);
		}
	}

	cout << s.size() << " " << min(8u, s.size() + over) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:39: error: no matching function for call to 'min(unsigned int, std::set<int>::size_type)'
   39 |         cout << s.size() << " " << min(8u, s.size() + over) << endl;
      |                                    ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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:39:39: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'std::set<int>::size_type' {aka 'long unsigned int'})
   39 |         cout << s.size() << " " << min(8u, s.size() + over) << 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,
                 from a.cc:4:
/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:39:39: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned int'
   39 |         cout << s.size() << " " << min(8u, s.size() + over) << endl;
      |                                    ~~~^~~~~~~~~~~~~~~~~~~~~
Language: C++

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


int main(){
  int n;
  cin >> n;
  vector<pair<int, int>q(n);
  for(int i=0; i<n; ++i){
    int a=0; cin >> a;
    int b=0;
    if(a<=399) b=0;
    else if(a>400 && a<=799) b=1;
      
    else if(a>800 && a<=1199) b=2;
      
    else if(a>1200 && a<=1599) b=3;
      
    else if(a>1600 && a<=1999) b=4;
      
    else if(a>2000 && a<=2399) b=5;
      
    else if(a>2400 && a<=2799) b=6;
      
    else if(a>2800 && a<=3199) b=7;
    
    else if(a>3200) b=8;
    
    q[i]=make_pair(b ,a);
    
  }
  
  sort(q.begin(), q.end());
  int res1=count(q.begin(), q.end(), 8);
  int res2=q.erase(unique(q.begin(), q.end()), q.end());
  
  cout << res1+res2-1 << ""<< res2<< endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:27: error: template argument 1 is invalid
    8 |   vector<pair<int, int>q(n);
      |                           ^
a.cc:8:27: error: template argument 2 is invalid
a.cc:29:5: error: 'q' was not declared in this scope
   29 |     q[i]=make_pair(b ,a);
      |     ^
a.cc:33:8: error: 'q' was not declared in this scope
   33 |   sort(q.begin(), q.end());
      |        ^
Language: C++

#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;

typedef long long ll;
//typedef pair<int,int> Pint;
typedef pair<ll, ll> P;
//typedef pair<int, pair<int, int>> P;
//typedef tuple<int,int,int> T;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define revrep(i, n) for(ll i = n-1; i >= 0; i--)
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}

ll INFL = 1000000000000000010;//10^18 = 2^60
int INF = 1000000000;//10^9
ll MOD  = 1000000007;
//vector<int> dy = {0,0,1,-1};
//vector<int> dx = {1,-1,0,0};

int main(){
  int N;
  cin >> N;
  vector<int> S(20);
  rep(i, N){
    int a; cin >> a;
    S[a / 400]++;
  }
  ll ans = 0;
  ll m = 0;
  rep(i, 7){
    ans += (S[i] > 0);
  }
  min = ans;
  for(int i = 7; i < 20; i++){
    ans += S[i];
  }
  cout << min(m, 1) << endl;
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:119:9: error: overloaded function with no contextual type information
  119 |   min = ans;
      |         ^~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  int a, mini = 0, maxi = 0;
  rep(i, n) {
    cin >> a;
    if(a < 3200) {
      maxi++;
      mini++;
    else {
      maxi++;
    }
  }
    cout << mini << maxi << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: expected '}' before 'else'
   15 |     else {
      |     ^~~~
a.cc:12:18: note: to match this '{'
   12 |     if(a < 3200) {
      |                  ^