Language: C++

include <bits/stdc++.h>
#define len(x) ((int)(x).size())

using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N;
  cin >> N;

  if (N < 3) {
    cout << 0 << endl;
    return 0;
  }

  vector<int> v(N, 0);

  for (size_t i = 0; i < N; i++) {
    cin >> v[i];
  }

  int count = 0;

  int a = 0;
  int b = 0;
  int c = 0;

  for (size_t i = 0; i < N; i++) {
    a = v[i];

    for (size_t j = i + 1; j + i < N; j++) {
      if (a == v[j]) continue;
      b = v[j];

      for (size_t k = j + 1; j + i + k < N; k++) {
        if (a == v[k] || b == v[k]) continue;
        c = v[k];
        count++;
      }
    }
  }

  cout << count << endl;

  return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin.tie(0);
      |   ^~~
a.cc:8:3: error: 'ios' has not been declared
    8 |   ios::sync_with_stdio(false);
      |   ^~~
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout << 0 << endl;
      |     ^~~~
a.cc:14:18: error: 'endl' was not declared in this scope
   14 |     cout << 0 << endl;
      |                  ^~~~
a.cc:18:3: error: 'vector' was not declared in this scope
   18 |   vector<int> v(N, 0);
      |   ^~~~~~
a.cc:18:10: error: expected primary-expression before 'int'
   18 |   vector<int> v(N, 0);
      |          ^~~
a.cc:20:8: error: 'size_t' was not declared in this scope
   20 |   for (size_t i = 0; i < N; i++) {
      |        ^~~~~~
a.cc:1:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | include <bits/stdc++.h>
a.cc:20:22: error: 'i' was not declared in this scope
   20 |   for (size_t i = 0; i < N; i++) {
      |                      ^
a.cc:21:12: error: 'v' was not declared in this scope
   21 |     cin >> v[i];
      |            ^
a.cc:30:8: error: 'size_t' was not declared in this scope
   30 |   for (size_t i = 0; i < N; i++) {
      |        ^~~~~~
a.cc:30:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
a.cc:30:22: error: 'i' was not declared in this scope
   30 |   for (size_t i = 0; i < N; i++) {
      |                      ^
a.cc:31:9: error: 'v' was not declared in this scope
   31 |     a = v[i];
      |         ^
a.cc:33:16: error: expected ';' before 'j'
   33 |     for (size_t j = i + 1; j + i < N; j++) {
      |                ^~
      |                ;
a.cc:33:28: error: 'j' was not declared in this scope
   33 |     for (size_t j = i + 1; j + i < N; j++) {
      |                            ^
a.cc:37:18: error: expected ';' before 'k'
   37 |       for (size_t k = j + 1; j + i + k < N; k++) {
      |                  ^~
      |                  ;
a.cc:37:38: error: 'k' was not declared in this scope
   37 |       for (size_t k = j + 1; j + i + k < N; k++) {
      |                                      ^
a.cc:45:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   45 |   cout << count << endl;
      |   ^~~~
      |   count
a.cc:45:20: error: 'endl' was not declared in this scope
   45 |   cout << count << endl;
      |                    ^~~~