Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for(int i=0;i<N;i++){
    cin >> a.at(i);
  }
  int a,b,c,d,e,f,g,h,i;
  a=0; b=0; c=0; d=0; e=0; f=0; g=0; h=0; i=0;
  for(int i=0;i<N;i++){
    if(a.at(i)<=399){a++;}
    if(400<=a.at(i) && a.at(i)<=799){b++}
    if(800<=a.at(i) && a.at(i)<=1199){c++}
    if(1200<=a.at(i) && a.at(i)<=1599){d++}
    if(1600<=a.at(i) && a.at(i)<=1999){e++}
    if(2000<=a.at(i) && a.at(i)<=2399){f++}
    if(2400<=a.at(i) && a.at(i)<=2799){g++}
    if(2800<=a.at(i) && a.at(i)<=3199){h++}
    if(3200<=a.at(i)){i++}
  }
  int A=0;
  if(a!=0){A++;}
  if(b!=0){A++;}
  if(c!=0){A++;}
  if(d!=0){A++;}
  if(e!=0){A++;}
  if(f!=0){A++;}
  if(g!=0){A++;}
  if(h!=0){A++;}
  cout << A << " ";
  if(i+A<=8){cout << i+A << endl;}
  else{cout << 8 << endl;}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: conflicting declaration 'int a'
   11 |   int a,b,c,d,e,f,g,h,i;
      |       ^
a.cc:7:15: note: previous declaration as 'std::vector<int> a'
    7 |   vector<int> a(N);
      |               ^
a.cc:12:5: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
   12 |   a=0; b=0; c=0; d=0; e=0; f=0; g=0; h=0; i=0;
      |     ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'int' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'int' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'int' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
a.cc:14:23: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   14 |     if(a.at(i)<=399){a++;}
      |                      ~^~
a.cc:15:41: error: expected ';' before '}' token
   15 |     if(400<=a.at(i) && a.at(i)<=799){b++}
      |                                         ^
      |                                         ;
a.cc:16:42: error: expected ';' before '}' token
   16 |     if(800<=a.at(i) && a.at(i)<=1199){c++}
      |                                          ^
      |                                          ;
a.cc:17:43: error: expected ';' before '}' token
   17 |     if(1200<=a.at(i) && a.at(i)<=1599){d++}
      |                                           ^
      |                                           ;
a.cc:18:43: error: expected ';' before '}' token
   18 |     if(1600<=a.at(i) && a.at(i)<=1999){e++}
      |                                           ^
      |                                           ;
a.cc:19:43: error: expected ';' before '}' token
   19 |     if(2000<=a.at(i) && a.at(i)<=2399){f++}
      |                                           ^
      |                                           ;
a.cc:20:43: error: expected ';' before '}' token
   20 |     if(2400<=a.at(i) && a.at(i)<=2799){g++}
      |                                           ^
      |                                           ;
a.cc:21:43: error: expected ';' before '}' token
   21 |     if(2800<=a.at(i) && a.at(i)<=3199){h++}
      |                                           ^
      |                                           ;
a.cc:22:26: error: expected ';' before '}' token
   22 |     if(3200<=a.at(i)){i++}
      |                          ^
      |                          ;
a.cc:25:7: error: no match for 'operator!=' (operand types are 'std::vector<int>' and 'int')
   25 |   if(a!=0){A++;}
      |      ~^~~
      |      |  |
      |      |  int
      |      std::vector<int>
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181:
/usr/include/c++/14/bits/regex.h:1132:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
 1132 |     operator!=(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1132:5: note:   template argument deduction/substitution failed:
a.cc:25:9: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   25 |   if(a!=0){A++;}
      |         ^
/usr/include/c++/14/bits/regex.h:1212:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
 1212 |     operator!=(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1212:5: note:   template argument deduction/substitution failed:
a.cc:25:9: note:   'std::vector<int>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
   25 |   if(a!=0){A++;}
      |         ^
/usr/include/c++/14/bits/regex.h:1305:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
 1305 |     operator!=(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1305:5: note:   template argument deduction/substitution failed:
a.cc:25:9: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   25 |   if(a!=0){A++;}
      |         ^
/usr/include/c++/14/bits/regex.h:1379:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
 1379 |     operator!=(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1379:5: note:   template argument deduction/substitution failed:
a.cc:25:9: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
   25 |   if(a!=0){A++;}
      |         ^
/usr/include/c++/14/bits/regex.h:1473:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
 1473 |     operator!=(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1473:5: note:   template argument deduction/substitution failed:
a.cc:25:9: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   25 |   if(a!=0){A++;}
      |         ^
/usr/include/c++/14/bits/regex.h:1547:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
 1547 |     operator!=(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1547:5: note:   template argument deduction/substitution failed:
a.cc:25:9: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
   25 |   if(a!=0){A++;}
      |         ^
/usr/include/c++/14/bits/regex.h:1647:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator!=(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
 1647 |     operator!=(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1647:5: note:   template argument deduction/substitution failed:
a.cc:25:9: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   25 |   if(a!=0){A++;}
      |         ^
/usr/include/c++/14/bits/regex.h:2213:5: note: candidate: 'template<class _Bi_iter, class _Alloc> bool std::__cxx11::operator!=(const match_results<_BiIter, _Alloc>&, const match_results<_BiIter, _Alloc>&)'
 2213 |     operator!=(const match_results<_Bi_iter, _Alloc>& __m1,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:2213:5: note:   template argument deduction/substitution failed:
a.cc:25:9: note:   'std::vector<int>' is not derived from 'const std::__cxx11::match_results<_BiIter, _Alloc>'
   25 |   if(a!=0){A++;}
      |         ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1052 |     operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1052:5: note:   template argument deduction/substitution failed:
a.cc:25:9: note:   'std::vector<int>' is not derived from 'const std::pair<_T1, _T2>'
   25 |   if(a!=0){A++;}
      |         ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  455 |     operator!=(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:455:5: note:   template argument deduction/substitution failed:
a.cc:25:9: note:   'std::vector<int>' is not derived from 'const std::reverse_iterator<_Iterator>'
   25 |   if(a!=0){A++;}
      |         ^
/usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  500 |     operator!=(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include