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

#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;
const int MAXN = 2e5;
const int INF = 1e9 + 7;
/*
void init(int x, int l, int r) {
    if (l == r) {
        tree[x] = INF;
    } else {
        int mid = (l + r) / 2;
        init(x + x, l, mid);
        init(x+x+1, mid + 1, r);
        tree[x] = min(tree[x + x], tree[x + x + 1]);
    }
}
int get(int x, int l, int r, int tl, int tr) {
    if (r < tl || tr < l) {
        return INF;
    }
    if (tl <= l && r <= tr) {
        return tree[x];
    }
    int mid = (l + r) / 2;
    return min(get(x + x, l, mid, tl, tr), get(x+x+1, mid + 1, r, tl, tr));
}
void upd(int x, int l, int r, int pos, int val) {
    if (l == r) {
        tree[x] = min(tree[x], val);
    } else {
        int mid = (l + r) / 2;
        if (pos <= mid) {
            upd(x + x, l, mid, pos, val);
        } else {
            upd(x+x+1, mid + 1, r, pos, val);
        }
        tree[x ] =min(tree[x + x], tree[x + x +1]);
    }
}

*/
int main() {
    int n;
    scanf("%d", &n);
    vector<int> v;
    for (int i = 1; i<= n; i++) {
        int x;
        scanf("%d", &x);
        v.push_back(x);
    }
    sort(v.begin(), v.end());
    long long ans = 0;
    for (int i = 1; i < v.size(); i++) {
        ans += 1ll * (v[i] - v[i - 1]);
    }
    cout << ans;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   52 |     sort(v.begin(), v.end());
      |     ^~~~
      |     short
Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,n) for(int i=1;i<(int)(n);i++)

typedef long long ll;
using namespace std;
int main()
{
  ll n,a[110];
  cin>>n;
  rep(i,n)cin>>a[i];
  ll cnt[9]={0};
  rep(i,n){
    if(a[i]>=1&&a[i]<400){
      cnt[0]++;
    }else if(a[i]>=400&&a[i]<800){
      cnt[1]++;
    }else if(a[i]>=800&&a[i]<1200){
      cnt[2]++;
    }else if(a[i]>=1200&&a[i]<1600){
      cnt[3]++;
    }else if(a[i]>=1600&&a[i]<2000){
      cnt[4]++;
    }else if(a[i]>=2000&&a[i]<2400){
      cnt[5]++;
    }else if(a[i]>=2400&&a[i]<2800){
      cnt[6]++;
    }else if(a[i]>=2800&&a[i]<3200){
      cnt[7]++;
    }else if(a[i]>=3200){
      cnt[8]++;
    }
  }
  ll m=0;
  rep(i,8){
    if(cnt[i]>0)m++;
  }

  cout<<max(1,m)<<" "<<m+cnt[8]<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:12: error: no matching function for call to 'max(int, ll&)'
   39 |   cout<<max(1,m)<<" "<<m+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: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:39:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   39 |   cout<<max(1,m)<<" "<<m+cnt[8]<<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:39:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   39 |   cout<<max(1,m)<<" "<<m+cnt[8]<<endl;
      |         ~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = 1; i < (int)(n+1); i++)
int main(){
   int N;
   cin>>N;
   int ans=0;
   vector<int>A(N);
   vector<int>B(8);
   int S=0;
   rep(i,8){
       B[i]=0;
   }
   rep(i,N){
       cin>>A[i];
       if(3200<=A[i]){
           S++;
       }
       else{
           B[A[i]/400]++;
       }
   }
    rep(i,8){
        if(B[i]!=0){
            ans++;
        }
    }
    cout<<max(ans,1)<<" "<<ans+p<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:32: error: 'p' was not declared in this scope
   31 |     cout<<max(ans,1)<<" "<<ans+p<<endl;
      |                                ^
Language: C++

v#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n-1; i >= 0; i--)
#define all(x) x.begin(), x.end()
using ll = long long;
using pii = pair<int, int>;
const int mod = 1e9+7;

int main() {
    int n;
    cin >> n;
    int a[n];
    set<int> s;
    int red = 0;
    rep(i, n) {
        cin >> a[i];
        if (a[i] < 3200) s.insert(a[i] / 400);
        else red++;
    }
    int MIN = min((int)s.size(), 1);
    int MAX = (int)s.size() + red;
    printf("%d %d\n", MIN, MAX);
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc:7:13: error: 'pair' does not name a type
    7 | using pii = pair<int, int>;
      |             ^~~~
a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope
   12 |     cin >> n;
      |     ^~~
a.cc:14:5: error: 'set' was not declared in this scope
   14 |     set<int> s;
      |     ^~~
a.cc:14:9: error: expected primary-expression before 'int'
   14 |     set<int> s;
      |         ^~~
a.cc:18:26: error: 's' was not declared in this scope
   18 |         if (a[i] < 3200) s.insert(a[i] / 400);
      |                          ^
a.cc:21:24: error: 's' was not declared in this scope
   21 |     int MIN = min((int)s.size(), 1);
      |                        ^
a.cc:21:15: error: 'min' was not declared in this scope; did you mean 'main'?
   21 |     int MIN = min((int)s.size(), 1);
      |               ^~~
      |               main
a.cc:23:5: error: 'printf' was not declared in this scope
   23 |     printf("%d %d\n", MIN, MAX);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | v#include <bits/stdc++.h>
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: no matching function for call to 'max(long long int&, int)'
   16 |     cout << max(t, 1) << ' ' << t + c[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:16:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   16 |     cout << max(t, 1) << ' ' << t + c[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:16:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   16 |     cout << max(t, 1) << ' ' << t + c[8];
      |             ~~~^~~~~~
Language: C++

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

int main(){
    int N, ans = 0;
    cin >> N;
    vector<int> a(N);
    for(auto& x: a) cin >> x;
    unordered_map<string,int> mp;
    for(int i = 0; i < N; ++i){
        if     (   1 <= a[i] && a[i] <=  399) ++mp["gray"];
        else if( 400 <= a[i] && a[i] <=  799) ++mp["brown"];
        else if( 800 <= a[i] && a[i] <= 1199) ++mp["green"];
        else if(1200 <= a[i] && a[i] <= 1599) ++mp["mizu"];
        else if(1600 <= a[i] && a[i] <= 1999) ++mp["blue"];
        else if(2000 <= a[i] && a[i] <= 2399) ++mp["yellow"];
        else if(2400 <= a[i] && a[i] <= 2799) ++mp["orange"];
        else if(2800 <= a[i] && a[i] <= 3199) ++mp["red"];
        else ++mp["over"];
    }
    for(auto x: mp){
        if(x.first != "over") ++ans;
    }
    if(mp["over"] != 0){
        else cout << max(ans,1) << " " << ans + mp["over"] << endl;
    }
    else cout << ans << " " << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: expected '}' before 'else'
   25 |         else cout << max(ans,1) << " " << ans + mp["over"] << endl;
      |         ^~~~
a.cc:24:24: note: to match this '{'
   24 |     if(mp["over"] != 0){
      |                        ^
a.cc: At global scope:
a.cc:27:5: error: expected unqualified-id before 'else'
   27 |     else cout << ans << " " << ans << endl;
      |     ^~~~
a.cc:28:5: error: expected unqualified-id before 'return'
   28 |     return 0;
      |     ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
#define rep(i, f, n) for (int i = (f); i < (int)(n); i++)
#define repe(i, f, n) for (int i = (f); i <= (int)(n); i++)
#define accum(x) accumulate((x).begin(), (x).end(), 0)
using namespace std;
using ll = long long;
using pint = pair<int, int>;

const int COLORS = 8;

int main() {
  int n, a, free = 0;
  cin >> n;
  vector<int> v(COLORS);
  rep(i, 0, n) {
    cin >> a;
    int color;
    if (1 <= a && a <= 399)
      color = 0;
    else if (400 <= a && a <= 799)
      color = 1;
    else if (800 <= a && a <= 1199)
      color = 2;
    else if (1200 <= a && a <= 1599)
      color = 3;
    else if (1600 <= a && a <= 1999)
      color = 4;
    else if (2000 <= a && a <= 2399)
      color = 5;
    else if (2400 <= a && a <= 2799)
      color = 6;
    else ifggV (2800 <= a && a <= 3199)
      color = 7;
    else if (3200 <= a)
      free++;
    v[color]++;
  }

  int ma = accum(v);
  int mi = 0;
  rep(i, 0, COLORS) mi += v[i];
  if (free == n)
    cout << 1 << " " << ma << endl;
  else
    cout << mi << " " << ma << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:10: error: 'ifggV' was not declared in this scope
   39 |     else ifggV (2800 <= a && a <= 3199)
      |          ^~~~~
a.cc:41:5: error: 'else' without a previous 'if'
   41 |     else if (3200 <= a)
      |     ^~~~
Language: C++

#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#define rep(i,n) for (int i= 0;i<(n);++i)
using namespace std;
typedef long long ll;
#define MOD 1000000007
int main()
{   
    ll N ;
    cin >> N ;
    ll a[N] ;
    ll lv[9] ;
    for(ll j = 0 ; j < 9 ; j++ ){ 
        lv[j] = 0 ;
    }
    for(ll i = 0 ; i < N ; i++){
        cin >> a[i] ;
        if(a[i] < 400 ) lv[0]++ ;
        else if(a[i] < 800) lv[1]++ ;
        else if(a[i] < 1200) lv[2]++ ;
        else if(a[i] < 1600) lv[3]++ ;
        else if(a[i] < 2000) lv[4]++ ;
        else if(a[i] < 2400) lv[5]++ ;
        else if(a[i] < 2800) lv[6]++ ;
        else if(a[i] < 3200) lv[7]++ ;
        else lv[8]++ ;
    }
    
    ll ans = 0 ;
    for(ll j = 0 ; j < 8 ; j++){
        //cout << lv[j] << endl;
        if(lv[j] > 0){
          ans++ ;
        }
    }
    if(ans == 0{
        cout << 1 <<" "<< endl;
    }else{
    cout << ans << " " ;
    }
    ans += lv[8] ;
    
    cout << ans << endl;
    


    

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:16: error: expected ';' before '{' token
   41 |     if(ans == 0{
      |                ^
      |                ;
a.cc:43:6: error: expected primary-expression before 'else'
   43 |     }else{
      |      ^~~~
a.cc:43:6: error: expected ')' before 'else'
   43 |     }else{
      |      ^~~~
      |      )
a.cc:41:7: note: to match this '('
   41 |     if(ans == 0{
      |       ^
Language: Java

import java.util.HashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main5(sc);
        m.solve();
        m.show();
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    int[] a;
    int max;
    int min;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        a = new int[N];
        for (int i=0; i<N; i++) {
        	a[i] = sc.nextInt();
        }
    }
    
    //解答処理
    private void solve() {
    	HashMap<String,Integer> map = new HashMap<String,Integer>();
    	for (int i=0; i<N; i++) {
    		int count = 1;
    		String tmp = color(a[i]);
    		if (map.containsKey(tmp)) {
    			count += map.get(tmp);
    		}
    		map.put(tmp, count);
    	}
    	
    	if (!map.containsKey("colorless")) {
    		min = map.size();
    		max = map.size();
    	} else {
    		min = map.size()-1;
    		max = min + map.get("colorless");
    		if (map.size() == 1) { //全員が3200以上の場合
    			min = map.size();
    		}
    		
    	}
    }
    
    //a[i]のレートの色を判別するメソッド
    private String color(int a) {
    	String color = "colorless";
    	if (1<=a && a<400) {
    		color = "gray";
    	} else if (400<=a && a<800) {
    		color = "brown";
    	} else if (800<= a && a<1200) {
    		color ="green";
    	} else if (1200<=a && a<1600) {
    		color = "ligthBlue";
    	} else if (1600<=a && a<2000) {
    		color = "blue";
    	} else if (2000<=a && a<2400) {
    		color = "yellow";
    	} else if (2400<=a && a<2800) {
    		color = "orange";
    	} else if (2800<=a && a<3200) {
    		color = "red";
    	}
    	
    	return color;
    }
    
    //出力
    public void show() {
        System.out.print(min);
        System.out.print(" ");
        System.out.print(max);
    }

}


Compiler output:
Main.java:7: error: cannot find symbol
        Main m = new Main5(sc);
                     ^
  symbol:   class Main5
  location: class Main
1 error
Language: C++

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

int main(void)
{
    int n,c=0; cin>>n;
    vector<int> color(9,0);
    rep(i,n){
        ll a; cin>>a;
        if(a<3200) color[a/400]++;
        else color[8]++;
    }
    rep(i,8) if(color[i]) c++;
    if(c) cout << c;
    else cout << 1;
    cout << " " << c+color[8] << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'll' was not declared in this scope
   10 |         ll a; cin>>a;
      |         ^~
a.cc:10:20: error: 'a' was not declared in this scope
   10 |         ll a; cin>>a;
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define IOS                  \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define repd(i, a, b) for (int i = a; i >= (b); --i)
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;

int main()
{
    int n;
    cin >> n;
    map<int, int> mp;
    rep(i, 0, n)
    {
        int t;
        cin >> t;
        mp[t / 400]++;
    }
    int min = 0, mmax = 0;
    rep(i, 0, 9)
    {
        if (i == 8)
        {
            if (min == 0)
            {
                mmax++;
                min++;
            }
            else
            {
                mmax += mp[8];
                mmax = min(8, mmax);
            }
        }
        else if (mp[i] > 0)
        {
            min++;
            mmax++;
        }
    }
    cout << min << " " << mmax << endl;
}


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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;

int main() {
	int n, num, mi = 0, max = 0;
	cin >> n;
	vector <int> a(8);
	for (int i = 0; i < n; i++) {
		cin >> num;
	}
	for (int i = 0; i < n; i++) {
		if (num / 400 < 8) {
			a[num / 400]++;
		}
		else {
			max++;
		}
		for (int i = 0; i < 8; i++) {
			if (a[i] > 0) {
				mi++;
			}
		}
		if (mi != 0) {
			cout << mi << " " << mi + max << endl;
		}
		else {
			cout << min(mi, max) << " " << mi + max << endl;
		}
		return 0;
}

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

#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define pi 3.14159265358979323846264338327950L
using namespace std;

int main() {
  int N, hai=0, cha=0, midori=0, mizu=0, ao=0, ki=0, daidai=0, aka=0, kin=0, c=0;
  cin >> N;
  for (int i=0; i<N; i++) {
    cin >> a[i];
    if (a[i]<400) {
      hai=hai+1;
    }
    else if (a[i]<800) {
      cha=cha+1;
    }
    else if (a[i]<1200) {
      midori=midori+1;
    }
    else if (a[i]<1600) {
      mizu=mizu+1;
    }
    else if (a[i]<2000) {
      ao=ao+1;
    }
    else if (a[i]<2400) {
      ki=ki+1;
    }
    else if (a[i]<2800) {
      daidai=daidai+1;
    }
    else if (a[i]<3200) {
      aka=aka+1;
    }
    else {
      kin=kin+1;
    }
  }
  if (hai>0) {
    c=c+1;
  }
  if (cha>0) {
    c=c+1;
  }
  if (midori>0) {
    c=c+1;
  }
  if (mizu>0) {
    c=c+1;
  }
  if (ao>0) {
    c=c+1;
  }
  if (ki>0) {
    c=c+1;
  }
  if (daidai>0) {
    c=c+1;
  }
  if (aka>0) {
    c=c+1;
  }
  cout << c << " " << min((c+kin),8) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:12: error: 'a' was not declared in this scope
   24 |     cin >> a[i];
      |            ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
using ull = unsigned long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

template<class T>
bool ChangeMax(T&a,const T&b){
  if(a >= b) return false;
  a = b;    return true;
}

template<class T>
bool ChangeMin(T&a,const T&b){
  if(a <= b) return false;
  a = b;    return true;  
}

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  int n; cin >> n;
  map<int> mp;
  for(int i = 0; i < n; ++i){
    int x; cin >> x;
    mp[min(x/400,8)]++;
  }
  int x = mp.count(8);
  cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:41:10: error: wrong number of template arguments (1, should be at least 2)
   41 |   map<int> mp;
      |          ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:44:7: error: invalid types 'int[const int]' for array subscript
   44 |     mp[min(x/400,8)]++;
      |       ^
a.cc:46:14: error: request for member 'count' in 'mp', which is of non-class type 'int'
   46 |   int x = mp.count(8);
      |              ^~~~~
a.cc:47:18: error: request for member 'size' in 'mp', which is of non-class type 'int'
   47 |   cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl;
      |                  ^~~~
a.cc:47:58: error: request for member 'size' in 'mp', which is of non-class type 'int'
   47 |   cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl;
      |                                                          ^~~~
a.cc:47:77: error: request for member 'size' in 'mp', which is of non-class type 'int'
   47 |   cout << max(mp.size() - (x>0),1) << ' ' << (x ? min(mp.size()-1+x,8) : mp.size()) << endl;
      |                                                                             ^~~~
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int[] a = new int[n];
		for(int i=0; i<a.length; i++){
			a[i] = scn.nextInt();
		}
      	int gra = 0;
      	int bro = 0;
      	int gre = 0;
      	int ligh = 0;
      	int blu = 0;
      	int yel = 0;
      	int ora = 0;
      	int red = 0;
      	int xxx = 0;
      	int count = 0;
      	for(int i=0; i<a.length; i++){
          if(a[i]>0 || a[i]<400){
            gra++;
            if(gra==1) count++;
          }
          if(a[i]>=400 || a[i]<800){
            bro++;
            if(bro==1) count++;
          }
          if(a[i]>=800 || a[i]<1200){
            gre++;
            if(gre==1) count++;
          }
          if(a[i]>=1200 || a[i]<1600){
            lith++;
            if(lith==1) count++;
          }
          if(a[i]>=1600 || a[i]<2000){
            blu++;
            if(blu==1) count++;
          }
          if(a[i]>=2000 || a[i]<2400){
            yel++;
            if(yel==1) count++;
          }
          if(a[i]>=2400 || a[i]<2800){
            ora++;
            if(ora==1) count++;
          }
          if(a[i]>=2800 || a[i]<3200){
            red++;
            if(red==1) count++;
          }
          if(a[i]>=3200) xxx++;
        }
      	System.out.println(count,count+xxx);
	}
}

Compiler output:
Main.java:35: error: cannot find symbol
            lith++;
            ^
  symbol:   variable lith
  location: class Main
Main.java:36: error: cannot find symbol
            if(lith==1) count++;
               ^
  symbol:   variable lith
  location: class Main
Main.java:56: error: no suitable method found for println(int,int)
      	System.out.println(count,count+xxx);
      	          ^
    method PrintStream.println() is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(boolean) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(char) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(int) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(long) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(float) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(double) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(char[]) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(String) is not applicable
      (actual and formal argument lists differ in length)
    method PrintStream.println(Object) is not applicable
      (actual and formal argument lists differ in length)
3 errors
Language: C++

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

int color(int n) {
  if (n < 400) return 1;
  else if (n < 800) return 2;
  else if (n < 1200) return 3;
  else if (n < 1600) return 4;
  else if (n < 2000) return 5;
  else if (n < 2400) return 6;
  else if (n < 2800) return 7;
  else if (n < 3200) return 8;
  else return 0;
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int n;
  cin >> n;
  set<int> s;
  int c = 0;
  for (int i = 1; i <= n; i++) {
    int t;
    cin >> t;
    t = color(t);
    if (t) s.insert(t);
    else c++;
  }
  cout << max((int) s.size(), 1) << ' ' << s.size() + c << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:14: error: no matching function for call to 'max(long long int, int)'
   41 |   cout << max((int) s.size(), 1) << ' ' << s.size() + c << '\n';
      |           ~~~^~~~~~~~~~~~~~~~~~~
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:41:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   41 |   cout << max((int) s.size(), 1) << ' ' << s.size() + c << '\n';
      |           ~~~^~~~~~~~~~~~~~~~~~~
/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:41:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   41 |   cout << max((int) s.size(), 1) << ' ' << s.size() + c << '\n';
      |           ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

int color(int n) {
  if (n < 400) return 1;
  else if (n < 800) return 2;
  else if (n < 1200) return 3;
  else if (n < 1600) return 4;
  else if (n < 2000) return 5;
  else if (n < 2400) return 6;
  else if (n < 2800) return 7;
  else if (n < 3200) return 8;
  else return 0;
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int n;
  cin >> n;
  set<int> s;
  int c = 0;
  for (int i = 1; i <= n; i++) {
    int t;
    cin >> t;
    t = color(t);
    if (t) s.insert(t);
    else c++;
  }
  cout << max(s.size(), 1) << ' ' << s.size() + c << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:14: error: no matching function for call to 'max(std::set<long long int>::size_type, int)'
   41 |   cout << max(s.size(), 1) << ' ' << s.size() + c << '\n';
      |           ~~~^~~~~~~~~~~~~
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:41:14: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'int')
   41 |   cout << max(s.size(), 1) << ' ' << s.size() + c << '\n';
      |           ~~~^~~~~~~~~~~~~
/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:41:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   41 |   cout << max(s.size(), 1) << ' ' << s.size() + c << '\n';
      |           ~~~^~~~~~~~~~~~~
Language: C++

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

int color(int n) {
  if (n < 400) return 1;
  else if (n < 800) return 2;
  else if (n < 1200) return 3;
  else if (n < 1600) return 4;
  else if (n < 2000) return 5;
  else if (n < 2400) return 6;
  else if (n < 2800) return 7;
  else if (n < 3200) return 8;
  else return 0;
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int n;
  cin >> n;
  set<int> s;
  int c = 0;
  for (int i = 1; i <= n; i++) {
    int t;
    cin >> t;
    t = color(t);
    if (t) s.insert(t);
    else c++;
  }
  cout << s.size() << ' ' << min(s.size() + c, 8LL) << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:33: error: no matching function for call to 'min(long long unsigned int, long long int)'
   41 |   cout << s.size() << ' ' << min(s.size() + c, 8LL) << '\n';
      |                              ~~~^~~~~~~~~~~~~~~~~~~
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:41:33: note:   deduced conflicting types for parameter 'const _Tp' ('long long unsigned int' and 'long long int')
   41 |   cout << s.size() << ' ' << min(s.size() + c, 8LL) << '\n';
      |                              ~~~^~~~~~~~~~~~~~~~~~~
/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:41:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long unsigned int'
   41 |   cout << s.size() << ' ' << min(s.size() + c, 8LL) << '\n';
      |                              ~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    int n,ex=0;
    cin>>n;
    vector<int>v;

    for(int i=0; i<n; i++)
    {
        int a;
        cin>>a;
        v.push_back(a);
    }
    set<pair<int,int> >s;
    sort(v.begin(),v.end());
    for(int i=0; i<n; i++)
    {
        if(v[i]>=1 && v[i]<=399)
        {
            s.insert({1,399});
        }
        if(v[i]>=400 && v[i]<=799)
        {
            s.insert({400,799});
        }
        if(v[i]>=800 && v[i]<=1199)
        {
            s.insert({800,1199});
        }
        if(v[i]>=1200 && v[i]<=1599)
        {
            s.insert({1200,1599});
        }
        if(v[i]>=1600 && v[i]<=1999)
        {
            s.insert({1600,1999});
        }
        if(v[i]>=2000 && v[i]<=2399)
        {
            s.insert({2000,2399});
        }
        if(v[i]>=2400 && v[i]<=2799)
        {
            s.insert({2400,2799});
        }
        if(v[i]>=2800 && v[i]<=3199)
        {
            s.insert({2800,3199});
        }
        if(v[i]>=3200)
            ex++;
    }
    int mn,mx;
    mn=s.size();
    mx=s.size();
    if(mn==0)
        mn=1;
    mx+=ex
    cout<<mn<<" " <<mx<<endl;


    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:73:11: error: expected ';' before 'cout'
   73 |     mx+=ex
      |           ^
      |           ;
   74 |     cout<<mn<<" " <<mx<<endl;
      |     ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  int r;
  vector<bool> memo(8);
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (a >= 3200) {
      r++;
    }
    else {
      int c = 0;
      while (true) {
        a -= 400;
        if (a < 0) {
          break;
        }
        c++;
      }
      memo.at(c) = true;
    }
  }
  int ans = 0;
  for (int i = 0; i < 8; i++) {
    if (mmeo.at(i)) {
      ans++;
    }
  }
  cout << ans << endl;
  if (ans + r >= 8) {
    cout << 8 << endl;
  }
  else {
    cout << ans + r << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'mmeo' was not declared in this scope; did you mean 'memo'?
   29 |     if (mmeo.at(i)) {
      |         ^~~~
      |         memo
Language: C++

#include <iostream>
#include <cstdlib>
#include <time.h>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <array>
#include <string>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define mp make_pair
#define eb emplace_back
#define F first
#define S second
using namespace std;
using namespace __gnu_pbds;

typedef long long int ll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ost;

const ll maxN = 1e7;
const ll INF = 1e17;
const ll MOD = 1e9 + 7;

ll xs[] = {-1, 1, 0, 0, -1, 1, 1, -1};
ll ys[] = {0, 0, -1, 1, -1, 1, -1, 1};

ll segtree[maxN << 2];
ll lazy[maxN << 2];
ll A[maxN];

inline ll left(ll x){
	return x << 1;
}

inline ll right(ll x){
	return (x<<1) + 1;
}

void build(ll node, ll start, ll end){
	if(start == end)
		segtree[node] = A[start];
	else{
		ll mid = (start + end)/2;
		build(left(node), start, mid);
		build(right(node), mid+1, end);
		segtree[node] = segtree[left(node)] + segtree[right(node)];
	}
}

void update(ll node, ll start, ll end, ll l, ll r, ll val){
	if(lazy[node] != 0){
		segtree[node] += (end-start+1)*lazy[node];
		if(start != end){
			lazy[left(node)] += lazy[node];
			lazy[right(node)] += lazy[node];
		}
		lazy[node] = 0;
	}
	if(start > end or l > start or r < end)
		return ;
	else if(start >= l and r >= end){
		segtree[node] += val;
		if(start != end){
			lazy[left(node)] += val;
			lazy[right(node)] += val;
		}
	}
	else{
		ll mid=(start + end)/2;
		update(left(node), start, mid, l, r, val);
		update(right(node), mid+1, end, l, r, val);
		segtree[node] = segtree[left(node)] + segtree[right(node)];
	}
}

ll sums(ll node, ll start, ll end, ll l, ll r){
	if(lazy[node] != 0){
		segtree[node] += (end-start+1)*lazy[node];
		if(start != end){
			lazy[left(node)] += lazy[node];
			lazy[right(node)] += lazy[node];
		}
		lazy[node] = 0;
	}
	if(l > end or r < start or start > end)
		return 0;
	if(l <= start and r >= end)
		return segtree[node];
	ll mid = (start+end)/2;
	return sums(left(node), start, mid, l , r) + sums(right(node), mid + 1, end, l , r);
}

int main(){
	cin.sync_with_stdio(false);
	cin.tie(0);
	set<ll> ans;
	ll n;
	ll k;
	cin >> n;
	ll cur = 0;
	for(ll i=0; i<n;i++){
		cin >> k;
		if(k >= 1 and k<=399)
			ans.insert(1);
		else if(k>=400 and k<=799)
			ans.insert(2);
		else if(k>799 and k<=1199)
			ans.insert(3);
		else if(k>1199 and k<=1599)
			ans.insert(4);
		else if(k>1599 and k<=1999)
			ans.insert(5);
		else if(k>1999 and k<=2399)
			ans.insert(6);
		else if(k>1999 and k<=2799)
			ans.insert(7);
		else if(k>=2800 and k<=3199)
			ans.insert(8);
		else if(k == 0 or k <= )
			cur++;
	}
	cout << (ans.size() == 0 ? 1 : ans.size()) << " " << ans.size()+cur;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:127:40: error: expected primary-expression before ')' token
  127 |                 else if(k == 0 or k <= )
      |                                        ^
Language: C++

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

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

    vector<int> rate(8);
    int red=0;
    rep(i,n) {
        int ibuff;
        cin >> ibuff;
        if (ibuff<=399)         rate.at(0)++;
        else if (ibuff<=799)    rate.at(1)++;
        else if (ibuff<=1199)   rate.at(2)++;
        else if (ibuff<=1599)   rate.at(3)++;
        else if (ibuff<=1999)   rate.at(4)++;
        else if (ibuff<=2399)   rate.at(5)++;
        else if (ibuff<=2799)   rate.at(6)++;
        else if (ibuff<=3199)   rate.at(7)++;
        else                    red++;
    }

    int zeroCnt=0;
    int minValue=0, maxValue=0;
    //ゼロの数を数える
    rep(i,rate.size()) {
        if (rate.at(i)==0) zeroCnt++;
    }

  　//最小値は現在使用している色の数
    if (zeroCnt==rate.size()) {
        minValue = 1;
    } else {
        minValue = rate.size()-zeroCnt;
    }

    //最大値は赤色を最大限ちりばめる
    if (zeroCnt >= red) {
        if (zeroCnt==8) maxValue = red;
        else maxValue = minValue + red;
    }
    else if (zeroCnt < red) maxValue = 8;

    cout << minValue << " " << maxValue << endl;

    return 0;
}

Compiler output:
a.cc:34:3: error: extended character 　 is not valid in an identifier
   34 |   　//最小値は現在使用している色の数
      |   ^
a.cc: In function 'int main()':
a.cc:34:3: error: '\U00003000' was not declared in this scope
   34 |   　//最小値は現在使用している色の数
      |   ^~
a.cc:37:7: error: 'else' without a previous 'if'
   37 |     } else {
      |       ^~~~
Language: C++

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

int give_numbers(int x){
        
    int res = 0;
    while(x >= 0){
        res += 1;
        x -= 400;
    }
    
    return res;
    
}



int main(){
    
    
    int n;
    cin >> n;
    
    vector<int>arr(n);
    for(int i = 0; i < n; i++){
        cin >> arr[i];
    }
    
    set<int>s;
    int out_3200 = 0;
    for(int i = 0; i < n; i++){
        if(arr[i] < 3200){
            s.insert(give_numbers(arr[i]));
        }else{
            out_3200 += 1;
        }
    }
    int mn = min(8, (int)s.size());
    int mx = mn + out_3200
    
    cout << mn << " " << mx << endl;
    
    
}


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

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

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

 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:29:55: error: invalid types '<unresolved overloaded function type>[const char [5]]' for array subscript
   29 |    if(9-mp.size() >= mp["ziyu"]) max = mp.size()+mp.at["ziyu"]-1;
      |                                                       ^
Language: C++

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

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

 
} 

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

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

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

 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:29:55: error: invalid types '<unresolved overloaded function type>[const char [5]]' for array subscript
   29 |    if(7-mp.size() >= mp["ziyu"]) max = mp.size()+mp.at["ziyu"]-1;
      |                                                       ^