TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
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)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
arr=list(map(int,input().split()))
dummy=len(arr)
ans=0
if dummy>2:
  for i in range(dummy-2):
      for j in range(i+1,dummy-1):
          for k in range(j+1,dummy):
              if arr[i]!=arr[j] and arr[j]!=arr[k] and arr[k]!=arr[i]:
                  if arr[i]<arr[j]+arr[k] and arr[j]<arr[k]+arr[i] and arr[k]<arr[j]+arr[i]:
                      ans+=1
	print(ans)
else:
  print(0)

n=int(input())
arr=list(map(int,input().split()))
dummy=len(arr)
ans=0
if dummy>2:
    for i in range(dummy-2):
        for j in range(i+1,dummy-1):
            for k in range(j+1,dummy):
                if arr[i]!=arr[j] and arr[j]!=arr[k] and arr[k]!=arr[i]:
                    if arr[i]<arr[j]+arr[k] and arr[j]<arr[k]+arr[i] and arr[k]<arr[j]+arr[i]:
                        ans+=1
    print(ans)
else:
    print(0)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):

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)


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

print(count)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
l = sorted(list(map(int, input().split())))

a = 0
        
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if l[k] < l[i] + l[j] and l[i] < l[j] and l[j] < l[k]:
                a += 1

print(a, l)


n = int(input())
l = sorted(list(map(int, input().split())))

a = 0
        
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            if l[k] < l[i] + l[j] and l[i] < l[j] and l[j] < l[k]:
                a += 1

print(a)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
hen_list = list(map(int, input().split()))
count = 0

for x in hen_list:
  for y in hen_list:
    for z in hen_list:
      if (z > x and z > y and y > x) and z*z == x*x + y*y:
        count += 1

print(count)


n = int(input())
hen_list = list(map(int, input().split()))
count = 0

for x in hen_list:
  for y in hen_list:
    for z in hen_list:
      if (z > x and z > y and y > x) and x + y > z:
        count += 1

print(count)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
L = list(map(int, input().split()))

L.sort()
cnt = 0
print(L)
for i in range(len(L)):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            if L[k] < (L[j] + L[i]) and L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
                cnt = cnt + 1
print(cnt)


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

L.sort()
cnt = 0
for i in range(len(L)):
    for j in range(i+1,len(L)):
        for k in range(j+1,len(L)):
            if L[k] < (L[j] + L[i]) and L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
                cnt = cnt + 1
print(cnt)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(n-2):
  for j in range(i,n-1):
    for k in range(n):
      if A[i]+A[j]+A[k]>2*max(A[i],A[j],A[k]):
        if max(A[i],A[j],A[k])!=min(A[i],A[j],A[k]):
          ans+=1
print(ans)
 

n=int(input())
A=list(map(int,input().split()))
A.sort()
ans=0
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]:
        if A[i]!=A[j] and A[j]!=A[k]:
          ans+=1
      else:
        break
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
l = list(map(int,input().split()))
l.sort()
ans = 0
if n <= 2:print(0);exit()
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]:
        ans += 1
print(ans)

n = int(input())
l = list(map(int,input().split()))
l.sort()
ans = 0
if n <= 2:print(0);exit()
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[j] != l[k]:
        ans += 1
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
lst = 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):
      lst2 = [lst[i], lst[j], lst[k]]
      if (lst2[0] < lst2[1] + lst2[2] and lst2[1] < lst2[0] + lst2[2] and lst2[2] < lst2[0] + lst2[1]):
        ans = ans + 1
print(ans)


n = int(input())
lst = 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):
      lst2 = [lst[i], lst[j], lst[k]]
      lst3 = sorted(lst2)
      if(lst3[2] < lst3[1] + lst3[0]):
        ans = ans + 1
print(ans)


n = input()
lst = 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):
      lst2 = [lst[i], lst[j], lst[k]]
      lst3 = sorted(lst2)
      if(lst3[2] < lst3[1] + lst3[0]):
        ans = ans + 1
print(ans)

n = int(input())
lst = 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):
      lst2 = [lst[i], lst[j], lst[k]]
      if (lst2[0] != lst2[1] and lst2[0] != lst2[2] and lst2[1] != lst2[2]):
        if (lst2[0] < lst2[1] + lst2[2] and lst2[1] < lst2[0] + lst2[2] and lst2[2] < lst2[0] + lst2[1]):
          ans = ans + 1
print(ans)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import bisect

N = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)
if N < 3:
    print(0)

ans = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        if L[i] == L[j]:
            continue
        for k in range(j+1, N):
            if L[i] == L[k] or L[j] == L[k]:
                continue
            if L[i] < L[j] + L[k]:
                print(L[i], L[j], L[k])
                ans += 1

print(ans)


import bisect

N = int(input())
L = list(map(int, input().split()))
L.sort(reverse=True)
if N < 3:
    print(0)
    exit()

ans = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        if L[i] == L[j]:
            continue
        for k in range(j+1, N):
            if L[i] == L[k] or L[j] == L[k]:
                continue
            if L[i] < L[j] + L[k]:
                ans += 1

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)


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)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)


from itertools import combinations 

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

for x, y, z in combinations(L_list, 3):
  
  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)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

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)


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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
long_list = input().split()
count = 0
for i in range(N):
    long_i = int(long_list[i])
    for j in range(N-i-1):
        long_j = int(long_list[i+j+1])
        for k in range(N-i-j-2):
            long_k = int(long_list[i+j+k+2])
            if long_i == long_j or long_j == long_k or long_k == long_i:
                pass
            elif long_i + long_j > long_k or long_i + long_k > long_j or long_j + long_k > long_i:
                count += 1    
            else:
                pass

print("{0}".format(count))  
                

N = int(input())
long_list = input().split()
count = 0
for i in range(N):
    long_i = int(long_list[i])
    for j in range(N-i-1):
        long_j = int(long_list[i+j+1])
        for k in range(N-i-j-2):
            long_k = int(long_list[i+j+k+2])
            if long_i + long_j < long_k or long_i + long_k < long_j or long_j + long_k < long_i:
                count += 1    
            else:
                pass

print("{0}".format(count))  
                

N = int(input())
long_list = input().split()
count = 0
for i in range(N):
    long_i = int(long_list[i])
    for j in range(N-i-1):
        long_j = int(long_list[i+j+1])
        for k in range(N-i-j-2):
            long_k = int(long_list[i+j+k+2])
            if long_i == long_j or long_j == long_k or long_k == long_i:
                pass
            elif long_i + long_j > long_k and long_i + long_k > long_j and long_j + long_k > long_i:
                count += 1    
            else:
                pass

print("{0}".format(count))  


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
count = 0

length = int(input())
length_list = map(int, input().split())

for i in range(length - 2):
    for j in range(i + 1, length - 1):
        if length_list[i] != length_list[j]:
            for k in range(j + 1, length):
                if length_list[j] != length_list[k] and length_list[k] != length_list[i]:
                    half_length_sum = (length_list[i] + length_list[j] + length_list[k]) / 2
                    if half_length_sum > max(length_list[i], length_list[j], length_list[k]):
                        count += 1
print(count)

count = 0

length = int(input())
length_list = list(map(int, input().split()))

for i in range(length - 2):
    for j in range(i + 1, length - 1):
        if length_list[i] != length_list[j]:
            for k in range(j + 1, length):
                if length_list[j] != length_list[k] and length_list[k] != length_list[i]:
                    half_length_sum = (length_list[i] + length_list[j] + length_list[k]) / 2
                    if half_length_sum > max(length_list[i], length_list[j], length_list[k]):
                        count += 1
print(count)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
l = list(map(int,input().split()))
ans = 0
g = set(l)
m = list(g)
m.sort()
for i in range(n):
  judge = 0
  for j in range(i+1,n):
    for k in range(j+1,n):
      if(m[i]<m[j]+m[k]):
        ans += 1
      else:
        break
    if(judge==0):
      break
print(ans)


n = int(input())
l = list(map(int,input().split()))
ans = 0
g = set(l)
m = list(g)
m.sort()
for i in range(n):
  judge = 0
  for j in range(i+1,n):
    for k in range(j+1,n):
      if(m[i]<[j]+[k]):
        ans += 1
      else:
        break
    if(judge==0):
      break
print(ans)


n = int(input())
l = list(map(int,input().split()))
ans = 0
l.sort(reverse=True)
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])and(l[j]!=l[k])and(l[i]!=l[k])and(l[i]<l[j]+l[k]):
        ans += 1
print(ans)



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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[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)


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[i] == l[k]:
        coutinue
      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)


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


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 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)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
l = list(map(int,input().split()))
c= 0

for i in range(2,n):
  for j in range(1,n):
    for k in range(n):
      if l[i] + l[j] > l[k] and l[j]+l[k]>l[i] and l[k]+l[i]>l[j]  and i<j and j<k:
        c += 1

print(c)


n = int(input())
l = list(map(int,input().split()))
c= 0

for i in range(n):
  for j in range(n):
    for k in range(n):
      if l[i] + l[j] > l[k] and l[j]+l[k]>l[i] and l[k]+l[i]>l[j]  and i<j and j<k and l[i] != l[j] != l[k] != l[i]:
        c += 1

print(c)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
import itertools
A = list(map(int, input().split())) 

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

    print(count)

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

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

print(count)


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

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

    print(count)

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)

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

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

            count+=1

    print(count)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
L = [int(x) for x in input().split()]
sum = 0
for i in range(N):
    for j in range(i+1,N):
        if L[i] == L[j]:
            continue
        for k in range(j+1,N):
            if L[i] == L[k] or L[j] == L[k]:
                continue
            if L[i]+L[j]>L[k] and L[i]+L[k]>L[j] and L[k]+L[j]>L[i]:
                print(L[i],L[j],L[k])
                sum += 1
print(sum)


N = int(input())
L = [int(x) for x in input().split()]
sum = 0
for i in range(N):
    for j in range(i+1,N):
        if L[i] == L[j]:
            continue
        for k in range(j+1,N):
            if L[i] == L[k] or L[j] == L[k]:
                continue
            if L[i]+L[j]>L[k] and L[i]+L[k]>L[j] and L[k]+L[j]>L[i]:
                sum += 1
print(sum)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
ans = 0
lis = list(map(int,input().split()))
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i != j and j != k and i != k:
        if lis[i] != lis[j] and lis[j] != lis[k] and lis[i] != lis[k]:
          if max(lis[i],lis[j],lis[k]) < lis[i]+lis[j]+lis[k]-max(lis[i],lis[j],lis[k]):
            ans += 1
print(ans)


n = int(input())
ans = 0
lis = list(map(int,input().split()))
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i != j and j != k and i != k:
        if max(lis[i],lis[j],lis[k]) < lis[i]+lis[j]+lis[k]-max(lis[i],lis[j],lis[k]):
          ans += 1
print(ans)

n = int(input())
ans = 0
lis = list(map(int,input().split()))
for i in range(n):
  for j in range(i,n):
    for k in range(j,n):
      if i != j and j != k and i != k:
        if lis[i] != lis[j] and lis[j] != lis[k] and lis[i] != lis[k]:
          if max(lis[i],lis[j],lis[k]) < lis[i]+lis[j]+lis[k]-max(lis[i],lis[j],lis[k]):
            ans += 1
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
count=0
L=list(map(int,input().split()))
for i in range(N):
  for j in range(i,N):
    for k in range(j,N):
      if L[i]<L[j]+L[k] and L[i]+L[j]>L[k] and L[j]<L[i]+L[k]:
        count+=1
print(count)

N=int(input())
count=0
L=list(map(int,input().split()))
for i in range(N):
  for j in range(i,N):
    for k in range(j,N):
      if L[i]<L[j]+L[k] and L[k]<L[j]+L[i] and L[j]<L[i]+L[k]:
        count+=1
print(count)


N=int(input())
count=0
L=list(map(int,input().split()))
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[j]<L[k]+L[i] and L[k]<L[i]+L[j]:
                if L[i]!=L[k] and L[i]!=L[j] and L[k]!=L[j]:
                    count+=1
print(count)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

# B - Making Triangle

import bisect

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

L.sort()

ans=0
print(L)
for i in range (N):
    for j in range (i+1,N):
        if L[i]==L[j]:
            pass
        else:
            ab=L[i]+L[j]
            c=bisect.bisect_left(L,ab)
            bequalc=bisect.bisect_right(L,L[j])
            ans+=c-(bequalc)

print(ans)


# B - Making Triangle

import bisect

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):
        if L[i]==L[j]:
            pass
        else:
            ab=L[i]+L[j]
            c=bisect.bisect_left(L,ab)
            bequalc=bisect.bisect_right(L,L[j])
            ans+=c-(bequalc)

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import itertools

def chkTrg(a,b,c):
    if (a + b > c and b + c > a and c + a > b) and (a != b and b != c and c != a):
        return True
    else:
        return False

N = int(input())
bars = [int(i) for i in input().split(" ")]

cnt = 0

for bar in itertools.combinations(bars, 3):
    if chkTrg(bar[0],bar[1],bar[2]):
        cnt += 1

print(cnt)import itertools

def chkTrg(a,b,c):
    if (a + b > c and b + c > a and c + a > b) and (a != b and b != c and c != a):
        return True
    else:
        return False

N = int(input())
bars = [int(i) for i in input().split(" ")]

cnt = 0

for bar in itertools.combinations(bars, 3):
    if chkTrg(bar[0],bar[1],bar[2]):
        cnt += 1

print(cnt)

import itertools

def chkTrg(a,b,c):
    if (a + b > c and b + c > a and c + a > b) and (a != b and b != c and c != a):
        return True
    else:
        return False

N = int(input())
bars = [int(i) for i in input().split(" ")]

cnt = 0

for bar in itertools.combinations(bars, 3):
    if chkTrg(bar[0],bar[1],bar[2]):
        cnt += 1

print(cnt)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

from collections import Counter
import itertools 

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

S = list(set(L))

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

print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

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(int(s/6))


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

def main():
    counter = 0
    n = int(input())
    l = list(map(int,input().split()))
    l.sort()
    for i in range(n-2):
        for j in range(i+1,n):
            for k in range(j+1,n):
                if l[i]==l[j] or l[j]==l[k] or l[k]==l[i]:
                    continue
                if l[k] < (l[i] + l[j]):
                    print(l[i],l[j],l[k])
                    counter += 1

    print(counter)




if __name__ == '__main__':
    main()



def main():
    counter = 0
    n = int(input())
    l = list(map(int,input().split()))
    l.sort()
    for i in range(n-2):
        for j in range(i+1,n):
            for k in range(j+1,n):
                if l[i]==l[j] or l[j]==l[k] or l[k]==l[i]:
                    continue
                if l[k] < (l[i] + l[j]):
                    #print(l[i],l[j],l[k])
                    counter += 1

    print(counter)




if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import itertools
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
count = 0
for i in itertools.combinations(arr, 3):
  if i[0]+i[1] > i[3] and i[0]+i[3] > i[1] and i[3]+i[1] > i[0]:
    count += 1
print(count)
    
  


import itertools

n = int(input())
arr = list(map(int, input().split()))
arr.sort()
count = 0
for i in itertools.combinations(arr, 3):
    if i[0] + i[1] > i[2] and i[0] + i[2] > i[1] and i[2] + i[1] > i[0] and i[0] != i[1] != i[2]:
        count += 1
print(count)




Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
li = list(map(int, input().split()))

if n <= 2:
    print(0)
else:
    cnt = 0

    for i in range(n):
        for j in range(i+1, n):
            for k in range(j+1, n):
                if li[i] == li[j] or li[j] == li[k] or li[i] == li[k]:
                    continue

                l = sorted([li[i], li[j], li[k]])

                if l[0] + l[1] > l[2]:
                    print(i+1, j+1, k+1)
                    print(l)
                    cnt += 1

    print(cnt)

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

if n <= 2:
    print(0)
else:
    cnt = 0

    for i in range(n):
        for j in range(i+1, n):
            for k in range(j+1, n):
                if li[i] == li[j] or li[j] == li[k] or li[i] == li[k]:
                    continue

                l = sorted([li[i], li[j], li[k]])

                if l[0] + l[1] > l[2]:
                    cnt += 1

    print(cnt)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(k+1,n):
      if l[i]!=l[j]!=l[k]:
        if l[i]+l[j]>l[k];
        ans+=1

print(ans)

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

print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
 a = int(input())
 p = list(map(int,input().split()))
 count = 0
 for i in range(a):
     for s in range(a):
         for t in range(a):
             if p[t]<p[s]<p[i] and p[t]+p[s]>p[i]:
                 count+=1
print(count)

a = int(input())
p = list(map(int,input().split()))
count = 0
 for i in range(a):
     for s in range(a):
         for t in range(a):
             if p[t]<p[s]<p[i] and p[t]+p[s]>p[i]:
                 count+=1
print(count)

a = int(input())
p = list(map(int,input().split()))
count = 0

for i in range(a):
     for s in range(a):
         for t in range(a):
             if p[t]<p[s]<p[i] and p[t]+p[s]>p[i]:
                 count+=1
print(count)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

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 and b != c:
    if a + b > c:
      count += 1
      
print(count)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
import numpy as np

def main():
    N = int(sys.stdin.readline().rstrip())
    L = [int(x) for x in sys.stdin.readline().rstrip().split()]
    L = np.array(L)
    # L.sort()
    # print(L)
    cnt = 0

    if N < 3:
        print(0)
        return


    for i in range(N - 2):
        for j in range(i+1, N - 1):
            for k in range(j+1, N):
                print((i+1, j+1, k+1), L[i], L[j], L[k])
                if L[i] == L[j] or L[j] == L[k] or L[k] == L[i]:
                    continue
                cnt += 1 if L[i] + L[j] > L[k] and L[k] + L[i] > L[j] and L[j] + L[k] > L[i]else 0

    print(cnt)


main()

import sys
import numpy as np

def main():
    N = int(sys.stdin.readline().rstrip())
    L = [int(x) for x in sys.stdin.readline().rstrip().split()]
    L = np.array(L)
    # L.sort()
    # print(L)
    cnt = 0

    if N < 3:
        print(0)
        return

    for i in range(N - 2):
        for j in range(i+1, N - 1):
            for k in range(j+1, N):
                # print((i+1, j+1, k+1), L[i], L[j], L[k])
                if L[i] == L[j] or L[j] == L[k] or L[k] == L[i]:
                    continue
                cnt += 1 if L[i] + L[j] > L[k] and L[k] + L[i] > L[j] and L[j] + L[k] > L[i]else 0

    print(cnt)


main()

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import collections

n=int(input())
l=list(map(int,input().split()))
c=collections.Counter(l)

c=sorted(c.items(),key=lambda x:x[0])

item=[]
num=[]

for i,n in c:
    item.append(i)
    num.append(n)
    
count=0

if n<3:
    print(0)
else:
    for i in range(len(item)-2):
        for j in range(i+1,len(item)-1):
            k=j+1
            sumij=item[i]+item[j]
            mulij=num[i]*num[j]
            while k<len(item) and item[k]<sumij:
                count+=mulij*num[k]
                k+=1
    print(count)

import collections

N=int(input())
l=list(map(int,input().split()))
c=collections.Counter(l)

c=sorted(c.items(),key=lambda x:x[0])

item=[]
num=[]

for i,n in c:
    item.append(i)
    num.append(n)
    
count=0

if N<3:
    print(0)
else:
    for i in range(len(item)-2):
        for j in range(i+1,len(item)-1):
            k=j+1
            sumij=item[i]+item[j]
            mulij=num[i]*num[j]
            while k<len(item) and item[k]<sumij:
                count+=mulij*num[k]
                k+=1
    print(count)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import itertools
 
N=int(input())
L=list(map(int,input().split()))
 
if len(L)<3:
    Lis=[]
    print(0)
elif Lis[0][0]==Lis[0][1] or Lis[0][0]==Lis[0][2] or Lis[0][1]==Lis[0][2]:
    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)

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

count=0

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

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:
            #if Lis[i][0]<bpc:
            count+=1
 
print(count)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
h = list(map(int,input().split()))

l = list(set(h))
a = []
for i in range(len(l)):
    a.append(h.count(l[i]))
ans = 0
for i in range(len(l)):
    for j in range(i+1, len(l)):
        for k in range(j +1, len(l)):
            if l[i] + l[j] > l[k]:
                ans += a[i] * a[j] * a[k]
print(ans)

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

l = list(set(h))
l.sort()
a = []
for i in range(len(l)):
    a.append(h.count(l[i]))
ans = 0
for i in range(len(l)):
    for j in range(i+1, len(l)):
        for k in range(j +1, len(l)):
            if l[i] + l[j] > l[k]:
                ans += a[i] * a[j] * a[k]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)


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

Verdicts: Runtime Error

Accepted