Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long;
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(x) x.begin(), x.end()
#define mod 1000000007

int main() {
    int n;
    cin >> n;
    map<int, int> mp;
    vector<int> vec;
    rep(i, n){
        int num;
        cin >> num;
        vec.push_back(num);
        mp[num]++;
    }
    ll sum;
    for(int i=1; i<=n; i++){
        sum += mp[i]*(mp[i]-1)/2;
    }
    rep(i, n){
        cout << sum-((ll)(mp[vec[i]])*((ll)(mp[vec[i]])-1)/2)+(((ll)(mp[vec[i]])-1)*((ll)(mp[vec[i]])-2)/2) << endl;
    }
    return 0;
}

Compiler output:
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:8:1: note: in expansion of macro 'int'
    8 | int main() {
      | ^~~
a.cc:8:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    8 | int main() {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:9:5: note: in expansion of macro 'int'
    9 |     int n;
      |     ^~~
a.cc:9:9: error: 'n' was not declared in this scope; did you mean 'yn'?
    9 |     int n;
      |         ^
      |         yn
a.cc:3:18: error: wrong number of template arguments (1, should be at least 2)
    3 | #define int long long;
      |                  ^~~~
a.cc:11:9: note: in expansion of macro 'int'
   11 |     map<int, int> mp;
      |         ^~~
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:11:12: error: expected primary-expression before ',' token
   11 |     map<int, int> mp;
      |            ^
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long;
      |             ^~~~
a.cc:11:14: note: in expansion of macro 'int'
   11 |     map<int, int> mp;
      |              ^~~
a.cc:11:17: error: expected primary-expression before '>' token
   11 |     map<int, int> mp;
      |                 ^
a.cc:11:19: error: 'mp' was not declared in this scope
   11 |     map<int, int> mp;
      |                   ^~
a.cc:3:18: error: template argument 1 is invalid
    3 | #define int long long;
      |                  ^~~~
a.cc:12:12: note: in expansion of macro 'int'
   12 |     vector<int> vec;
      |            ^~~
a.cc:3:18: error: template argument 2 is invalid
    3 | #define int long long;
      |                  ^~~~
a.cc:12:12: note: in expansion of macro 'int'
   12 |     vector<int> vec;
      |            ^~~
a.cc:12:15: error: expected primary-expression before '>' token
   12 |     vector<int> vec;
      |               ^
a.cc:12:17: error: 'vec' was not declared in this scope
   12 |     vector<int> vec;
      |                 ^~~
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:4:24: note: in expansion of macro 'int'
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                        ^~~
a.cc:13:5: note: in expansion of macro 'rep'
   13 |     rep(i, n){
      |     ^~~
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     rep(i, n){
      |         ^
a.cc:4:28: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                            ^
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long;
      |             ^~~~
a.cc:4:36: note: in expansion of macro 'int'
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                    ^~~
a.cc:13:5: note: in expansion of macro 'rep'
   13 |     rep(i, n){
      |     ^~~
a.cc:3:13: error: expected ')' before 'long'
    3 | #define int long long;
      |             ^~~~
a.cc:4:36: note: in expansion of macro 'int'
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                    ^~~
a.cc:13:5: note: in expansion of macro 'rep'
   13 |     rep(i, n){
      |     ^~~
a.cc:4:35: note: to match this '('
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                   ^
a.cc:13:5: note: in expansion of macro 'rep'
   13 |     rep(i, n){
      |     ^~~
a.cc:3:22: error: expected ')' before ';' token
    3 | #define int long long;
      |                      ^
a.cc:4:36: note: in expansion of macro 'int'
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                    ^~~
a.cc:13:5: note: in expansion of macro 'rep'
   13 |     rep(i, n){
      |     ^~~
a.cc:4:23: note: to match this '('
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                       ^
a.cc:13:5: note: in expansion of macro 'rep'
   13 |     rep(i, n){
      |     ^~~
a.cc:4:39: error: expected primary-expression before ')' token
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                       ^
a.cc:13:5: note: in expansion of macro 'rep'
   13 |     rep(i, n){
      |     ^~~
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     rep(i, n){
      |         ^
a.cc:4:45: note: in definition of macro 'rep'
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                             ^
a.cc:19:5: error: 'll' was not declared in this scope; did you mean 'all'?
   19 |     ll sum;
      |     ^~
      |     all
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:20:9: note: in expansion of macro 'int'
   20 |     for(int i=1; i<=n; i++){
      |         ^~~
a.cc:20:22: error: expected ')' before ';' token
   20 |     for(int i=1; i<=n; i++){
      |        ~             ^
      |                      )
a.cc:3:18: error: declaration does not declare anything [-fpermissive]
    3 | #define int long long;
      |                  ^~~~
a.cc:4:24: note: in expansion of macro 'int'
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                        ^~~
a.cc:23:5: note: in expansion of macro 'rep'
   23 |     rep(i, n){
      |     ^~~
a.cc:3:13: error: expected primary-expression before 'long'
    3 | #define int long long;
      |             ^~~~
a.cc:4:36: note: in expansion of macro 'int'
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                    ^~~
a.cc:23:5: note: in expansion of macro 'rep'
   23 |     rep(i, n){
      |     ^~~
a.cc:3:13: error: expected ')' before 'long'
    3 | #define int long long;
      |             ^~~~
a.cc:4:36: note: in expansion of macro 'int'
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                    ^~~
a.cc:23:5: note: in expansion of macro 'rep'
   23 |     rep(i, n){
      |     ^~~
a.cc:4:35: note: to match this '('
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                   ^
a.cc:23:5: note: in expansion of macro 'rep'
   23 |     rep(i, n){
      |     ^~~
a.cc:3:22: error: expected ')' before ';' token
    3 | #define int long long;
      |                      ^
a.cc:4:36: note: in expansion of macro 'int'
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                    ^~~
a.cc:23:5: note: in expansion of macro 'rep'
   23 |     rep(i, n){
      |     ^~~
a.cc:4:23: note: to match this '('
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                       ^
a.cc:23:5: note: in expansion of macro 'rep'
   23 |     rep(i, n){
      |     ^~~
a.cc:4:39: error: expected primary-expression before ')' token
    4 | #define rep(i, n) for (int i=0; i<(int)(n); i++)
      |                                       ^
a.cc:23:5: note: in expansion of macro 'rep'
   23 |     rep(i, n){
      |     ^~~