Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using ll = long long using namespace std;

int main()
{
    ll n;
    cin >> n;
    vector<int> a(n), b(n);
    rep(i, n)
    {
        cin >> a.at(i);
        a.at(i)--;
        b.at(a.at(i))++;
    }
    ll sum = 0;
    rep(i, n) if (b.at(i) > 1) sum += b.at(i) * (b.at(i) - 1) / 2;
    rep(i, n)
    {
        ll c = sum;
        c -= b.at(a.at(i)) - 1;
        cout << c << endl;
    }
    return 0;
}

Compiler output:
a.cc:3:21: error: expected ';' before 'using'
    3 | using ll = long long using namespace std;
      |                     ^~~~~~
      |                     ;
a.cc: In function 'int main()':
a.cc:7:5: error: 'll' was not declared in this scope
    7 |     ll n;
      |     ^~
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |     cin >> n;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:12: error: 'n' was not declared in this scope; did you mean 'yn'?
    8 |     cin >> n;
      |            ^
      |            yn
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> a(n), b(n);
      |     ^~~~~~
a.cc:9:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> a(n), b(n);
      |            ^~~
a.cc:12:16: error: 'a' was not declared in this scope
   12 |         cin >> a.at(i);
      |                ^
a.cc:14:9: error: 'b' was not declared in this scope
   14 |         b.at(a.at(i))++;
      |         ^
a.cc:16:7: error: expected ';' before 'sum'
   16 |     ll sum = 0;
      |       ^~~~
      |       ;
a.cc:17:19: error: 'b' was not declared in this scope
   17 |     rep(i, n) if (b.at(i) > 1) sum += b.at(i) * (b.at(i) - 1) / 2;
      |                   ^
a.cc:17:32: error: 'sum' was not declared in this scope
   17 |     rep(i, n) if (b.at(i) > 1) sum += b.at(i) * (b.at(i) - 1) / 2;
      |                                ^~~
a.cc:20:11: error: expected ';' before 'c'
   20 |         ll c = sum;
      |           ^~
      |           ;
a.cc:21:9: error: 'c' was not declared in this scope
   21 |         c -= b.at(a.at(i)) - 1;
      |         ^
a.cc:21:14: error: 'b' was not declared in this scope
   21 |         c -= b.at(a.at(i)) - 1;
      |              ^
a.cc:21:19: error: 'a' was not declared in this scope
   21 |         c -= b.at(a.at(i)) - 1;
      |                   ^
a.cc:22:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |         cout << c << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |         cout << c << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~