Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
	ll n;
	cin >> n;
	vector<int> a(n);
	map<ll, ll>mp;
	for(int i=0; i<n; ++i){
		cin >> a[i];
		++mp[a[i]];
	}
	
	ll msum =0;
	for(auto m : mp){
		ll t=m.second;
		ll tmp = t(t-1)/2;
		if(t<2)tmp = 0;
		msum += tmp;
	}
	
	
	for(int i=0;i <n; ++i){
		ll t= mp[a[i]];
		ll tmp = t(t-1)/2;
		if(t<2)tmp = 0;
		--t;
		ll tmp2 = t(t-1)/2;
		if(t<2)tmp = 0;
		ll ans = msum - tmp + tmp2;
		cout << ans << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'll' was not declared in this scope
    4 |         ll n;
      |         ^~
a.cc:5:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |         cin >> n;
      |                ^
      |                yn
a.cc:7:19: error: template argument 3 is invalid
    7 |         map<ll, ll>mp;
      |                   ^
a.cc:7:19: error: template argument 4 is invalid
a.cc:10:21: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   10 |                 ++mp[a[i]];
      |                     ^
a.cc:13:11: error: expected ';' before 'msum'
   13 |         ll msum =0;
      |           ^~~~~
      |           ;
a.cc:14:22: error: 'begin' was not declared in this scope
   14 |         for(auto m : mp){
      |                      ^~
a.cc:14:22: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:14:22: error: 'end' was not declared in this scope
   14 |         for(auto m : mp){
      |                      ^~
a.cc:14:22: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:15:19: error: expected ';' before 't'
   15 |                 ll t=m.second;
      |                   ^~
      |                   ;
a.cc:16:19: error: expected ';' before 'tmp'
   16 |                 ll tmp = t(t-1)/2;
      |                   ^~~~
      |                   ;
a.cc:17:20: error: 't' was not declared in this scope
   17 |                 if(t<2)tmp = 0;
      |                    ^
a.cc:17:24: error: 'tmp' was not declared in this scope; did you mean 'mp'?
   17 |                 if(t<2)tmp = 0;
      |                        ^~~
      |                        mp
a.cc:18:17: error: 'msum' was not declared in this scope
   18 |                 msum += tmp;
      |                 ^~~~
a.cc:18:25: error: 'tmp' was not declared in this scope; did you mean 'mp'?
   18 |                 msum += tmp;
      |                         ^~~
      |                         mp
a.cc:23:19: error: expected ';' before 't'
   23 |                 ll t= mp[a[i]];
      |                   ^~
      |                   ;
a.cc:24:19: error: expected ';' before 'tmp'
   24 |                 ll tmp = t(t-1)/2;
      |                   ^~~~
      |                   ;
a.cc:25:20: error: 't' was not declared in this scope
   25 |                 if(t<2)tmp = 0;
      |                    ^
a.cc:25:24: error: 'tmp' was not declared in this scope; did you mean 'mp'?
   25 |                 if(t<2)tmp = 0;
      |                        ^~~
      |                        mp
a.cc:26:19: error: 't' was not declared in this scope
   26 |                 --t;
      |                   ^
a.cc:27:19: error: expected ';' before 'tmp2'
   27 |                 ll tmp2 = t(t-1)/2;
      |                   ^~~~~
      |                   ;
a.cc:28:24: error: 'tmp' was not declared in this scope; did you mean 'mp'?
   28 |                 if(t<2)tmp = 0;
      |                        ^~~
      |                        mp
a.cc:29:19: error: expected ';' before 'ans'
   29 |                 ll ans = msum - tmp + tmp2;
      |                   ^~~~
      |                   ;
a.cc:30:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |                 cout << ans << endl;
      |                         ^~~
      |                         abs