Language: C++

using namespace std;
#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
#define pb push_back
#define mp make_pair
#define ft first
#define sc second
#define bs binary_search
#define INF 1000000000
#define rc(s) return cout << s,0
const int mod = 1e9 + 7;

int main()
{
	/**///------------------------///**/
	/**/ios::sync_with_stdio(false);/**/
	/**///------------------------///**/
	int n;
	cin >> n;
	int a;
	vi nums;
	for(int i = 0; i < n; i++)
	{
		cin >> a;
		nums.pb(a);
	}
	int ans1=0;
	int cnt1[10005]={0};
	int cnt2[10005]={0};
	for(int i = 0; i < n; i++)
	{
		if(i%2)
		{
			cnt1[nums[i]]++;
		}
		else
		{
			cnt2[nums[i]]++;
		}
	}
	ll mx = 0,ind=-1;
	for(int i = 0;i < 10005; i++)
		{
			if(mx < cnt1[i])ind=i;
			mx = max(mx,cnt1[i]);				
		}
	ans1 += n/2 - mx;
	mx = 0;
	for(int i = 0;i < 10005; i++)
		if(i!=ind)mx = max(mx,cnt2[i]);
	ans1 += n/2 - mx;
	rc(ans1);
	//THIS IS THE END
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:33: error: no matching function for call to 'max(ll&, int&)'
   51 |                         mx = max(mx,cnt1[i]);
      |                              ~~~^~~~~~~~~~~~
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:2:
/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:51:33: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   51 |                         mx = max(mx,cnt1[i]);
      |                              ~~~^~~~~~~~~~~~
/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:51:33: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   51 |                         mx = max(mx,cnt1[i]);
      |                              ~~~^~~~~~~~~~~~
a.cc:56:35: error: no matching function for call to 'max(ll&, int&)'
   56 |                 if(i!=ind)mx = max(mx,cnt2[i]);
      |                                ~~~^~~~~~~~~~~~
/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:56:35: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   56 |                 if(i!=ind)mx = max(mx,cnt2[i]);
      |                                ~~~^~~~~~~~~~~~
/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
/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:56:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   56 |                 if(i!=ind)mx = max(mx,cnt2[i]);
      |                                ~~~^~~~~~~~~~~~