Language: C++

#include<bits/stdc++.h>

using namespace std;

const int N = 2e5 + 10;
__int64 nums[N];
map<__int64, __int64> dict; 

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++) {
		cin >> nums[i];
		dict[nums[i]]++;
	}
	__int64 ans = 0;
	for(int i = 1; i <= n; i++)
		ans += (dict[i] * (dict[i]-1)) / 2;
	for(int i = 1; i <= n; i++) {
		int inp = nums[i];
		ans -= (dict[inp] * (dict[inp]-1)) / 2;
		dict[inp]--;
		ans += (dict[inp] * (dict[inp]-1)) / 2;
		cout << ans << "\n";
		ans -= (dict[inp] * (dict[inp]-1)) / 2;
		dict[inp]++;
		ans += (dict[inp] * (dict[inp]-1)) / 2;
	}
	
	
	return 0;
}

Compiler output:
a.cc:6:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    6 | __int64 nums[N];
      | ^~~~~~~
      | __int64_t
a.cc:7:5: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    7 | map<__int64, __int64> dict;
      |     ^~~~~~~
      |     __ynf64
a.cc:7:14: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    7 | map<__int64, __int64> dict;
      |              ^~~~~~~
      |              __ynf64
a.cc:7:21: error: template argument 1 is invalid
    7 | map<__int64, __int64> dict;
      |                     ^
a.cc:7:21: error: template argument 2 is invalid
a.cc:7:21: error: template argument 3 is invalid
a.cc:7:21: error: template argument 4 is invalid
a.cc: In function 'int main()':
a.cc:15:24: error: 'nums' was not declared in this scope
   15 |                 cin >> nums[i];
      |                        ^~~~
a.cc:18:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   18 |         __int64 ans = 0;
      |         ^~~~~~~
      |         __ynf64
a.cc:20:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |                 ans += (dict[i] * (dict[i]-1)) / 2;
      |                 ^~~
      |                 abs
a.cc:20:29: error: invalid types 'int[int]' for array subscript
   20 |                 ans += (dict[i] * (dict[i]-1)) / 2;
      |                             ^
a.cc:20:40: error: invalid types 'int[int]' for array subscript
   20 |                 ans += (dict[i] * (dict[i]-1)) / 2;
      |                                        ^
a.cc:22:27: error: 'nums' was not declared in this scope
   22 |                 int inp = nums[i];
      |                           ^~~~
a.cc:23:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |                 ans -= (dict[inp] * (dict[inp]-1)) / 2;
      |                 ^~~
      |                 abs
a.cc:23:29: error: invalid types 'int[int]' for array subscript
   23 |                 ans -= (dict[inp] * (dict[inp]-1)) / 2;
      |                             ^
a.cc:23:42: error: invalid types 'int[int]' for array subscript
   23 |                 ans -= (dict[inp] * (dict[inp]-1)) / 2;
      |                                          ^
a.cc:24:21: error: invalid types 'int[int]' for array subscript
   24 |                 dict[inp]--;
      |                     ^
a.cc:25:29: error: invalid types 'int[int]' for array subscript
   25 |                 ans += (dict[inp] * (dict[inp]-1)) / 2;
      |                             ^
a.cc:25:42: error: invalid types 'int[int]' for array subscript
   25 |                 ans += (dict[inp] * (dict[inp]-1)) / 2;
      |                                          ^
a.cc:27:29: error: invalid types 'int[int]' for array subscript
   27 |                 ans -= (dict[inp] * (dict[inp]-1)) / 2;
      |                             ^
a.cc:27:42: error: invalid types 'int[int]' for array subscript
   27 |                 ans -= (dict[inp] * (dict[inp]-1)) / 2;
      |                                          ^
a.cc:28:21: error: invalid types 'int[int]' for array subscript
   28 |                 dict[inp]++;
      |                     ^
a.cc:29:29: error: invalid types 'int[int]' for array subscript
   29 |                 ans += (dict[inp] * (dict[inp]-1)) / 2;
      |                             ^
a.cc:29:42: error: invalid types 'int[int]' for array subscript
   29 |                 ans += (dict[inp] * (dict[inp]-1)) / 2;
      |                                          ^