Language: C++

using namespace std;

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;

int main() {
    int n; cin >> n;
    map<int, int> m;
    for(int i = 0; i < n; i++){
        int a; cin >> a;
        if(a <= 399) m[1]++;
        else if(a <= 799) m[2]++;
        else if(a <= 1199) m[3]++;
        else if(a <= 1599) m[4]++;
        else if(a <= 1999) m[5]++;
        else if(a <= 2399) m[6]++;
        else if(a <= 2799) m[7]++;
        else if(a <= 3199) m[8]++;
        else m[9]++;
    }
    int min = m.size();
    int max = m.size();
    if(m[9]){
        min -= 1;
        max += m[9] - 1;
    }
    cout << min << " " << max << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'cin' was not declared in this scope
    8 |     int n; cin >> n;
      |            ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:9:5: error: 'map' was not declared in this scope
    9 |     map<int, int> m;
      |     ^~~
a.cc:1:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
  +++ |+#include <map>
    1 | using namespace std;
a.cc:9:9: error: expected primary-expression before 'int'
    9 |     map<int, int> m;
      |         ^~~
a.cc:12:22: error: 'm' was not declared in this scope
   12 |         if(a <= 399) m[1]++;
      |                      ^
a.cc:13:27: error: 'm' was not declared in this scope
   13 |         else if(a <= 799) m[2]++;
      |                           ^
a.cc:14:28: error: 'm' was not declared in this scope
   14 |         else if(a <= 1199) m[3]++;
      |                            ^
a.cc:15:28: error: 'm' was not declared in this scope
   15 |         else if(a <= 1599) m[4]++;
      |                            ^
a.cc:16:28: error: 'm' was not declared in this scope
   16 |         else if(a <= 1999) m[5]++;
      |                            ^
a.cc:17:28: error: 'm' was not declared in this scope
   17 |         else if(a <= 2399) m[6]++;
      |                            ^
a.cc:18:28: error: 'm' was not declared in this scope
   18 |         else if(a <= 2799) m[7]++;
      |                            ^
a.cc:19:28: error: 'm' was not declared in this scope
   19 |         else if(a <= 3199) m[8]++;
      |                            ^
a.cc:20:14: error: 'm' was not declared in this scope
   20 |         else m[9]++;
      |              ^
a.cc:22:15: error: 'm' was not declared in this scope
   22 |     int min = m.size();
      |               ^
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout << min << " " << max << endl;
      |     ^~~~
a.cc:28:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:34: error: 'endl' was not declared in this scope
   28 |     cout << min << " " << max << endl;
      |                                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;