Language: C++

# include <bits/stdc++.h>
using namespace std;

lint gcd(lint x, lint y) {
  if(x == 0) { return y; }
  else { return gcd(y%x,x); }
}

lint lcm(lint x, lint y) { return x/gcd(x,y)*y; }

lint C(lint n, lint k) {
  if(n == k) { return 1; }
  else if(n < k) { return 0; }
  else if(k == 0) { return 1; }
  else if(k == 1) { return n; }
  else return C(n-1,k-1) + C(n-1,k);
}


int main() {
  lint n; cin >> n;
  vector<lint> a(n); for(lint i=0;i<n;i++) { cin >> a[i]; }

  lint sum=0;
  map<lint,lint> mp;
  for(lint i=0;i<n;i++) { mp[a[i]]++; }
  for(map<lint,lint>::iterator i=mp.begin();i!=mp.end();i++) { sum += i->second*(i->second-1)/2; }

  for(lint i=0;i<n;i++) { cout << sum-(mp[a[i]]-1) << endl; }

  return 0;
}


Compiler output:
a.cc:4:1: error: 'lint' does not name a type; did you mean 'uint'?
    4 | lint gcd(lint x, lint y) {
      | ^~~~
      | uint
a.cc:9:1: error: 'lint' does not name a type; did you mean 'uint'?
    9 | lint lcm(lint x, lint y) { return x/gcd(x,y)*y; }
      | ^~~~
      | uint
a.cc:11:1: error: 'lint' does not name a type; did you mean 'uint'?
   11 | lint C(lint n, lint k) {
      | ^~~~
      | uint
a.cc: In function 'int main()':
a.cc:21:3: error: 'lint' was not declared in this scope; did you mean 'uint'?
   21 |   lint n; cin >> n;
      |   ^~~~
      |   uint
a.cc:21:18: error: 'n' was not declared in this scope; did you mean 'yn'?
   21 |   lint n; cin >> n;
      |                  ^
      |                  yn
a.cc:22:14: error: template argument 2 is invalid
   22 |   vector<lint> a(n); for(lint i=0;i<n;i++) { cin >> a[i]; }
      |              ^
a.cc:22:30: error: expected ';' before 'i'
   22 |   vector<lint> a(n); for(lint i=0;i<n;i++) { cin >> a[i]; }
      |                              ^~
      |                              ;
a.cc:22:35: error: 'i' was not declared in this scope
   22 |   vector<lint> a(n); for(lint i=0;i<n;i++) { cin >> a[i]; }
      |                                   ^
a.cc:24:7: error: expected ';' before 'sum'
   24 |   lint sum=0;
      |       ^~~~
      |       ;
a.cc:25:16: error: template argument 3 is invalid
   25 |   map<lint,lint> mp;
      |                ^
a.cc:25:16: error: template argument 4 is invalid
a.cc:26:11: error: expected ';' before 'i'
   26 |   for(lint i=0;i<n;i++) { mp[a[i]]++; }
      |           ^~
      |           ;
a.cc:26:16: error: 'i' was not declared in this scope
   26 |   for(lint i=0;i<n;i++) { mp[a[i]]++; }
      |                ^
a.cc:27:20: error: template argument 3 is invalid
   27 |   for(map<lint,lint>::iterator i=mp.begin();i!=mp.end();i++) { sum += i->second*(i->second-1)/2; }
      |                    ^
a.cc:27:20: error: template argument 4 is invalid
a.cc:27:31: error: expected ';' before 'i'
   27 |   for(map<lint,lint>::iterator i=mp.begin();i!=mp.end();i++) { sum += i->second*(i->second-1)/2; }
      |                               ^~
      |                               ;
a.cc:27:32: error: 'i' was not declared in this scope
   27 |   for(map<lint,lint>::iterator i=mp.begin();i!=mp.end();i++) { sum += i->second*(i->second-1)/2; }
      |                                ^
a.cc:27:37: error: request for member 'begin' in 'mp', which is of non-class type 'int'
   27 |   for(map<lint,lint>::iterator i=mp.begin();i!=mp.end();i++) { sum += i->second*(i->second-1)/2; }
      |                                     ^~~~~
a.cc:27:51: error: request for member 'end' in 'mp', which is of non-class type 'int'
   27 |   for(map<lint,lint>::iterator i=mp.begin();i!=mp.end();i++) { sum += i->second*(i->second-1)/2; }
      |                                                   ^~~
a.cc:27:56: error: expected ')' before ';' token
   27 |   for(map<lint,lint>::iterator i=mp.begin();i!=mp.end();i++) { sum += i->second*(i->second-1)/2; }
      |      ~                                                 ^
      |                                                        )
a.cc:27:57: error: 'i' was not declared in this scope
   27 |   for(map<lint,lint>::iterator i=mp.begin();i!=mp.end();i++) { sum += i->second*(i->second-1)/2; }
      |                                                         ^
a.cc:29:11: error: expected ';' before 'i'
   29 |   for(lint i=0;i<n;i++) { cout << sum-(mp[a[i]]-1) << endl; }
      |           ^~
      |           ;
a.cc:29:35: error: 'sum' was not declared in this scope
   29 |   for(lint i=0;i<n;i++) { cout << sum-(mp[a[i]]-1) << endl; }
      |                                   ^~~