Language: C++

using System;
using System.Collections.Generic;
using System.Linq;

namespace D
{
	class Program
	{
		static void Main(string[] args)
		{
			int N = int.Parse(Console.ReadLine());
			string[] tmp = Console.ReadLine().Split(' ');
			List<int> A = new List<int>();
			for (int i = 0; i < tmp.Length; i++)
			{
				A.Add(int.Parse(tmp[i]) - 1);
			}

			List<int> count_num = new List<int>(new int[A.Max() + 1]);
			for (int i = 0; i < A.Count; i++)
			{
				count_num[A[i]]++;
			}

			List<long> choice = new List<long>();
			for (int i = 0; i < count_num.Count; i++)
			{
				choice.Add(count_num[i] * (count_num[i] - 1) / 2);
			}

			for (int i = 0; i < A.Count; i++)
			{
				long ans = choice.Sum() - choice[A[i]];
				ans = ans + ((count_num[A[i]] - 1) * (count_num[A[i]] - 2) / 2);
				Console.WriteLine(ans);
			}
		}
	}
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:9:34: error: 'string' has not been declared
    9 |                 static void Main(string[] args)
      |                                  ^~~~~~
a.cc:9:43: error: expected ',' or '...' before 'args'
    9 |                 static void Main(string[] args)
      |                                           ^~~~
a.cc:38:10: error: expected ';' after class definition
   38 |         }
      |          ^
      |          ;
a.cc: In static member function 'static void D::Program::Main(int*)':
a.cc:11:33: error: expected primary-expression before 'int'
   11 |                         int N = int.Parse(Console.ReadLine());
      |                                 ^~~
a.cc:12:25: error: 'string' was not declared in this scope
   12 |                         string[] tmp = Console.ReadLine().Split(' ');
      |                         ^~~~~~
a.cc:12:32: error: expected primary-expression before ']' token
   12 |                         string[] tmp = Console.ReadLine().Split(' ');
      |                                ^
a.cc:13:25: error: 'List' was not declared in this scope
   13 |                         List<int> A = new List<int>();
      |                         ^~~~
a.cc:13:30: error: expected primary-expression before 'int'
   13 |                         List<int> A = new List<int>();
      |                              ^~~
a.cc:14:45: error: 'tmp' was not declared in this scope
   14 |                         for (int i = 0; i < tmp.Length; i++)
      |                                             ^~~
a.cc:16:33: error: 'A' was not declared in this scope
   16 |                                 A.Add(int.Parse(tmp[i]) - 1);
      |                                 ^
a.cc:16:39: error: expected primary-expression before 'int'
   16 |                                 A.Add(int.Parse(tmp[i]) - 1);
      |                                       ^~~
a.cc:19:30: error: expected primary-expression before 'int'
   19 |                         List<int> count_num = new List<int>(new int[A.Max() + 1]);
      |                              ^~~
a.cc:20:45: error: 'A' was not declared in this scope
   20 |                         for (int i = 0; i < A.Count; i++)
      |                                             ^
a.cc:22:33: error: 'count_num' was not declared in this scope
   22 |                                 count_num[A[i]]++;
      |                                 ^~~~~~~~~
a.cc:25:30: error: expected primary-expression before 'long'
   25 |                         List<long> choice = new List<long>();
      |                              ^~~~
a.cc:26:45: error: 'count_num' was not declared in this scope
   26 |                         for (int i = 0; i < count_num.Count; i++)
      |                                             ^~~~~~~~~
a.cc:28:33: error: 'choice' was not declared in this scope
   28 |                                 choice.Add(count_num[i] * (count_num[i] - 1) / 2);
      |                                 ^~~~~~
a.cc:31:45: error: 'A' was not declared in this scope
   31 |                         for (int i = 0; i < A.Count; i++)
      |                                             ^
a.cc:33:44: error: 'choice' was not declared in this scope
   33 |                                 long ans = choice.Sum() - choice[A[i]];
      |                                            ^~~~~~
a.cc:34:47: error: 'count_num' was not declared in this scope
   34 |                                 ans = ans + ((count_num[A[i]] - 1) * (count_num[A[i]] - 2) / 2);
      |                                               ^~~~~~~~~
a.cc:35:33: error: 'Console' was not declared in this scope
   35 |                                 Console.WriteLine(ans);
      |                                 ^~~~~~~