Language: C++

#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main() {
  int n; 
  cin >> n;
  vector<int> a(n);
  multiset m;
  rep(i,n){
    cin >> a[i];
    m.insert(a[i]);
  }
  
  int kumi = 0;
  rep(i,n){
    int x = m.count(i);
    kumi += x * (x - 1) / 2;
  }
  
  rep(k,n){
    int x = m.count(a[k]);
    cout << kumi - x << endl;
  }
  
  

} 



Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: class template argument deduction failed:
   10 |   multiset m;
      |            ^
a.cc:10:12: error: no matching function for call to 'multiset()'
In file included from /usr/include/c++/14/set:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:158,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_multiset.h:269:9: note: candidate: 'template<class _Key, class _Compare, class _Alloc, class _InputIterator> multiset(_InputIterator, _InputIterator, const _Alloc&)-> std::multiset<_Key, _Compare, _Alloc>'
  269 |         multiset(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:269:9: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:263:7: note: candidate: 'template<class _Key, class _Compare, class _Alloc> multiset(std::initializer_list<_Tp>, const _Alloc&)-> std::multiset<_Key, _Compare, _Alloc>'
  263 |       multiset(initializer_list<value_type> __l, const allocator_type& __a)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:263:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:257:7: note: candidate: 'template<class _Key, class _Compare, class _Alloc> multiset(std::multiset<_Key, _Compare, _Allocator>&&, std::__type_identity_t<_Alloc>&)-> std::multiset<_Key, _Compare, _Alloc>'
  257 |       multiset(multiset&& __m, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:257:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:252:7: note: candidate: 'template<class _Key, class _Compare, class _Alloc> multiset(const std::multiset<_Key, _Compare, _Allocator>&, std::__type_identity_t<_Alloc>&)-> std::multiset<_Key, _Compare, _Alloc>'
  252 |       multiset(const multiset& __m,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:252:7: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:248:7: note: candidate: 'template<class _Key, class _Compare, class _Alloc> multiset(const _Alloc&)-> std::multiset<_Key, _Compare, _Alloc>'
  248 |       multiset(const allocator_type& __a)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:248:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:240:7: note: candidate: 'template<class _Key, class _Compare, class _Alloc> multiset(std::initializer_list<_Tp>, const _Compare&, const _Alloc&)-> std::multiset<_Key, _Compare, _Alloc>'
  240 |       multiset(initializer_list<value_type> __l,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:240:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:228:7: note: candidate: 'template<class _Key, class _Compare, class _Alloc> multiset(std::multiset<_Key, _Compare, _Allocator>&&)-> std::multiset<_Key, _Compare, _Alloc>'
  228 |       multiset(multiset&&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:228:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:219:7: note: candidate: 'template<class _Key, class _Compare, class _Alloc> multiset(const std::multiset<_Key, _Compare, _Allocator>&)-> std::multiset<_Key, _Compare, _Alloc>'
  219 |       multiset(const multiset&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:219:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:204:9: note: candidate: 'template<class _Key, class _Compare, class _Alloc, class _InputIterator> multiset(_InputIterator, _InputIterator, const _Compare&, const _Alloc&)-> std::multiset<_Key, _Compare, _Alloc>'
  204 |         multiset(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:204:9: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:188:9: note: candidate: 'template<class _Key, class _Compare, class _Alloc, class _InputIterator> multiset(_InputIterator, _InputIterator)-> std::multiset<_Key, _Compare, _Alloc>'
  188 |         multiset(_InputIterator __first, _InputIterator __last)
      |         ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:188:9: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:174:7: note: candidate: 'template<class _Key, class _Compare, class _Alloc> multiset(const _Compare&, const _Alloc&)-> std::multiset<_Key, _Compare, _Alloc>'
  174 |       multiset(const _Compare& __comp,
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:174:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:165:7: note: candidate: 'template<class _Key, class _Compare, class _Alloc> multiset()-> std::multiset<_Key, _Compare, _Alloc>'
  165 |       multiset() = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:165:7: note:   template argument deduction/substitution failed:
a.cc:10:12: note:   couldn't deduce template parameter '_Key'
   10 |   multiset m;
      |            ^
In file included from /usr/include/c++/14/set:63:
/usr/include/c++/14/bits/stl_set.h:70:11: note: candidate: 'template<class _Key, class _Compare, class _Alloc> multiset(std::multiset<_Key, _Compare, _Alloc>)-> std::multiset<_Key, _Compare, _Alloc>'
   70 |     class multiset;
      |           ^~~~~~~~
/usr/include/c++/14/bits/stl_set.h:70:11: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:955:5: note: candidate: 'template<class _Key, class _Allocator, class> std::multiset(initializer_list<_Tp>, _Allocator)-> multiset<_Key, less<_Key>, _Allocator>'
  955 |     multiset(initializer_list<_Key>, _Allocator)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:955:5: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:948:5: note: candidate: 'template<class _InputIterator, class _Allocator, class, class> std::multiset(_InputIterator, _InputIterator, _Allocator)-> multiset<typename iterator_traits<_Iter>::value_type, less<typename iterator_traits< <template-parameter-1-1> >::value_type>, _Allocator>'
  948 |     multiset(_InputIterator, _InputIterator, _Allocator)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:948:5: note:   candidate expects 3 arguments, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:941:5: note: candidate: 'template<class _Key, class _Compare, class _Allocator, class, class> std::multiset(initializer_list<_Tp>, _Compare, _Allocator)-> multiset<_Key, _Compare, _Allocator>'
  941 |     multiset(initializer_list<_Key>,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:941:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_multiset.h:931:5: note: candidate: 'template<class _InputIterator, class _Compare, class _Allocator, class, class, class> std::multiset(_InputIterator, _InputIterator, _Compare, _Allocator)-> multiset<typename iterator_traits<_Iter>::value_type, _Compare, _Allocator>'
  931 |     multiset(_InputIterator, _InputIterator,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_multiset.h:931:5: note:   candidate expects 2 arguments, 0 provided