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: Wrong Answer

Solution code:
import itertools
 
N=int(input())
L=list(map(int,input().split()))
 
if len(L)<3:
    Lis=[]
    print(0)
else:
    Lis=list(itertools.combinations(L,3))

numb=len(Lis)
count=0
 
for i in range(numb):
    if len(L)<3:
        break
 
    if Lis[i][0]==Lis[i][1] or Lis[i][0]==Lis[i][2] or Lis[i][1]==Lis[i][2]:
        pass
    else:
        bpc=Lis[i][1]+Lis[i][2]
        bmc=abs(Lis[i][1]-Lis[i][2])
        if bmc<Lis[i][0] and Lis[i][0]<bpc:
            count+=1
 
print(count)

Submission status: Wrong Answer

Solution code:
import itertools

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

if len(L)<3:
    Lis=[]
    print(0)
else:
    Lis=list(itertools.combinations(L,3))

#print(Lis)
numb=len(Lis)
count=0

for i in range(numb):
    if len(L)<3:
        break

    if Lis[i][0]==Lis[i][1] or Lis[i][0]==Lis[i][2] or Lis[i][1]==Lis[i][2]:
        #print(str(Lis[i])+"をパスしました")
        pass
    else:
        bpc=Lis[i][1]+Lis[i][2]
        bmc=abs(Lis[i][1]-Lis[i][2])
        if bmc<Lis[i][0] and Lis[i][0]<bpc:
            count+=1
            #print(Lis[i])

print(count)

Submission status: Wrong Answer

Solution code:
import itertools

input()
rods = list(map(int, input().split(" ")))
sorted_rods = sorted(rods)

count = 0
for combination in itertools.combinations(sorted_rods, 3):
  a, b, c = combination
  if (a == b or b == c):
    continue
  if (a + b  < c):
    continue
  count += 1
  
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
L=list(map(int,input().split()))
a=0
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] and L[j]>L[i]+L[k] and L[k]>L[j]+L[i]:
                    a+=1
                    
                    

print(a)

Submission status: Wrong Answer

Solution code:
N=int(input())
l=list(map(int, input().split()))
s=0
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] and l[k]!=l[i] and l[i]<l[j]+l[k] and l[j]<l[i]+l[k] and l[k]<l[i]+l[j]:
        s+=1
print(s/6)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

import itertools
N = input()
t = map(int,input().split())
cnt = 0
list = itertools.combinations(t,3)
for i in list:
    if i[0]+i[1]>i[2] and i[1]+i[2]>i[0] and i[2]+i[0]>i[1] and i[0]!=i[1] and i[1]!=i[2] and i[2]!=i[0]:
        cnt += 1
        print(i)

print(cnt)

Submission status: Wrong Answer

Solution code:
import itertools
N = input()
t = map(int,input().split())
cnt = 0
list = itertools.combinations(t,3)
for i in list:
    if i[0]+i[1]>i[2] and i[1]+i[2]>i[0] and i[2]+i[0]>i[1]:
        cnt += 1

print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = sorted(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 L[i] + L[j] > L[k]:
                ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

if n < 3:
    exit()

L = sorted([int(x) for x in input().split()])

count = 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] and L[i] + L[j] > L[k]:
                count += 1

print(count)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
l = list(map(int,input().split()))
counter = 0
if n < 3:
    print(0)
    sys.exit(0)
for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            data0 = l[i]
            data1 = l[j]
            data2 = l[k]
            if (data0 != data1) and (data0 != data2) and (data1 != data2):
                if (data0 + data1 + data2 - max(data0,data1,data2)*2) > 0:
                    print(str(i+1) + ' ' + str(j+1) + ' ' + str(k+1))
                    counter += 1    
print(counter)

Submission status: Wrong Answer

Solution code:
num = int(input())
list = list(map(int,input().split()))
sorted(list)
count = 0
print(list)
for i in range(len(list)):
    for j in range(len(list)):
        for k in range(len(list)):
            if ( list[i] < list[j] < list[k] ) and ( list[i] + list[j] >  list[k] ):
                count += 1
print(count)

Submission status: Wrong Answer

Solution code:
import itertools
n=int(input())
l=list(map(int,input().split()))
L=list(itertools.combinations(l,3))
cnt=0
for i in range(len(L)):
  ll=[]
  ll.append(L[i][0])
  ll.append(L[i][1])
  ll.append(L[i][2])
  ll.sort()
  if ll[1]-ll[0]<ll[2]<ll[1]+ll[0]:
    cnt+=1
print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
ar=[int(x) for x in input().split()]
ar.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if(ar[i]+ar[j]>ar[k]):
        ans+=1
print(ans)

Submission status: Wrong Answer

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

cnt = 0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+i,N):
            c = L[i]
            b = L[j]
            a = L[k]
            if c < a+b and c > b-a and a != b and b != c and c != a:
                cnt += 1
print(cnt)

Submission status: Wrong Answer

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

if N<=2:
	print(0)
else:
	L.sort()
	cnt=0
	for i in range(len(L)-2):
		for j in range(i+1,len(L)-1):
			for k in range(j+1,len(L)):
				if L[i]!=L[j] & L[j]!=L[k] & L[i]+L[j]>L[k]:
					cnt+=1
	print(cnt)

Submission status: Wrong Answer

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

from itertools import combinations

ans = 0
for x in combinations(l, 3):
    if max(x)*2 > sum(x):
        ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
lis = list(map(int , input().split()))

ans=0
lis = sorted(lis)
print(lis)

for v in itertools.combinations(lis, 3):
    if (not(v[0]==v[1] or v[1]==v[2] or v[0]==v[2])) and (v[0]+v[1]>v[2]):
        # print(v)
        ans+=1

print(ans)

Submission status: Wrong Answer

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

if n == 1 or n == 2:
    print(0)
else:
    ans = 0
    for i in range(n):
        for j in range(i + 1,n):
            for k in range(j+1,n):
                
                if len[i] == len[j] or len[j] == len[k]:
                    continue
                if len[j] - len[i] < len[k] and len[j]  + len[i] > len[k]:
                    ans = ans + 1
                else :
                    continue
    print(ans)

Submission status: Wrong Answer

Solution code:
#! env/bin/local python3
# -*- coding: utf-8 -*-

from itertools import combinations


def is_tri(_a, _b, _c):
    if (_a + _b > _c) and (_b + _c > _a) and (_c + _a > _b):
        return True
    else:
        return False


n = int(input())
sticks = list(map(int, input().split()))

h = combinations(sticks, 3)

counter = 0
for a, b, c in h:
    if is_tri(a, b, c):
        # a, b, c = sorted([a, b, c])
        if (a is not b) and (b is not c) and (c is not a):
            counter += 1

print(counter)

Submission status: Wrong Answer

Solution code:
#! env/bin/local python3
# -*- coding: utf-8 -*-

from itertools import combinations


def is_tri(_a, _b, _c):
    if (_a + _b > _c) and (_b + _c > _a) and (_c + _a > _b):
        return True
    else:
        return False


n = int(input())
sticks = list(map(int, input().split()))

h = combinations(sticks, 3)

counter = 0
for a, b, c in h:
    if is_tri(a, b, c):
        a, b, c = sorted([a, b, c])
        if (a != b) and (b != c):
            print(a, b, c)
            counter += 1

print(counter)

Submission status: Wrong Answer

Solution code:
#! env/bin/local python3
# -*- coding: utf-8 -*-

from itertools import combinations


def is_tri(_a, _b, _c):
    if _a + _b > _c and _b + _c > _a and _c + _a > _b:
        return True
    else:
        return False


n = int(input())
sticks = list(map(int, input().split()))

h = combinations(sticks, 3)

counter = 0
for a, b, c in h:
    if is_tri(a, b, c):
        a, b, c = sorted([a, b, c])
        if a != b and b != c:
            print(a, b, c)
            counter += 1

print(counter)

Submission status: Wrong Answer

Solution code:
#! env/bin/local python3
# -*- coding: utf-8 -*-

from itertools import combinations


def is_tri(_a, _b, _c):
    if _a + _b > _c and _b + _c > _a and _c + _a > _b:
        return True
    else:
        return False


n = int(input())
sticks = list(map(int, input().split()))

h = combinations(sticks, 3)

counter = 0
for a, b, c in h:
    if is_tri(a, b, c):
        if a != b and b != c and a != c:
            print(a, b, c)
            counter += 1

print(counter)

Submission status: Wrong Answer

Solution code:
#! env/bin/local python3
# -*- coding: utf-8 -*-

from itertools import combinations


def is_tri(_a, _b, _c):
    if _a + _b > _c and _b + _c > _a and _c + _a > _b:
        return True
    else:
        return False


n = int(input())
sticks = list(map(int, input().split()))

h = combinations(sticks, 3)

counter = 0
for a, b, c in h:
    a, b, c = sorted([a, b, c])
    if is_tri(a, b, c):
        if a is not b and b is not c and a is not c:
            counter += 1

print(counter)

Submission status: Wrong Answer

Solution code:
#! env/bin/local python3
# -*- coding: utf-8 -*-

from itertools import combinations


def is_tri(_a, _b, _c):
    if _a + _b > _c and _b + _c > _a and _c + _a > _b:
        return True
    else:
        return False


n = int(input())
sticks = list(map(int, input().split()))

h = combinations(sticks, 3)

counter = 0
for a, b, c in h:
    if is_tri(a, b, c):
        if a is not b and b is not c and a is not c:
            counter += 1

print(counter)

Submission status: Wrong Answer

Solution code:
from itertools import combinations
s = list(int(i) for i in input().split())
com = list(combinations(s , 3))
arr = []
for i in com:
    com.append(list(i))
    com = com[1:]
for i in com:
    if i[0]!=i[1] and i[2]!=i[1] and i[0]!=i[2]:
        arr.append(i)

newlist = []
seen  = set()
for item in arr:
    t = tuple(item)
    if t not in seen:
        newlist.append(item)
        seen.add(t)
print(len(newlist))

Submission status: Wrong Answer

Solution code:
from itertools import combinations
z=[]
z3=[]
z4=[]
z5=[]
a=int(input())
b=input()

for i in b:
    if i==' ':
        pass
    else:
        b1=int(i)
        z.append(b1)
    
    


a24=list(combinations(z,3))
for i in a24:
    if sorted(i) not in z3:
        z3.append(sorted(i))
for i in z3:
    if i[0]+i[1]<=i[2]:
        z4.append('1')
    if i[0]+i[1]>i[2]:
        z5.append('1')
print(len(z5))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 + j > k :
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
dic = {}
L = list(map(int, input().split()))
L.sort()
s = 0
for i in range(0, len (L)):
    for j in range(i+1 , len (L)):
        for k in range ( j+1 ,len(L)):
            if L[i] > k:
                s+=1
print (s)

Submission status: Wrong Answer

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

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]!=L[k]:
                #print(L[i], L[j], L[k])
                c += 1

Submission status: Wrong Answer

Solution code:
N = int(input())
L = list(map(int, input().split()))
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: Wrong Answer

Solution code:
import itertools

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

L.sort()

candidates = itertools.combinations(L, 3)

count = 0

for t in candidates:
    if t[0] == t[1] or t[1] == t[2]:
        continue
    if t[0] + t[1] >= t[2]:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))
  
n=int(input())
L=input_array()
count=0
for i in range(0,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]:
				a=L[i]+L[j]
				b=L[j]+L[k]
				c=L[i]+L[k]
				if a+b>c and b+c>a and a+c>b:
					count+=1
print(count)

Submission status: Wrong Answer

Solution code:
n, *L = map(int, open(0).read().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: Wrong Answer

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

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]):
                    if (L[i] + L[j] < L[k]):
                            count += 1
                        
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
lst = list(map(int,input().split()))
cnt = 0
lst = sorted(lst)
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] and lst[j] != lst[i]:
          cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
N = input()
lst = list(map(int,input().split()))
cnt = 0
lst = sorted(lst)
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: Wrong Answer

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: Wrong Answer

Solution code:
import math

result=0
n=int(input())

li=list(map(int,input().split()))

for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            if li[i]+li[j]<=li[k]:
                break
            if li[j]+li[k]<=li[i]:
                break
            if li[k]+li[i]<=li[j]:
                break
            #print(i+1,j+1,k+1)
            result+=1
print(result)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = list(map(int,input().split()))
b.sort()
d = 0
 
if a <= 2:
  print("0")
else :
  for i in range(len(b)):
    for j in range(i+1,len(b)):
      for k in range(j+1,len(b)):
        if b[i]+b[j] > b[k]:
          d += 1
  print(str(d))

Submission status: Wrong Answer

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[j]+l[k]>l[i]) and (l[k]+l[i]>l[j]):
					res+=1
	print(res)

Submission status: Wrong Answer

Solution code:
def sides(a,b,c):
  if a + b > c:
    return True
  return False
res = 0
N = int(input())
nums = list(map(int,input().split()))
nums = sorted(nums)
for x in range(N-2):
  for y in range(x+1,N-1):
    for z in range(y+1,N):
      print(x,y,z)
      print(nums[x],nums[y],nums[z],"nums")
      if nums[x] != nums[y] and nums[x] != nums[z] and nums[y] != nums[z] and sides(x,y,z):
        res += 1
print(res)

Submission status: Wrong Answer

Solution code:
import itertools

N = int(input())
L = list(map(int,input().split()))
 
l_list = list(itertools.combinations(L, 3))

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

Submission status: Wrong Answer

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

A.sort()
counter = 0
print(A)
for i in A:
  print('i:'+str(i))
  second = [m for m in A if i < m]
  for j in second:
    print('j:'+str(j))
    third = [n for n in second if j < n]
    if len(third) > 0:
      for k in third:
      	counter += 1
      	print(i,j,third[0])
print(counter)

Submission status: Wrong Answer

Solution code:
N = int(input())

A = map(int, input().split())

A = sorted(A, reverse=True)

c = 0
for l in range(N-2):
    for m in range(l+1, N-1):
        for n in range(m+1, N):
            if A[l] < A[m] + A[n] and A[l] is not A[m] and A[m] is not A[n] :
                c+=1

print(c)

Submission status: Wrong Answer

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

A.sort()
counter = 0
for i in A:
  second = [m for m in A if i < m]
  for j in second:
    third = [n for n in second if j < n]
    if len(third) > 0:
      counter += 1
print(counter)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = [int(w) for w in input().split()]

d = {}

for i in x:
    d[i] = d.get(i, 0) + 1
    
ans = 0
l = list(d.keys())
l = sorted(l)
print(l)
for i in range(len(l)-2):
    for j in range(i+1, len(l)-1):
        for k in range(j+1, len(l)):
            if l[k] < l[i] + l[j]:
                #print(l[i], l[j], l[k])
                ans += d[l[i]]*d[l[j]]*d[l[k]]
            
            else:
                break
            
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 l[i] != l[j] and l[j] != l[k] and l[k] != l[i]:
        if i + j > k:
          if j + k > i:
            if k + i > j:
              ans += 1
              
print(ans)

Submission status: Wrong Answer

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 l[i] != l[j] and l[j] != l[k]:
        if i + j > k:
          if j + k > i:
            if k + i > j:
              ans += 1
              
print(ans)

Submission status: Wrong Answer

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 and j != k:
        if i + j > k:
          if j + k > i:
            if k + i > j:
              ans += 1
              
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 3:
  print(0)
else:
  s = list(map(int, input().split()))
  c = 0
  for i in range(n):
    for j in range(i+1, n):
      for k in range(j+1, n):
        m = max(s[i], s[j], s[k])
        su = s[i] + s[j] + s[k]
        if m < su - m and s[i] != s[j] and s[j] != s[k] and s[k] != s[i]:
          c += 1
          print(i, j, k)
  print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 3:
  print(0)
else:
  s = list(map(int, input().split()))
  c = 0
  for i in range(n):
    for j in range(i+1, n):
      for k in range(j+1, n):
        m = max(s[i], s[j], s[k])
        su = s[i] + s[j] + s[k]
        if m < su - m:
          c += 1
  print(c)

Submission status: Wrong Answer

Solution code:
n=int(input())
boulist=list(map(int,input().split()))
boulist.sort(reverse=True)

count=0
for i in range(n):
  for j in range(i,n):
    for k in range(j,n):
      if boulist[j] != boulist[k] and boulist[i] != boulist[j] and boulist[i]+boulist[j]>boulist[k]:
        count+=1

print(count)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
import collections
import itertools

N = int(input())
L = list(map(int, input().split()))
C = collections.Counter(L)
Comb = []
ans = 0


if N <= 2:
    print(0)
    exit()

for i in itertools.combinations(sorted(C.keys()), 3):
    Comb.append(i)

for i in Comb:
    a = L.count(i[0])
    b = L.count(i[1])
    c = L.count(i[2])
    if b + c > a:
        ans += a*b*c

print(ans)

Submission status: Wrong Answer

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

answer = 0

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

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] and sticks[i] != sticks[j] and sticks[j] != sticks[k]:
        answer += 1
print(answer)

Submission status: Wrong Answer

Solution code:
n = int(input())

L = tuple(map(int, input().split()))

# permutations using library function 
from itertools import combinations 
  
# Get all permutations of [1, 2, 3]
L=set(L)
perm = combinations(L, 3) 
  
# Print the obtained permutations 
count=0
for i in list(perm):
  if i[0]+i[1]>i[2]:
    count +=1
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split(" ")))
ans=0
for x in range(n):
  for y in range(x+1,n):
    for z in range(y+1,n):
      if a[x]+a[y]>=a[z] and a[y]+a[z]>=a[x] and a[z]+a[x]>=a[y] and a[x]!=a[y] and a[y]!=a[z] and a[x]!=a[z]:
        ans=ans+1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split(" ")))
ans=0
for x in range(n):
  for y in range(x+1,n):
    for z in range(y+1,n):
      if a[x]+a[y]>a[z] and a[y]+a[z]>a[x] and a[z]+a[x]>a[y] and a[x]!=a[y]!=a[z]:
        ans=ans+1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split(" ")))
ans=0
for x in range(n):
  for y in range(x+1,n):
    for z in range(y+1,n):
      if a[x]+a[y]>=a[z] and a[y]+a[z]>=a[x] and a[z]+a[x]>=a[y]:
        ans=ans+1
print(ans)

Submission status: Wrong Answer

Solution code:
gross = int(input())
numbers = input().split()
numbers = sorted(numbers)
count = 0

for n in range(gross-2):
    for m in range(gross-1):
        for l in range(gross):
            if (n < m) and (m < l):
                if (int(numbers[n]) != (int(numbers[m]))) and (int(numbers[n]) != (int(numbers[l]))) and (int(numbers[m]) != (int(numbers[l]))):
                    if (int(numbers[n]) + int(numbers[m])) > int(numbers[l]):
                        count += 1
print(count)

Submission status: Wrong Answer

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 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: Wrong Answer

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

c = 0

print(l)
for i in range(n):
    for i2 in range(i + 1, n):
        for i3 in range(i2 + 1, n):
            if l[i] != l[i2] != l[i3]:
                if (
                    l[i] + l[i2] > l[i3]
                    and l[i] + l[i3] > l[i2]
                    and l[i2] + l[i3] > l[i]
                ):
                    c += 1
print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
l = list(map(int, input().split()))
ret = 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[k] + l[i] > l[j] and l[i] != l[j] != l[k]:
        ret += 1
print(ret)

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0

a=list(map(int,input().split()))
a.sort()
print(a)
if N>=3:
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if a[i]!=a[j]!=a[k]!=a[i]:
                    if a[k]<a[i]+a[j]:
                            count+=1
                        
print(count)

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0

a=list(map(int,input().split()))
a.sort()

if N>=3:
    for i in range(N-2):
        for j in range(i+1,N-1):
            for k in range(j+1,N):
                if a[i]!=a[j]&a[j]!=a[k]:
                    if a[i]!=a[k]:
                        count+=1
                
print(count)

Submission status: Wrong Answer

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

a = 0
for i in itertools.permutations(l,3):
    if i[0] < i[1] and i[1] < i[2] and i[2]*i[2] == i[0]*i[0] + i[1]*i[1]:
        a += 1

print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 (a,b,c) in d: continue
      d[(a,b,c)]=1
      ans+=max(a,b,c)<(b+c+a-max(a,b,c))
print(ans)

Submission status: Wrong Answer

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

for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if i < j & j < k:
                if l[i] != l[j] != l[k]:
                    if l[i] + l[j] + l[k] > max(l[i],l[j],l[k])*2:
                        ans += 1

print(ans)

Submission status: Wrong Answer

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

n = 0

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

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [int(x) for x in input().split()]
s = len(arr)
cnt = 0
if s == 1 or s == 2:
  print(0)
else:
  for i in (0,s - 2):
    for j in (i + 1, s - 1):
      for k in (j + 1, s):
        l = []
        l.append(i)
        l.append(j)
        l.append(k)
        l.sort()
        i = l[2]
        j = l[1]
        k = l[0]
        if i < j + k:
          cnt += 1
  print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [int(x) for x in input().split()]
s = len(arr)
cnt = 0
if s == 1 or s == 2:
  print(0)
else:
  for i in (0,s - 2):
    for j in (i, s - 1):
      for k in (j, s):
        l = []
        l.append(i)
        l.append(j)
        l.append(k)
        l.sort()
        i = l[2]
        j = l[1]
        k = l[0]
        if i < j + k:
          cnt += 1
  print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [int(x) for x in input().split()]
s = len(arr)
cnt = 0
if s == 1 or s == 2:
  print(0)
else:
  for i in (0,s - 2):
    for j in (i, s - 1):
      for k in (j, s):
        l = []
        l.append(i)
        l.append(j)
        l.append(k)
        l.sort()
        i = l[0]
        j = l[1]
        k = l[2]
        if i < j + k:
          cnt += 1
  print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
if n < 3:
    print(0)
else:
    for i in range(n-2):
        for j in range(i+1,n-1):
            for k in range(j+1,n):
              if a[i] + a[j] > a[k] and len(set([a[i],a[j],a[k]])) == 3:
                    ans += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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 l[i]+l[j]>l[k] and l[i]!=l[j] and l[i]!=l[k]:
        ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import combinations 

N = int(input())
L_list = sorted(list(map(int, input().split())))
ans = 0

for x, y, z in combinations(L_list, 3):
  print(x, y, z)
  if x == y or y == z or z == x:
    continue
  if x + y > z and y + z > x and z + x > y:
    ans += 1

print(ans)