Language: C++

#include <bits/stdc++.h>
using namespace std:
using ll = long long;
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:2:20: error: expected ';' before ':' token
    2 | using namespace std:
      |                    ^
      |                    ;
a.cc:2:20: error: expected unqualified-id before ':' token
a.cc: In function 'int main()':
a.cc:5:9: error: 'll' was not declared in this scope
    5 |         ll n;
      |         ^~
a.cc:6:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |         cin >> n;
      |                ^
      |                yn
a.cc:8:19: error: template argument 3 is invalid
    8 |         map<ll, ll>mp;
      |                   ^
a.cc:8:19: error: template argument 4 is invalid
a.cc:11:21: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   11 |                 ++mp[a[i]];
      |                     ^
a.cc:14:11: error: expected ';' before 'msum'
   14 |         ll msum =0;
      |           ^~~~~
      |           ;
a.cc:15:22: error: 'begin' was not declared in this scope
   15 |         for(auto m : mp){
      |                      ^~
a.cc:15: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:15:22: error: 'end' was not declared in this scope
   15 |         for(auto m : mp){
      |                      ^~
a.cc:15: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:16:19: error: expected ';' before 't'
   16 |                 ll t=m.second;
      |                   ^~
      |                   ;
a.cc:17:19: error: expected ';' before 'tmp'
   17 |                 ll tmp = t(t-1)/2;
      |                   ^~~~
      |                   ;
a.cc:18:20: error: 't' was not declared in this scope
   18 |                 if(t<2)tmp = 0;
      |                    ^
a.cc:18:24: error: 'tmp' was not declared in this scope; did you mean 'mp'?
   18 |                 if(t<2)tmp = 0;
      |                        ^~~
      |                        mp
a.cc:19:17: error: 'msum' was not declared in this scope
   19 |                 msum += tmp;
      |                 ^~~~
a.cc:19:25: error: 'tmp' was not declared in this scope; did you mean 'mp'?
   19 |                 msum += tmp;
      |                         ^~~
      |                         mp
a.cc:24:19: error: expected ';' before 't'
   24 |                 ll t= mp[a[i]];
      |                   ^~
      |                   ;
a.cc:25:19: error: expected ';' before 'tmp'
   25 |                 ll tmp = t(t-1)/2;
      |                   ^~~~
      |                   ;
a.cc:26:20: error: 't' was not declared in this scope
   26 |                 if(t<2)tmp = 0;
      |                    ^
a.cc:26:24: error: 'tmp' was not declared in this scope; did you mean 'mp'?
   26 |                 if(t<2)tmp = 0;
      |                        ^~~
      |                        mp
a.cc:27:19: error: 't' was not declared in this scope
   27 |                 --t;
      |                   ^
a.cc:28:19: error: expected ';' before 'tmp2'
   28 |                 ll tmp2 = t(t-1)/2;
      |                   ^~~~~
      |                   ;
a.cc:29:24: error: 'tmp' was not declared in this scope; did you mean 'mp'?
   29 |                 if(t<2)tmp = 0;
      |                        ^~~
      |                        mp
a.cc:30:19: error: expected ';' before 'ans'
   30 |                 ll ans = msum - tmp + tmp2;
      |                   ^~~~
      |                   ;
a.cc:31:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |                 cout << ans << endl;
      |                         ^~~
      |                         abs