Language: C++

#include <bits/stdc++.h>
using namespace std;
long long int a[200000], n, b[200000], count;
int main(){
	cin >> n;
	for(long long int i = 0;i < n;i++){
		b[i] = 0;
	}
	for(long long int i = 0;i < n;i++){
		cin >> a[i];
		b[a[i] - 1]++;
	}
	for(long long int i = 0;i < n;i++){
		count = 0;
		for(long long int j = 0;j < n;j++){
			if(j == (a[i] - 1)){
				count += ((b[j] - 1) * (b[j] - 2) / 2);
			}else{
				count += (b[j] * (b[j] - 1) / 2);
			}
		}
		cout << count << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: reference to 'count' is ambiguous
   14 |                 count = 0;
      |                 ^~~~~
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:3:40: note:                 'long long int count'
    3 | long long int a[200000], n, b[200000], count;
      |                                        ^~~~~
a.cc:17:33: error: reference to 'count' is ambiguous
   17 |                                 count += ((b[j] - 1) * (b[j] - 2) / 2);
      |                                 ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:3:40: note:                 'long long int count'
    3 | long long int a[200000], n, b[200000], count;
      |                                        ^~~~~
a.cc:19:33: error: reference to 'count' is ambiguous
   19 |                                 count += (b[j] * (b[j] - 1) / 2);
      |                                 ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:3:40: note:                 'long long int count'
    3 | long long int a[200000], n, b[200000], count;
      |                                        ^~~~~
a.cc:22:25: error: reference to 'count' is ambiguous
   22 |                 cout << count << endl;
      |                         ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidates are: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:                 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
a.cc:3:40: note:                 'long long int count'
    3 | long long int a[200000], n, b[200000], count;
      |                                        ^~~~~