Language: C++

#include <cstdio>
#include <algorithm>
#define LL long long
#define MOD 1000000007
using namespace std;

int n, num, free;
bool val[8];

int main(){
	scanf("%d",&n);
	for(int i = 0; i < n; i++ ){
		int x; scanf("%d",&x);
		if(x>=3200) free++;
		else{
			if(val[x/400]) continue;
			val[x/400] = true;
			num++;
		}
	}
	printf("%d %d\n",num,min(num+free,8));
	return 0;
}


Compiler output:
a.cc:7:13: error: 'int free' redeclared as different kind of entity
    7 | int n, num, free;
      |             ^~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/bits/stl_algo.h:71,
                 from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/stdlib.h:687:13: note: previous declaration 'void free(void*)'
  687 | extern void free (void *__ptr) __THROW;
      |             ^~~~
a.cc: In function 'int main()':
a.cc:14:29: warning: ISO C++ forbids incrementing a pointer of type 'void (*)(void*) noexcept' [-Wpointer-arith]
   14 |                 if(x>=3200) free++;
      |                             ^~~~
a.cc:14:33: error: lvalue required as increment operand
   14 |                 if(x>=3200) free++;
      |                                 ^~
a.cc:21:37: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   21 |         printf("%d %d\n",num,min(num+free,8));
      |                                  ~~~^~~~~
a.cc:21:33: error: no matching function for call to 'min(void (*)(void*) noexcept, int)'
   21 |         printf("%d %d\n",num,min(num+free,8));
      |                              ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60:
/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:21:33: note:   deduced conflicting types for parameter 'const _Tp' ('void (*)(void*) noexcept' and 'int')
   21 |         printf("%d %d\n",num,min(num+free,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
/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:21:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'void (*)(void*) noexcept'
   21 |         printf("%d %d\n",num,min(num+free,8));
      |                              ~~~^~~~~~~~~~~~