Language: C++

   return n * (n - 1) / 2;
  } 
  else {
    return 0;
  }
}

int main(){
  int N;
  cin >> N;
  
  vector<int> vec;
  for (int i = 0; i < N; ++i){
    int A;
    cin >> A;
    vec.push_back(A);
  }

  for (int i = 0; i < N; ++i){
    vector<int> vec_bannedk(vec.size());
    copy(vec.begin(), vec.end(), vec_bannedk.begin());
    vec_bannedk.erase(vec_bannedk.begin() + i);
	set<int> set(vec_bannedk.begin(), vec_bannedk.end());
    vector<int> num_list(set.begin(), set.end());
    int total = 0;
    for (int i = 0; i < num_list.size(); ++i){
      int n = count(vec_bannedk.begin(), vec_bannedk.end(), num_list.at(i));
      total += comb2(n);
    }
    cout << total << endl;
  }
 
}

Compiler output:
a.cc:1:4: error: expected unqualified-id before 'return'
    1 |    return n * (n - 1) / 2;
      |    ^~~~~~
a.cc:2:3: error: expected declaration before '}' token
    2 |   }
      |   ^
a.cc:3:3: error: expected unqualified-id before 'else'
    3 |   else {
      |   ^~~~
a.cc:6:1: error: expected declaration before '}' token
    6 | }
      | ^
a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
   10 |   cin >> N;
      |   ^~~
a.cc:12:3: error: 'vector' was not declared in this scope
   12 |   vector<int> vec;
      |   ^~~~~~
a.cc:12:10: error: expected primary-expression before 'int'
   12 |   vector<int> vec;
      |          ^~~
a.cc:16:5: error: 'vec' was not declared in this scope
   16 |     vec.push_back(A);
      |     ^~~
a.cc:20:12: error: expected primary-expression before 'int'
   20 |     vector<int> vec_bannedk(vec.size());
      |            ^~~
a.cc:21:10: error: 'vec' was not declared in this scope
   21 |     copy(vec.begin(), vec.end(), vec_bannedk.begin());
      |          ^~~
a.cc:21:34: error: 'vec_bannedk' was not declared in this scope
   21 |     copy(vec.begin(), vec.end(), vec_bannedk.begin());
      |                                  ^~~~~~~~~~~
a.cc:21:5: error: 'copy' was not declared in this scope
   21 |     copy(vec.begin(), vec.end(), vec_bannedk.begin());
      |     ^~~~
a.cc:23:9: error: 'set' was not declared in this scope
   23 |         set<int> set(vec_bannedk.begin(), vec_bannedk.end());
      |         ^~~
a.cc:23:13: error: expected primary-expression before 'int'
   23 |         set<int> set(vec_bannedk.begin(), vec_bannedk.end());
      |             ^~~
a.cc:24:12: error: expected primary-expression before 'int'
   24 |     vector<int> num_list(set.begin(), set.end());
      |            ^~~
a.cc:26:25: error: 'num_list' was not declared in this scope
   26 |     for (int i = 0; i < num_list.size(); ++i){
      |                         ^~~~~~~~
a.cc:27:15: error: 'count' was not declared in this scope
   27 |       int n = count(vec_bannedk.begin(), vec_bannedk.end(), num_list.at(i));
      |               ^~~~~
a.cc:28:16: error: 'comb2' was not declared in this scope
   28 |       total += comb2(n);
      |                ^~~~~
a.cc:30:5: error: 'cout' was not declared in this scope
   30 |     cout << total << endl;
      |     ^~~~
a.cc:30:22: error: 'endl' was not declared in this scope
   30 |     cout << total << endl;
      |                      ^~~~