Problem:


Score : 200 points

Problem Statement

We have sticks numbered 1, \cdots, N. The length of Stick i (1 \leq i \leq N) is L_i.

In how many ways can we choose three of the sticks with different lengths that can form a triangle?

That is, find the number of triples of integers (i, j, k) (1 \leq i < j < k \leq N) that satisfy both of the following conditions:

L_i, L_j, and L_k are all different.

There exists a triangle whose sides have lengths L_i, L_j, and L_k.

Constraints

1 \leq N \leq 100

1 \leq L_i \leq 10^9

All values in input are integers.

Input

Input is given from Standard Input in the following format:

N
L_1 L_2 \cdots L_N

Output

Print the number of ways to choose three of the sticks with different lengths that can form a triangle.

Sample Input 1

5
4 4 9 7 5

Sample Output 1

5

The following five triples (i, j, k) satisfy the conditions: (1, 3, 4), (1, 4, 5), (2, 3, 4), (2, 4, 5), and (3, 4, 5).

Sample Input 2

6
4 5 4 3 3 5

Sample Output 2

8

We have two sticks for each of the lengths 3, 4, and 5. To satisfy the first condition, we have to choose one from each length.

There is a triangle whose sides have lengths 3, 4, and 5, so we have 2 ^ 3 = 8 triples (i, j, k) that satisfy the conditions.

Sample Input 3

10
9 4 6 1 9 6 10 6 6 8

Sample Output 3

39

Sample Input 4

2
1 1

Sample Output 4

0

No triple (i, j, k) satisfies 1 \leq i < j < k \leq N, so we should print 0.



Sample input:
5
4 4 9 7 5


Sample output:
5

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>

using namespace std;

template <typename A, typename B>string to_string(pair<A, B> p);

template <typename A, typename B, typename C> string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D> string to_string(tuple<A, B, C, D> p);

string to_string(const string& s) {return '"' + s + '"';}

string to_string(const char* s) {return to_string((string) s);}

string to_string(bool b) {return (b ? "true" : "false");}

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

template <typename A, typename B, typename C>string to_string(tuple<A, B, C> p) {return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";}

template <typename A, typename B, typename C, typename D>string to_string(tuple<A, B, C, D> p) {return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

void test_case(vector <long> v, int n){
	sort(v.begin(),v.end());
	long ans = 0;	
	for (int i = 0; i < n - 2; i++){
		for (int j = i + 1; j < n - 1; j++){
			for (int k = j + 1; k < n; k++){
				if (v[i] != v[j] && v[j] != v[k] && v[i] != v[k] && v[k] < v[j] + v[i]){
					++ans;
					debug(i+1,j+1,k+1);
					debug(v[i],v[j],v[k]);
				}
			}                                     
		}
	}
	cout << ans;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector <long> v(n);
	for (auto &x : v){
		cin >> x;
	}
	test_case(v,n);	
    return 0;
}

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input().split()))

ret = 0

for i in range(n):
    for j in range(n):
        for k in range(n):
            if  list[i]!=list[j] and list[j]!=list[k] and list[k]!=list[i] and list[i]+list[j]>list[k] and list[j]+list[k]>list[i] and list[k]+list[i]>list[j]:
                   ret += 1
                   
print(ret)

Submission status: Runtime Error

Solution code:
n = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
for i in range(n):
  for j in range(i+1, n):
    for k in range(j+1, n):
      if i < l < k and L[i] + L[j] > L[k] :
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
n = len(L)
c = 0
result = []
for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            
            if abs(L[i]-L[j])<L[k]<L[i]+L[j] and  L[i]!=L[j] and L[j]!=L[k]:
                #print(L[i], L[j], L[k])
                c += 1
print(c)

Submission status: Runtime Error

Solution code:
n = len(L)
c = 0
result = []
for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            
            if abs(L[i]-L[j])<L[k]<L[i]+L[j] and  L[i]!=L[j] and L[j]!=L[k]:
                print(L[i], L[j], L[k])
                c += 1
print(c)

Submission status: Runtime Error

Solution code:
mport itertools as it


N = int(input())
s = list(map(int, input().split()))
s.sort()
count = 0


c = it.combinations(s, 3)

for i in c:
    if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:
        continue
    if (i[0] + i[1]) > i[2]:
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
from itertools import permutations
n = int(input())
s = list(int(i) for i in input().split())
s = list(set(s))
all_t = permutations(s)
print(len(all_t))

Submission status: Runtime Error

Solution code:
n = int(input())
l = input()
ans = 
for i in l:
  for j in l:
    if i<j:
      for k in l:
        if j<k and i+j>k:
          ans+=1

print(ans)

Submission status: Runtime Error

Solution code:
from collections import Counter
from itertools import combinations

N = int(input())
L = Counter(list(map(int, input().split())))
ans = 0
for sides in combinations(L.keys(), 3):
    a, b, c = sides.sorted()
    if a + b > c:
        ans += L[a]*L[b]*L[c]
print(ans)

Submission status: Runtime Error

Solution code:
from collections import Counter
from itertools import combinations

N = int(input())
L = Counter(list(map(int, input().split())))
ans = 0
for sides in combinations(L.keys(), 3):
    a, b, c = sides.sorter()
    if a + b > c:
        ans += L[a]*L[b]*L[c]
print(ans)

Submission status: Runtime Error

Solution code:
n, *L = map(int, input().split())
L.sort()
c = 0
for i in range(n-2):
  li = L[i]
  for j in range(i+1, n-1):
    lj = L[j]
    if li == lj:
      continue
    for k in range(j+1, n):
      lk = L[k]
      if lj == lk or li + lj < lk:
        continue
      c += 1
print(c)

Submission status: Runtime Error

Solution code:
N=int(input())
L=[map(int,input().split())]
count=0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in  range(j+1,N):
            if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[i]+L[k]>L[j] not L[i]==L[k]==L[j]:
                count+=1
print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
L=[map(int,input().split())]
count=0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in  range(j+1,N):
            if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[i]+L[k]>L[j] and not L[i]==L[k]==L[j]:
                count+=1
print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
L=[map(int,input().split())]
count=0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in  range(j+1,N):
            if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[i]+L[k]>L[j] not L[i]==L[k]==L[j]:
                count+=1
print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
L=[map(int,input().split())]
count=0
for i in range(N-2):
    for j in range(i+1,N-1):
        for k in  range(j+1,N):
            if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[i]+L[k]>L[j]:
                count+=1
print(count)

Submission status: Runtime Error

Solution code:
N = input()
lst = list(map(int,input().split()))
cnt = 0
for i in range(len(lst)):
  for j in range(len(lst)):
    for k in range(len(lst)):
      if lst[k]+lst[j] > lst[i]:
        if lst[k] != lst[j] != lst[i]
        
          cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
from math import factorial
n = int(input())
l = list(map(int, input().split()))
l.sort()
disabled = 0
for i in range(n-2):
    for j in range(i+1,n-1):
            for k in range(j+1,n):
                if (l[i] + l[j]) <= l[k] or l[i] == l[j] or l[j] == l[k]:
                    disabled += 1
print(int(factorial(n) / factorial(3) / factorial(n-3) - disabled))

Submission status: Runtime Error

Solution code:
a = input()
b = list(map(int,input().split()))
c = b.sort()
d = 0

if a <= 2:
  print("0")
elif :
  for i in len(b):
    for j in (i+1,len(b)):
      for k in (k+1,len(b)):
        if c[i]+c[j] > c[k]:
          d += 1
  print(str(d))

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
if n<=2:
	print(0)
else:
	for i in range(n):
		for j in range(i,n):
			for k in range(j,n):
				if (l[i]!=l[j]) and (l[j]!=l[k]) and (l[i]+l[j]>l[k]) and (l[j]+l[k]>l[i]) and (l[k]+l[i]>l[j]):
					res+=1
	print(res)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
res=0
if n<=2 :
  print(0)
else:
	for i in range(n):
  		for j in range(i,n):
    		for k in range(j,n):
      			if l[i]!=l[j] and l[j]!=l[k] and (l[i]+l[j]>l[k]) and (l[i]+l[k]>l[j]) and (l[j]+l[k]>l[i]):
        		res+=1
print(res)

Submission status: Runtime Error

Solution code:
A = 0
N = int(input())
L = []
for i in range(N):
    L.append(int(input()))
for i in range(N):
    for j in range(N):
        for k in range(N):
            if L[i] != L[j] and L[j] != L[k]:
                P = [L[i],L[j],L[k]]
                P.sort()
                if(P[0] + P[1]) > P[2]:
                    A = A + 1
print(A)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().split()))

l_list = list(itertools.combinations(L, 3))

res = 0

for tri in l_list:
  tri.sort()
  if tri[0] + tri[1] > tri[2]
  	res += 1
    
print(res)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split())
c=0
for i in range(0,n):
      for j in range(i,n):
       		for k in range(j,n):
       				if l[i]!=l[j] and l[j]!=l[k] and l[k]!=l[i]:
       						if l[i]+l[j]>l[k] and l[k]+l[j]>l[i] and l[i]+l[k]>l[j]:
       										c=c+1
print(c)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split())
c=0
for i in range(1,n):
      for j in range(i,n):
       		for k in range(j,n):
       				if l[i]!=l[j] and l[j]!=l[k] and l[k]!=l[i]:
       						if l[i]+l[j]>l[k] and l[k]+l[j]>l[i] and l[i]+l[k]>l[j]:
       										c=c+1
print(c)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split())
c=0
for i in range(1,n):
      for j in range(i,n):
       		for k in range(j,n):
       				if l[i]!=l[j] and l[j]!=l[k] and l[k]!=l[i]:
       						if l[i]+l[j]>l[k] and l[k]+l[j]>l[i] and l[i]+l[k]>l[j]:
       										c=c+1
       print(c)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split())
c=0
for i in range(1,N):
       for j in range(i,N):
       		for k in range(j,N):
       			if l[i]!=l[j] and l[j]!=l[k] and l[k]!=l[i]:
       				if l[i]+l[j]>l[k] and l[j]+l[k]>l[i] and l[i]+l[k]>l[j]:
       							c=c+1
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input()))
l.sort()
ans = 0
for i in range(len(l)):
  for j in range(i+1):
    for k in range(j+1):
      if l[i]+l[j] >= l[k]:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input()))
l.sort()
ans = 0
for i in range(len(l)):
  for j in range(i+1):
    for k in raneg(j+1):
      if l[i]+l[j] >= l[k]:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
r=int(input())
x=list(map(int,input().split())
setx=list(set(x))
setx.sort()
cx=[]
for i in setx:
    cx.append(x.count(i))
ans=0
A=0
while A<=len(setx)-3:
    B=A+1
    while B<=len(setx)-2:
        C=B+1
        while C<=len(setx)-1:
            if setx[A]+setx[B]>setx[C]:
                ans+=cx[A]*cx[B]*cx[C]
            C+=1
        B+=1
    A+=1
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = [int(input()) for _ in range(N)]

ans = 0
for i in range(N):
  for j in range(i+1, N):
    for k in range(j+1, N):
      if L[i] != L[j] and L[j] != L[k] and L[i] != L[k]:
        if L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[i] + L[k] > L[j]:
          ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
sticks = list(map(int, input().split()))

answer = 0

if N < 3:
  print(answer)
  exit()

sticks = list(dict.fromkeys(sticks))

for i in range(N-2):
  for j in range(i+1, N-1):
    for k in range(j+1, N):
      if sticks[i] + sticks[j] > sticks[k]:
        answer += 1

Submission status: Runtime Error

Solution code:
n = int(input())
arr = sorted(list(map(int, input().split())))
res = 0
for i in range(0, n - 2):
	for j in range(i, n - 1):
		for k in range(j, n):
			if arr[i] + arr[j] > arr[k] and arr[i] != arr[j] and arr[j] != arr[k] and arr[i != arr[k]:
 				res += 1
print(res)

Submission status: Runtime Error

Solution code:
n = int(input())
nums = sorted(list(map(int, input().split())))
res = 0
for i in range(0, n - 2):
	for j in range(i, n - 1):
		for k in range(j, n):
			if arr[i] + arr[j] > arr[k] and arr[i] != arr[j] and arr[j] != arr[k] and arr[i != arr[k]:
 				res += 1
print(res)

Submission status: Runtime Error

Solution code:
count = 0
n = int(input())
arr = list(map(int,input().split()))
ar = []
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if triv(arr[i],arr[j],arr[k]):
        if arr[i]==arr[j] or arr[i]==arr[k] or arr[j]==arr[k]:
          continue
        if arr[i]+arr[j]>arr[k]:
          count+=1
print(count)

Submission status: Runtime Error

Solution code:
def triv(a, b, c):  
    if (a + b <= c) or (a + c <= b) or (b + c <= a) : 
        return False
    else: 
        return True  
count = 0
m = int(input())
arr = list(map(int,input()))
for i in range(len(arr)):
  for j in range(i,len(arr)):
    for x in range(j,len(arr)):
      if triv(i,j,x):
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))

ans=0
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i <= j <= k:
        if l[i]==l[j] or  l[j]==l[k] or l[i]==l[k]:
          continue
        if max(l[i],l[j],l[k]) < sum(sum(l[i],l[j]),l[k]) - max(l[i],l[j],l[k]):
          ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))

ans=0
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i <= j <= k:
        if l[i]==l[j] or  l[j]==l[k] or l[i]==l[k]:
          continue
        if max(l[i],l[j],l[k]) < sum(l[i],l[j],l[k]) - max(l[i],l[j],l[k]):
          ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = int(input().split())

L2 = list(set(L)) # 重複を削除

ans = 0

for i in range(len(L2)):
  for j in range(i+1, len(L2)):
    for k in range(j+1, len(L2)):
      l = [L2[i], L2[j], L2[k]]
      l = sorted(l, reverse = True)
      if l[0] < l[1] + l[2]:
        ans += L.count(L2[i]) * L.count(L2[j]) * L.count(L2[k])

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = int(input().split(' '))

L2 = list(set(L)) # 重複を削除

ans = 0

for i in range(len(L2)):
  for j in range(i+1, len(L2)):
    for k in range(j+1, len(L2)):
      l = [L2[i], L2[j], L2[k]]
      l = sorted(l, reverse = True)
      if l[0] < l[1] + l[2]:
        ans += L.count(L2[i]) * L.count(L2[j]) * L.count(L2[k])

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = int(input().split(' '))
L2 = set(L) # 重複を削除

ans = 0

for i in len(L2):
  for j in range(i+1, len(L2)):
    for k in range(j+1, len(L2)):
      l = [L2[i], L2[j], L2[k]]
      l = sorted(l, reverse = True)
      if l[0] < l[1] + l[2]:
        ans += L.count(L2[i]) * L.count(L2[j]) * L.count(L2[k])

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = int(input().split())
L2 = set(L) # 重複を削除

ans = 0

for i in len(L2):
  for j in range(i+1, len(L2)):
    for k in range(i+2, len(L2)):
      l = [L2[i], L2[j], L2[k]]
      l = sorted(l, reverse = True)
      if l[0] < l[1] + l[2]:
        ans += L.count(L2[i]) * L.count(L2[j]) * L.count(L2[k])

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = int(input().split())
L2 = set(L) # 重複を削除

ans = 0

for i in len(L2):
  for j in range(i+1, len(L2)):
    for k in range(i+2, len(L2)):
      l = [i, j, k]
      l = sorted(l, reverse = True)
      if l[0] < l[1] + l[2]:
        ans += L.count(i) * L.count(j) * L.count(k)

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int, input().split()))
d={}
ans = 0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      a,b,c = l[i],l[j],l[k]
      if d[(a,b,c)]: continue
      d[(a,b,c)]=1
      ans+=max(a,b,c)<(b+c+a-max(a,b,c))
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().split()))



ans = 0

for i in range(len(L)):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            #print("L[i]:",L[i],"L[j]:",L[j],"L[k]:",L[k])
            if L[i]+L[j] > L[k] and L[j]+L[k] > L[i] and L[k]+L[i] > L[j] and L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
                #print("L[i]:",L[i],"L[j]:",L[j],"L[k]:",L[k])
                ans += 1

prinr(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().split()))



ans = 0

for i in range(len(L)):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            #print("L[i]:",L[i],"L[j]:",L[j],"L[k]:",L[k])
            if L[i]+L[j] > L[k] and L[j]+L[k] > L[i] and L[k]+L[i] > L[j] \
            and L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
                #print("L[i]:",L[i],"L[j]:",L[j],"L[k]:",L[k])
                ans += 1

prinr(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().split()))
print(L)


ans = 0

for i in range(len(L)):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            #print("L[i]:",L[i],"L[j]:",L[j],"L[k]:",L[k])
            if L[i]+L[j] > L[k] and L[j]+L[k] > L[i] and L[k]+L[i] > L[j] and L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
                #print("L[i]:",L[i],"L[j]:",L[j],"L[k]:",L[k])
                ans += 1

prinr(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().split()))
print(L)


ans = 0

for i in range(len(L)):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            #print("L[i]:",L[i],"L[j]:",L[j],"L[k]:",L[k])
            if L[i]+L[j] > L[k] and L[j]+L[k] > L[i] and L[k]+L[i] > L[j] \
            and L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
                #print("L[i]:",L[i],"L[j]:",L[j],"L[k]:",L[k])
                ans += 1

prinr(ans)

Submission status: Runtime Error

Solution code:
from itertools import combinations
n = int(input())
l = list(map(int,input().split()))
c = combinations(l,3)
ans=0
for (a,b,c) in c:
	if a+b>c and b+c>a and c+a>b and a!=b and b!=c and a!=c:
		+=1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
if n < 3:
  print(0)
  exit()
l = map(int,input().split())
l.sort()
c = 0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if l[i] + l[j] > l[k] and l[i] != l[j] and l[j] != l[k]:
        c += 1
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
l = []
for index in range(n):
    l.append(int(input()))

res = 0
for t0 in range(len(l)-2):
    for t1 in range(t0,len(l)-2):
        for t2 in range(t1, len(l) - 2):
            if(l[t0]!=l[t1] and  l[t1]!=l[t2]  and l[t1]!=l[t2]):
                if(t0+t1>t2 and t0+t2>t1 and t1+t2>t0):
                    res += 1
print(res)

Submission status: Runtime Error

Solution code:
N = int(input())
 
L = map(int, input().split())
L.sort()
ret = 0
if N >= 3:
  for i in range(N - 2):
    for j in range(i + 1, N - 1):
      if L[i] != L[j]:
        for k in range(j + 1, N):
          if L[i] != L[k] and L[j] != L[k] and L[i] + L[j] > L[k]:
            ret += 1
print(ret)

Submission status: Runtime Error

Solution code:
from collections import Counter
from itertools import product

N = int(input())
L =　list(map(int, input().split()))
C = Coutner(L)

S = list(set(L))

ans = 0
for a, b, c in product(S, repeat = 3):
    if a + b > c and a + c > b and b + c > a:
        ans += (C[a]*C[b]*C[c])

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input().rstrip())
edgeList = sorted([int(_) for _ in input().rstrip().split(" ")])n = int(input().rstrip())
edgeList = [int(_) for _ in input().rstrip().split(" ")]
cnt = 0
for i in range(n):
  for j in range(i+1, n):
    if edgeList[i] != edgeList[j]:
      for k in range(j+1, n):
        cnt += (edgeList[i] != edgeList[k] and 
                edgeList[j] != edgeList[k] and 
                edgeList[i] + edgeList[j] > edgeList[k] and 
                edgeList[j] + edgeList[k] > edgeList[i] and 
                edgeList[k] + edgeList[i] > edgeList[j])
print(cnt)

Submission status: Runtime Error

Solution code:
a=input().split()
b=input().split()
print(int(b[1]=="1"))

Submission status: Runtime Error

Solution code:
n = int(input())
    l = list(map(int, input().split()))
    ans = 0

    for i in range(n - 2):
        for j in range(i + 1, n - 1):
            for k in range(j + 1, n):
                if len(set([l[i], l[j], l[k]])) == 3 and max(l[i], l[j], l[k]) < sum([l[i], l[j], l[k]]) - max(l[i], l[j], l[k]):
                    ans += 1
    print(ans)

Submission status: Runtime Error

Solution code:
import sys

n=int(input())
l=[int(x) for x in input().rstrip().split()]
l.sort()
num=[0]*max(l)
for i in l:
  num[i-1]+=1

ans=0
for i in range(n):
  for j in range(i+1,n):
    for s in range(j+1,n):
      if l[i]!=l[j] and l[j]!=l[s] and l[i]!=l[s]:
        if l[i]<l[j]+l[s] and l[j]<l[i]+l[s] and l[s]<l[i]+l[j]:
          ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
L = list(int(x) for x in input().split())
if n <= 2:
    print(0)
    exit()
ans = 0
for a, b, c in combinations(L, 3):
    if a != b and b != c and c != a:
        if a + b > c and b + c > a and c + a > b:
            ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().strip().split()))
L_sort = L.sort()
count = 0
for i in range(N-2):
	for j in range(i+1 , N):
		for k in range(j+1 , N):
        		if L_sort[i] + L_sort[j] > L_sort[k]:
            			count += 1
                	else:
                		k += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().strip().split()))
L_sort = L.sort()
count = 0
for i in range(N-2):
	for j in range(i+1 , N):
		for k in range(j+1 , N):
        		if L_sort[i] + L_sort[j] > L_sort[k]:
            			count += 1
                else:
                	k += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().strip().split()))
L_sort = L.sort()
count = 0
for i in range(N-2):
	for j in range(i+1 , N):
		for k in range(j+1 , N):
        		if L_sort[i] + L_sort[j] > L_sort[k]:
            			count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().strip().split()))
L_sort = L.sort()
count = 0
for i in range(N-2):
	for j in range(i+1 , N):
		for k in range(j+1 , N):
        	if L_sort(i) + L_sort(j) > L_sort(k):
            	count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int,input().strip().split()))
L_sort = L.sort()
count = 0
for i in range(N-2):
	for j in range(i+1 , N):
    	for k in range(j+1 , N):
        	if L_sort(i) + L_sort(j) > L_sort(k):
            	count += 1
print(count)

Submission status: Runtime Error

Solution code:

n = int(input())
l = list(map(int, input().split()))
used = []
count = 0

if n >= 3:
  for i in range(0, n):
    i = l[i]
    for j in range(0, n):
      j = l[j]
      if j != i:
        for k in range(0, n):
          k = l[k]
          temp = [i , j, k]
          temp.sort
          if k != i and  k != j and l.count(temp) == 0:
            if i + j >= k and i + k >= j and k + j >= i:
              count += 1 * (l.count(i) * l.count(j) * l.count(k))
              used.append(temp)

print(int(count/len(used)))

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int, input().split()))
L.sort()
cnt = 0
for i in range(N):
  Li = L[i]
  for j in range(N):
    Lj = L[j]
    if Li != Lj:
      for k in range(N):
        Lk = L[k]
      	if Lk != Lj and Lk != Li:
          if Lk < Li + Lj:
            cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
# coding: utf-8
# Your code here!

import copy

N = int(input().rstrip())
L = input().rstrip().split(" ")
L = [int(i) for i in L] 
C_3 = []

for i in range(N):
    C_1 = copy.copy(L)
    del C_1[i]
    
    for j in range(N-1):
        C_2 = copy.copy(C_1)
        del C_2[j]
        C_3.append(C_2)

n = int(len(C_3))
Answer = 0
for i in range(n):
    print(C_3[i])
    L_i = int(C_3[i][0])
    L_j = int(C_3[i][1])
    L_k = int(C_3[i][2])
    if L_i != L_j and L_j != L_k and L_k != L_i:
        if L_i + L_j - L_k > 0:
            Answer += 1
            print(Answer)

Submission status: Runtime Error

Solution code:
N = int(input())
for i in range(N):
  M = int(input())
if N <= 3:
  print(0)
else:
  count=0
  for i in M:
    for j in M:
      for k in M:
        if i<j<k and i+j>k and i!=j and i!=k and k!=j:
          count+=1
  print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
sum = []
for i in range(N):
  M = int(input())
  sum.append(M)
if N < 3:
  print(0)
else:
  count=0
  for i in sum:
    for j in sum:
      for k in sum:
        if i<j<k and i+j>k and i!=j and i!=k and k!=j:
          count+=1
  print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
sum = []
for i in range(N):
  M = int(input())
  sum.append(M)
if N < 3:
  print(0)
else:
  count=0
  sum1=[]
  for i in sum:
    for j in sum:
      for k in sum:
        if i<j<k and i+j>k and i!=j and i!=k and k!=j:
          count+=1
  print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
sum = []
for i in range(N):
  M = int(input())
  sum.append(M)
if N < 3:
  print(0)
else:
  count=0
  sum1=[]
  for i in sum:
    for j in sum:
      for k in sum:
        if i<j<k and i+j>k and i!=j and i!=k and k!=j:
          a = (i,j,k)
          count+=1
  print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input().split()))


count = 0

for i in l:
    for j in l:
        for k in l:
            if l[i]+l[j]>l[k] & l[j]+l[k]>l[i] & l[k]+l[i]>l[j] & l[i!=j!=k:
                    count += 1

print(count)

Submission status: Runtime Error

Solution code:
import itertools
N = int(input())
A = list(map(int, input().split()))

count = 0
for x in itertools.combinations(A, 3):
  if(x[0] + x[1] > x[2] and x[1] + x[2] > x[0] and x[2] + x[0] >x[1]):
    if(x[0]!=x[1] and x[0]!=x[1] and x[2] != x[3]):
    	count +=1
print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
import itertools
A = list(map(int, input().split())) 

count=0
for ｔ in itertools.combinations(A, 3):
    if list(t)[0]<list(t)[1]+list[2] and list(t)[1]<list(t)[2]+list(t)[0] and list(t)[2]<list(t)[0]+list(t)[1]:

        cout+=1

print(count)

Submission status: Runtime Error

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

n = I()
L = LI()
cnt = 0

for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            if len({[L[i], L[j], L[k]]}) != 3:
                continue
            Li = [L[i], L[j], L[k]]
            Li.sort()
            if Li[2] <= Li[0] + Li[1]:
                cnt += 1

print(cnt)

Submission status: Runtime Error

Solution code:
N=input()
S=list(map(int, input().strip().split()))
dou=0
for i in range(len(S)-2):
    l1=S[i]
    for z in range(len(S)-i-2):
        l2=S[i+1+z]
        for t in range(len(S)-z-i-2):
            l3=S[i+z+2+t]
            if l1!=l2 and l1!=l3 and l2!=l3 and max(l1,l2,l3)<(sum(l1,l2,l3)-max(l1,l2,l3)):
                dou+=1
print(dou)

Submission status: Runtime Error

Solution code:
N = int(input())
l = list(map(int,input().split()))


ans = 0

for i in range(len(L)):
    for j in range(len(L)):
        for k in range(len(L)):
            if L[i] < L[j] < L[k]:
                if L[i]**2 + L[j]**2 == L[k]**2:
                    ans += 8
                else:
                    continue
            else:
                continue

print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
L = list(map(int, input().split()))
t = 0

for a in range(N - 2):
    for b in range(N - 2):
        for count in range(N - 2):
            x = L[a], L[a + b + 1], L[a + 1 + count]
            mylist = list(x)
            mylist.sort()
            if mylist[0] + mylist[1] > mylist[2]:
                t += 1

print(t)

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int, input().split()))

if N >= 2:
  print(0)

for i in range(0,2):
  if L[i] != L[i+1] and  L[i] != L[i+2] and  L[i+1] != L[i+2]:
    c += 1

for i in range(N-3):
  if L[i] != L[i+2] and  L[i] != L[i+3] and  L[i+3] != L[i+2]:
    c += 1

print(c)