ZhenlongDai/ACPR huggingface dataset:
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

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

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 len(set([l[i], l[j], l[k]])) == 3:
                print(i+1, j+1, k+1)
                count += 1
                
print(count)

Failing test case input:
6
4 5 6 3 3 5

Expected output:
12


Actual output:
1 3 4
1 3 5
1 3 6
1 4 6
1 5 6
2 3 4
2 3 5
2 3 6
2 4 6
2 5 6
3 4 6
3 5 6
12


Fixed submission (verdict: Accepted):
n = int(input())

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

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 len(set([l[i], l[j], l[k]])) == 3:
                
                count += 1
                
print(count)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
s = map(int,input().split())
cnt = 0
t = sorted(s)
 
for i in range(n):
    a = t[i]
    for j in range(i+1, n):
        b = t[j]
        for k in range(j+1, n):
            c = a + b
            if t[k] != c and a != b and b != t[k] and a != t[k]:
                cnt += 1
print(cnt)

Failing test case input:
10
9 11 14 2 9 11 7 6 7 8

Expected output:
66


Actual output:
86


Fixed submission (verdict: Accepted):
n = int(input())
s = map(int,input().split())
cnt = 0
t = sorted(s)
 
for i in range(n):
    a = t[i]
    for j in range(i+1, n):
        b = t[j]
        for k in range(j+1, n):
            c = a + b
            if t[k] < (a+b) and a < (b+t[k]) and b < (a+t[k]) and a != b and b != t[k] and a != t[k]:
                cnt += 1
print(cnt)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)


Failing test case input:
5
4 -1 0 7 5

Expected output:
1


Actual output:
6


Fixed submission (verdict: Accepted):
def factorial_cor(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact
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
Problem: p02583
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
import itertools as it

def li():
    return [int(x) for x in input().split()]

N = int(input())
L = li()


c = it.combinations(L, 3)
c_list = list(c)

cnt = 0
for l in c_list:
    unique_l = len(set(l))
    if unique_l != 3:
        continue
    sum_l = l[0] + l[1] + l[2]
    max_l = max(l)
    sum_lest = sum_l - max_l
    if sum_lest > max_l:
        print(l)
        cnt += 1

print(cnt)

Failing test case input:
10
16 4 3 1 2 12 13 1 13 0

Expected output:
11


Actual output:
(16, 4, 13)
(16, 4, 13)
(16, 12, 13)
(16, 12, 13)
(4, 3, 2)
(4, 12, 13)
(4, 12, 13)
(3, 12, 13)
(3, 12, 13)
(2, 12, 13)
(2, 12, 13)
11


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
import itertools as it

def li():
    return [int(x) for x in input().split()]

N = int(input())
L = li()


c = it.combinations(L, 3)
c_list = list(c)

cnt = 0
for l in c_list:
    unique_l = len(set(l))
    if unique_l != 3:
        continue
    sum_l = l[0] + l[1] + l[2]
    max_l = max(l)
    sum_lest = sum_l - max_l
    if sum_lest > max_l:
        cnt += 1

print(cnt)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
10
16 11 18 2 9 6 7 7 7 8

Expected output:
45


Actual output:
57


Fixed submission (verdict: Accepted):
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)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
l=list(map(int,input().split()))
ans=0
for a in l:
  for b in l:
    for c in l:
      if (a==b or b==c or a==c):
        continue
      if max([a,b,c])<a+b+c-max([a,b,c]):
        ans+=1
print(ans)

Failing test case input:
10
16 4 3 1 2 6 7 1 7 8

Expected output:
18


Actual output:
108


Fixed submission (verdict: Accepted):
n=int(input())
l=list(map(int,input().split()))
ans=0
for a in l:
  for b in l:
    for c in l:
      if (a==b or b==c or a==c):
        continue
      if max([a,b,c])<a+b+c-max([a,b,c]):
        ans+=1
print(ans
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
Ls = list(map(int,input().split()))
score=0
for i in range(0,N-2):
  a = Ls[i]
  for j in range(i+1, N-1):
      b = Ls[j]
      for k in range(j+1, N):
        c = Ls[k]
        if ((a+b>c)&(a+c>b)&(b+c>a)&(a!=b)&(a!=c)&(b!=c)):
          score+=1
          L_list=[i,j,k]
          print(L_list)
print(score)

Failing test case input:
10
9 7 22 2 9 6 10 6 6 8

Expected output:
42


Actual output:
[0, 1, 5]
[0, 1, 6]
[0, 1, 7]
[0, 1, 8]
[0, 1, 9]
[0, 3, 6]
[0, 3, 9]
[0, 5, 6]
[0, 5, 9]
[0, 6, 7]
[0, 6, 8]
[0, 6, 9]
[0, 7, 9]
[0, 8, 9]
[1, 3, 5]
[1, 3, 7]
[1, 3, 8]
[1, 3, 9]
[1, 4, 5]
[1, 4, 6]
[1, 4, 7]
[1, 4, 8]
[1, 4, 9]
[1, 5, 6]
[1, 5, 9]
[1, 6, 7]
[1, 6, 8]
[1, 6, 9]
[1, 7, 9]
[1, 8, 9]
[3, 4, 6]
[3, 4, 9]
[4, 5, 6]
[4, 5, 9]
[4, 6, 7]
[4, 6, 8]
[4, 6, 9]
[4, 7, 9]
[4, 8, 9]
[5, 6, 9]
[6, 7, 9]
[6, 8, 9]
42


Fixed submission (verdict: Accepted):
N=int(input())
Ls = list(map(int,input().split()))
score=0
for i in range(0,N-2):
  a = Ls[i]
  for j in range(i+1, N-1):
      b = Ls[j]
      for k in range(j+1, N):
        c = Ls[k]
        if ((a+b>c)&(a+c>b)&(b+c>a)&(a!=b)&(a!=c)&(b!=c)):
          score+=1

print(score)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
A.sort()
a=0
for i in range(0,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 A[i]+A[k]>A[j] and A[k]+A[j]>A[i]:
                a+=1
print(a)

Failing test case input:
10
16 4 3 1 2 6 7 1 7 8

Expected output:
18


Actual output:
25


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
A.sort()
a=0
for i in range(0,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 A[i]+A[k]>A[j] and A[k]+A[j]>A[i] and A[i]!=A[j] and A[k]!=A[j] and A[i]!=A[k]:
                a+=1
print(a)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import itertools
N = int(input())
L = list(map(int,input().split()))

ans = 0
if len(L) <= 2 :
    print(ans)
else:
    for lists in itertools.combinations(L,3):
        if sum(lists) - max(lists) > max(lists):
            if len(lists) != len(set(lists)):
                continue
            else:
                ans += 1


        else:
            continue

print(ans)

Failing test case input:
2
9 0

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
import itertools
N = int(input())
L = list(map(int,input().split()))

ans = 0
if len(L) <= 2 :
    print(ans)
else:
    for lists in itertools.combinations(L,3):
        if sum(lists) - max(lists) > max(lists):
            if len(lists) != len(set(lists)):
                continue
            else:
                ans += 1


        else:
            continue
    print(ans)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
L = list(map(int, input().split()))

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


Failing test case input:
10
9 7 22 2 9 6 10 6 7 8

Expected output:
48


Actual output:
56


Fixed submission (verdict: Accepted):
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[k] + L[i] > L[j]):
                ans += 1

print(ans

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())

L = map(int, input().split())
L = list(set(L))
L.sort()
ret = 0
N_ = len(L)
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 L[i] + L[j] < L[k]:
          ret += 1
print(ret)


Failing test case input:
10
16 4 3 1 2 6 7 7 7 8

Expected output:
25


Actual output:
38


Fixed submission (verdict: Accepted):
N = int(input())
 
L = list(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)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from itertools import combinations

n = int(input())
lst = list(map(int, input().split()))
comb = combinations(lst, 3)
count = 0
sett = set()

for i in comb:
  if i[0] + i[1] >= i[2] and i[1] + i[2] >= i[0] and i[0] + i[2] >= i[1]:
    sett.add(i)
    
print(len(sett))


Failing test case input:
10
16 4 3 1 2 6 7 1 13 0

Expected output:
8


Actual output:
19


Fixed submission (verdict: Accepted):
from itertools import combinations

n = int(input())
lst = list(map(int, input().split()))
comb = combinations(lst, 3)
count = 0

for i in comb:
  if i[0] != i[1] and i[1] != i[2] and i[0] != i[2]:
    if i[0] + i[1] > i[2] and i[1] + i[2] > i[0] and i[0] + i[2] > i[1]:
      count += 1
    
print(count)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))
cnt = 0
A.sort()
for i in range(0,N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      if (A[i]+A[j])>A[k] and (A[i]!=A[k]!=A[j]):
        cnt+=1
        
print(cnt)

Failing test case input:
10
9 4 8 1 9 6 10 6 6 8

Expected output:
48


Actual output:
67


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))
A.sort()
cnt = 0
for i in range(0,N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      if (A[i]!=A[j]!=A[k]):
        if (A[i]+A[j])>A[k]:
          cnt+=1
        
print(cnt)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)


Failing test case input:
10
16 13 3 2 1 12 10 1 17 0

Expected output:
15


Actual output:
90


Fixed submission (verdict: Accepted):
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)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
L=list(map(int,input().split()))
count=0
for a in range(N):
    for b in range(N):
        for c in range(N):
            if L[a]<(L[b]+L[c]) and L[b]<(L[a]+L[c]) and L[c]<(L[b]+L[a]) and a!=b and b!=c and c!=a:
                count=count+1
            else:
                continue
print(count)

Failing test case input:
6
1 8 8 0 12 1

Expected output:
0


Actual output:
18


Fixed submission (verdict: Accepted):
N=int(input())
L=list(map(int,input().split()))
count=0
for a in range(N):
    for b in range(N):
        for c in range(N):
            if L[a]<(L[b]+L[c]) and L[b]<(L[a]+L[c]) and L[c]<(L[b]+L[a]) and L[a]!=L[b] and L[a]!=L[c] and L[c]!=L[b] and a<b<c:
                count=count+1
            else:
                continue
print(count)

Problem: p02583
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
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)


Failing test case input:
10
16 7 3 2 2 12 10 1 17 0

Expected output:
13


Actual output:
14


Fixed submission (verdict: Accepted):
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):
      a,b,c = l[i],l[j],l[k]
      if a != b and b != c and a != c:
        ans+=max(a,b,c)<(b+c+a-max(a,b,c))
print(ans)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
x = int(input())
d = list(map(int, input().split()))
count = 0
if x < 3:
  print(0)
else:
  for i in range(len(d)):
    for j in range(i+1,len(d)):
      for k in range(j+1,len(d)):
        temp = []
        temp.extend([d[i],d[j],d[k]])
        temp.sort()
        if temp[0] + temp[1] > temp[2] and len(list(set(temp))) == 3:
          count += 1
print(count)

Failing test case input:
2
9 0

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
x = int(input())
d = list(map(int, input().split()))
count = 0
for i in range(len(d)):
  for j in range(i+1,len(d)):
    for k in range(j+1,len(d)):
      temp = []
      temp.extend([d[i],d[j],d[k]])
      temp.sort()
      if temp[0] + temp[1] > temp[2] and len(list(set(temp))) == 3:
        count += 1
print(count)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
10
16 4 3 1 2 6 7 7 7 8

Expected output:
25


Actual output:
58


Fixed submission (verdict: Accepted):
gross = int(input())
numbers = input().split()
numbers = list(map(int,numbers))
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)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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]:
                
                c += 1
print(c)

Failing test case input:
6
4 5 8 3 5 5

Expected output:
6


Actual output:
10


Fixed submission (verdict: Accepted):
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 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]:
                    
                    c += 1
print(c)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
ls = sorted(list(map(int, input().split())))
print(ls)
cnt = 0
for i in range(len(ls) - 2):
    a = ls[i]
    for j in range(i+1, len(ls) - 1):
        b = ls[j]
        for k in range(j+1, len(ls)):
            c = ls[k]
            if a==b or a==c or b==c:
                continue
            if a+b > c and b+c > a and c+a > b:
                cnt += 1
print(cnt)

Failing test case input:
5
1 -9 0 1 0

Expected output:
0


Actual output:
[-9, 0, 0, 1, 1]
0


Fixed submission (verdict: Accepted):
n = int(input())
ls = sorted(list(map(int, input().split())))
cnt = 0
for i in range(len(ls) - 2):
    a = ls[i]
    for j in range(i+1, len(ls) - 1):
        b = ls[j]
        for k in range(j+1, len(ls)):
            c = ls[k]
            if a==b or a==c or b==c:
                continue
            if a+b > c and b+c > a and c+a > b:
                cnt += 1
print(cnt)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
10
16 11 26 1 9 6 7 7 7 8

Expected output:
30


Actual output:
2 3 6
2 3 7
2 3 8
2 4 6
2 4 7
2 4 8
2 5 6
2 5 7
2 5 8
2 6 7
2 6 8
2 7 8
2 8 9
3 6 7
3 6 8
3 7 8
3 8 9
4 6 7
4 6 8
4 7 8
4 8 9
5 6 7
5 6 8
5 7 8
5 8 9
6 7 8
6 7 9
6 8 9
7 8 9
8 9 10
[1, 6, 7, 7, 7, 8, 9, 11, 16, 26]
30


Fixed submission (verdict: Accepted):
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]:
                    n += 1
print(n)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
lst=list(map(int,input().strip().split()))[:n]
count=0 
for i in range(0,n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if(lst[i]!=lst[j] and lst[j]!=lst[k] and lst[k]!=lst[i]):
                if(lst[i]+lst[j]>lst[k]):
                    count+=1 
print(count)

Failing test case input:
5
1 -8 0 1 -1

Expected output:
0


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
lst=list(map(int,input().strip().split()))[:n]
count=0 
for i in range(0,n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if(lst[i]!=lst[j] and lst[j]!=lst[k] and lst[k]!=lst[i]):
                if (lst[i] +lst[j] > lst[k] and 
                    lst[i] + lst[k] > lst[j] and 
                    lst[k] + lst[j] > lst[i]): 
                    count += 1
print(count)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
k = int(input())

an = input().split()

for i in range(len(an)):
    an[i] = int(an[i])

ln = sorted(an)

print(ln)

ans = 0

for i in range(k):
    for j in range(i,k):
        for l in range(j,k):
            a1 = int(ln[i])
            a2 = int(ln[j])
            a3 = int(ln[l])
            if a1!=a2 and a2 != a3:
                m = a1 + a2
                if a3 < m:
                    ans += 1

print(ans)

Failing test case input:
5
4 -1 0 7 5

Expected output:
1


Actual output:
[-1, 0, 4, 5, 7]
1


Fixed submission (verdict: Accepted):
k = int(input())

an = input().split()

for i in range(len(an)):
    an[i] = int(an[i])

ln = sorted(an)

ans = 0

for i in range(k):
    for j in range(i,k):    
        for l in range(j,k):
            a1 = int(ln[i])
            a2 = int(ln[j])
            a3 = int(ln[l])
            if a1!=a2 and a2 != a3:
                m = a1 + a2
                if a3 < m:
                    ans += 1

print(ans)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
10
9 11 18 2 9 11 7 7 7 8

Expected output:
39


Actual output:
73


Fixed submission (verdict: Accepted):
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)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
L=list(map(int, input().split()))
count=0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            L2=[L[i],L[j],L[k]]
            L2.sort()
            print(L2)
            if L2[0]+L2[1]>L2[2] and L2[0] != L2[1] and L2[1] != L2[2] and L2[2] != L2[0]:
                count+=1
                
print(count)


Failing test case input:
5
1 -8 0 1 0

Expected output:
0


Actual output:
[-8, 0, 1]
[-8, 1, 1]
[-8, 0, 1]
[0, 1, 1]
[0, 0, 1]
[0, 1, 1]
[-8, 0, 1]
[-8, 0, 0]
[-8, 0, 1]
[0, 0, 1]
0


Fixed submission (verdict: Accepted):
N=int(input())
L=list(map(int, input().split()))
count=0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            L2=[L[i],L[j],L[k]]
            L2.sort()
            if L2[0]+L2[1]>L2[2] and L2[0] != L2[1] and L2[1] != L2[2] and L2[2] != L2[0]:
                count+=1
                
print(count)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))
A.sort()
cnt = 0
for i in range(0,N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      if (A[i]+A[j])>A[k]:
        if (A[i]!=A[k]!=A[j]):
        	cnt+=1
        
print(cnt)

Failing test case input:
10
9 11 18 2 9 11 7 7 7 8

Expected output:
39


Actual output:
57


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))
A.sort()
cnt = 0
for i in range(0,N):
  for j in range(i+1,N):
    for k in range(j+1,N):
      if (A[i]!=A[j]!=A[k]):
        if (A[i]+A[j])>A[k]:
          cnt+=1
        
print(cnt)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
10
16 11 26 1 2 6 7 7 7 8

Expected output:
22


Actual output:
110


Fixed submission (verdict: Accepted):
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)

Problem: p02583
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
l = list(map(int, input().split()))
cnt = 0
for i in l:
    for j in l:
        for k in l:
            if i != j and i != k and j != k:
                cnt += 1
print(int(cnt/6))

Failing test case input:
6
1 8 8 0 17 3

Expected output:
0


Actual output:
16


Fixed submission (verdict: Accepted):
n = int(input())
l = list(map(int, input().split()))
cnt = 0
l.sort()
for i in l:
    for j in l:
        for k in l:
            if (i != j and i != k and j != k) and (i+j > k and j+k > i and k+i > j):
                cnt += 1
print(int(cnt/6))
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import itertools
n=int(input())
l=list(map(int,input().split()))

ans=0
for pair in itertools.combinations(l,3):
    pair=list(pair)
    pair.sort()
    print(pair)
    if pair[0]+pair[1]>pair[2]>abs(pair[0]-pair[1]) and pair[0]!=pair[1]!=pair[2]:
        ans+=1
print(ans)


Failing test case input:
10
9 7 16 1 9 6 10 6 6 8

Expected output:
40


Actual output:
[7, 9, 16]
[1, 7, 9]
[7, 9, 9]
[6, 7, 9]
[7, 9, 10]
[6, 7, 9]
[6, 7, 9]
[7, 8, 9]
[1, 9, 16]
[9, 9, 16]
[6, 9, 16]
[9, 10, 16]
[6, 9, 16]
[6, 9, 16]
[8, 9, 16]
[1, 9, 9]
[1, 6, 9]
[1, 9, 10]
[1, 6, 9]
[1, 6, 9]
[1, 8, 9]
[6, 9, 9]
[9, 9, 10]
[6, 9, 9]
[6, 9, 9]
[8, 9, 9]
[6, 9, 10]
[6, 6, 9]
[6, 6, 9]
[6, 8, 9]
[6, 9, 10]
[6, 9, 10]
[8, 9, 10]
[6, 6, 9]
[6, 8, 9]
[6, 8, 9]
[1, 7, 16]
[7, 9, 16]
[6, 7, 16]
[7, 10, 16]
[6, 7, 16]
[6, 7, 16]
[7, 8, 16]
[1, 7, 9]
[1, 6, 7]
[1, 7, 10]
[1, 6, 7]
[1, 6, 7]
[1, 7, 8]
[6, 7, 9]
[7, 9, 10]
[6, 7, 9]
[6, 7, 9]
[7, 8, 9]
[6, 7, 10]
[6, 6, 7]
[6, 6, 7]
[6, 7, 8]
[6, 7, 10]
[6, 7, 10]
[7, 8, 10]
[6, 6, 7]
[6, 7, 8]
[6, 7, 8]
[1, 9, 16]
[1, 6, 16]
[1, 10, 16]
[1, 6, 16]
[1, 6, 16]
[1, 8, 16]
[6, 9, 16]
[9, 10, 16]
[6, 9, 16]
[6, 9, 16]
[8, 9, 16]
[6, 10, 16]
[6, 6, 16]
[6, 6, 16]
[6, 8, 16]
[6, 10, 16]
[6, 10, 16]
[8, 10, 16]
[6, 6, 16]
[6, 8, 16]
[6, 8, 16]
[1, 6, 9]
[1, 9, 10]
[1, 6, 9]
[1, 6, 9]
[1, 8, 9]
[1, 6, 10]
[1, 6, 6]
[1, 6, 6]
[1, 6, 8]
[1, 6, 10]
[1, 6, 10]
[1, 8, 10]
[1, 6, 6]
[1, 6, 8]
[1, 6, 8]
[6, 9, 10]
[6, 6, 9]
[6, 6, 9]
[6, 8, 9]
[6, 9, 10]
[6, 9, 10]
[8, 9, 10]
[6, 6, 9]
[6, 8, 9]
[6, 8, 9]
[6, 6, 10]
[6, 6, 10]
[6, 8, 10]
[6, 6, 6]
[6, 6, 8]
[6, 6, 8]
[6, 6, 10]
[6, 8, 10]
[6, 8, 10]
[6, 6, 8]
40


Fixed submission (verdict: Accepted):
import itertools
n=int(input())
l=list(map(int,input().split()))

ans=0
for pair in itertools.combinations(l,3):
    pair=list(pair)
    pair.sort()
    
    if pair[0]+pair[1]>pair[2]>abs(pair[0]-pair[1]) and pair[0]!=pair[1]!=pair[2]:
        ans+=1
print(ans)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
5
4 -3 0 0 2

Expected output:
0


Actual output:
0 1 2
-3 0 0 nums
0 1 3
-3 0 2 nums
0 1 4
-3 0 4 nums
0 2 3
-3 0 2 nums
0 2 4
-3 0 4 nums
0 3 4
-3 2 4 nums
1 2 3
0 0 2 nums
1 2 4
0 0 4 nums
1 3 4
0 2 4 nums
2 3 4
0 2 4 nums
1


Fixed submission (verdict: Accepted):
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):
      if nums[x] != nums[y] and nums[x] != nums[z] and nums[y] != nums[z] and sides(nums[x],nums[y],nums[z]):
        res += 1
print(res)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
L = list(map(int, input().split()))
a = 0
if N > 2:
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or 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[j] + L[k] >= L[i]:
                    a = a + 1
print(a)

Failing test case input:
6
4 5 8 3 3 5

Expected output:
6


Actual output:
8


Fixed submission (verdict: Accepted):
N = int(input())
a = 0
if (N > 0):
  L = list(map(int, input().split()))
  if N > 2:
    for i in range(N):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] == L[j] or 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[j] + L[k] > L[i]:
                    a = a + 1
print(a)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
L = list(map(int, 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[k] != L[i]):
        if(L[i]+L[j] > L[k] and L[j]+L[k] > L[i] and L[k]+L[i] > L[j]):
          count += 1

          print(count)

Failing test case input:
6
1 5 7 11 12 1

Expected output:
3


Actual output:
1
2
3


Fixed submission (verdict: Accepted):
def solve():
    N = int(input())
    L = list(map(int, 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[k] != L[i]):
                    if(L[i]+L[j] > L[k] and L[j]+L[k] > L[i] and L[k]+L[i] > L[j]):
                        count += 1
 
    print(count)
 
if __name__ == "__main__":
    solve()

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)




Failing test case input:
6
1 8 8 0 17 3

Expected output:
0


Actual output:
[17, 8, 8, 3, 1, 0]
16


Fixed submission (verdict: Accepted):
n=int(input())
boulist=list(map(int,input().split()))
boulist.sort(reverse=True)

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

print(count)
Problem: p02583
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import bisect
import collections
n=int(input())
l=sorted(list(map(int,input().split())))
ma=l[-1]
d=collections.Counter(l)
ans=0
for i in range(1,ma-2):
  for j in range(i+1,ma-1):
    c=i+j
    for k in range(j+1,c):
      ans+=d[i]*d[j]*d[k]
print(ans)


Failing test case input:
10
16 7 3 2 2 12 10 1 17 0

Expected output:
13


Actual output:
7


Fixed submission (verdict: Accepted):
import bisect
import collections
n=int(input())
l=sorted(list(map(int,input().split())))
a=sorted(list(set(l)))
num=len(a)
d=collections.Counter(l)
ans=0
for i in range(num-2):
  for j in range(i+1,num-1):
    c=a[i]+a[j]
    K= bisect.bisect_left(a, c)
    for k in range(j+1,K):
      ans+=d[a[i]]*d[a[j]]*d[a[k]]
print(ans)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())

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

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

Failing test case input:
10
16 4 3 1 2 12 13 1 13 0

Expected output:
11


Actual output:
18


Fixed submission (verdict: Accepted):
n = int(input())

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

l.sort()
ans = 0

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

Problem: p02583
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
count=0
if n<3:
  print(count)
else:
  for i in range(n):
    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]:
          count=count
        elif l[i]<l[j]+l[k]:
          count+=1
print(count)


Failing test case input:
2
9 0

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
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[i]!=l[j]!=l[k]:
        count+=1
print(count)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import itertools
N=int(input())
LN=list(input().split(' '))
print(LN)
LN.sort()
LN_sort=list(dict.fromkeys(LN))
print(LN_sort)
cbn=list(itertools.combinations(LN_sort,3))
cnt=int(0)
for i in range(len(cbn)):
    if int(cbn[i][0])+int(cbn[i][1])>int(cbn[i][2]):
        cnt+=LN.count(cbn[i][0])*LN.count(cbn[i][1])*LN.count(cbn[i][2])

print(cnt)


Failing test case input:
6
4 5 8 3 3 5

Expected output:
6


Actual output:
['4', '5', '8', '3', '3', '5']
['3', '4', '5', '8']
6


Fixed submission (verdict: Accepted):
import itertools
N=int(input())
LN=list(input().split(' '))
LN.sort(key=int)
LN_sort=list(dict.fromkeys(LN))
cbn=list(itertools.combinations(LN_sort,3))
cnt=int(0)
for i in range(len(cbn)):
    if int(cbn[i][0])+int(cbn[i][1])>int(cbn[i][2]):
        cnt+=LN.count(cbn[i][0])*LN.count(cbn[i][1])*LN.count(cbn[i][2])

print(cnt)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import itertools
N=int(input())
LN=list(input().split(' '))
print(LN)
LN.sort(key=int)
LN_sort=list(dict.fromkeys(LN))
print(LN_sort)
cbn=list(itertools.combinations(LN_sort,3))
cnt=int(0)
for i in range(len(cbn)):
    if int(cbn[i][0])+int(cbn[i][1])>int(cbn[i][2]):
        cnt+=LN.count(cbn[i][0])*LN.count(cbn[i][1])*LN.count(cbn[i][2])

print(cnt)



Failing test case input:
10
9 11 22 2 9 6 7 6 7 8

Expected output:
46


Actual output:
['9', '11', '22', '2', '9', '6', '7', '6', '7', '8']
['2', '6', '7', '8', '9', '11', '22']
46


Fixed submission (verdict: Accepted):
import itertools
N=int(input())
LN=list(input().split(' '))
LN.sort(key=int)
LN_sort=list(dict.fromkeys(LN))
cbn=list(itertools.combinations(LN_sort,3))
cnt=int(0)
for i in range(len(cbn)):
    if int(cbn[i][0])+int(cbn[i][1])>int(cbn[i][2]):
        cnt+=LN.count(cbn[i][0])*LN.count(cbn[i][1])*LN.count(cbn[i][2])

print(cnt)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from pdb import main


def main():
    n = int(input())
    ls = sorted(list(map(int, input().split())))
    ans = 0

    if len(ls) < 3:
        return 0

    for i, li in enumerate(ls):
        for j, lj in enumerate(ls[i+1:]):
            if li == lj:
                continue
            for lk in ls[i+j+2:]:
                if lj == lk:
                    continue

                if li + lj > lk:
                    ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Failing test case input:
2
13 0

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    ls = sorted(list(map(int, input().split())))
    ans = 0

    for i, li in enumerate(ls):
        for j, lj in enumerate(ls[i+1:]):
            if li == lj:
                continue
            for lk in ls[i+j+2:]:
                if lj == lk:
                    continue

                if li + lj > lk:
                    ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)) 

Failing test case input:
6
4 5 8 3 5 5

Expected output:
6


Actual output:
16


Fixed submission (verdict: Accepted):
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] and b[i] != b[j] and b[j] != b[k]:
          d += 1
  print(str(d))
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    N = int(input())
    L = list(map(int, input().split()))
    L = sorted(L)
    print(L)
    count = 0

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

    print(count)


if __name__ == '__main__':
    main()

Failing test case input:
10
9 11 18 2 9 11 7 7 7 8

Expected output:
39


Actual output:
[2, 7, 7, 7, 8, 9, 9, 11, 11, 18]
39


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    L = list(map(int, input().split()))
    L = sorted(L)
    count = 0

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

    print(count)


if __name__ == '__main__':
    main()

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)
 

Failing test case input:
6
1 8 3 0 17 3

Expected output:
0


Actual output:
11


Fixed submission (verdict: Accepted):
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)

Problem: p02583
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
count=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 l[i]<l[j]+l[k] and l[i]!=l[j]!=l[k]:
          count+=1
print(count)


Failing test case input:
2
13 0

Expected output:
0


Actual output:
0
0


Fixed submission (verdict: Accepted):
n=int(input())
l=sorted(list(map(int,input().split())),reverse=True)
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[i]!=l[j]!=l[k]:
        count+=1
print(count)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
L = [int(e) for e in input().split()]
c = 0
 
if N >= 3:
  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[k] != L[i]:
          if L[i] != L[j] + L[k] and L[j] != L[k] + L[i] and L[k] != L[i] + L[j]:
            c += 1
print(c)

Failing test case input:
5
0 -8 0 1 -1

Expected output:
0


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
L = [int(e) for e in input().split()]
c = 0

if len(set(L)) >= 3:
  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[k] != L[i]:
          if L[i] < L[j] + L[k] and L[j] < L[k] + L[i] and L[k] < L[i] + L[j]:
            c += 1
print(c)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


import itertools
triangle = 0

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


for trio in itertools.combinations(L, 3):
    print(trio)
    if(trio[0] + trio[1] > trio[2]
    and trio[1] + trio[2] > trio[0]
    and trio[2] + trio[0] > trio[1]
    and trio[0] != trio[1] 
    and trio[1] != trio[2] 
    and trio[0] != trio[2]):
        triangle += 1

print(triangle)

Failing test case input:
10
16 4 3 1 2 6 7 1 13 0

Expected output:
8


Actual output:
(16, 4, 3)
(16, 4, 1)
(16, 4, 2)
(16, 4, 6)
(16, 4, 7)
(16, 4, 1)
(16, 4, 13)
(16, 4, 0)
(16, 3, 1)
(16, 3, 2)
(16, 3, 6)
(16, 3, 7)
(16, 3, 1)
(16, 3, 13)
(16, 3, 0)
(16, 1, 2)
(16, 1, 6)
(16, 1, 7)
(16, 1, 1)
(16, 1, 13)
(16, 1, 0)
(16, 2, 6)
(16, 2, 7)
(16, 2, 1)
(16, 2, 13)
(16, 2, 0)
(16, 6, 7)
(16, 6, 1)
(16, 6, 13)
(16, 6, 0)
(16, 7, 1)
(16, 7, 13)
(16, 7, 0)
(16, 1, 13)
(16, 1, 0)
(16, 13, 0)
(4, 3, 1)
(4, 3, 2)
(4, 3, 6)
(4, 3, 7)
(4, 3, 1)
(4, 3, 13)
(4, 3, 0)
(4, 1, 2)
(4, 1, 6)
(4, 1, 7)
(4, 1, 1)
(4, 1, 13)
(4, 1, 0)
(4, 2, 6)
(4, 2, 7)
(4, 2, 1)
(4, 2, 13)
(4, 2, 0)
(4, 6, 7)
(4, 6, 1)
(4, 6, 13)
(4, 6, 0)
(4, 7, 1)
(4, 7, 13)
(4, 7, 0)
(4, 1, 13)
(4, 1, 0)
(4, 13, 0)
(3, 1, 2)
(3, 1, 6)
(3, 1, 7)
(3, 1, 1)
(3, 1, 13)
(3, 1, 0)
(3, 2, 6)
(3, 2, 7)
(3, 2, 1)
(3, 2, 13)
(3, 2, 0)
(3, 6, 7)
(3, 6, 1)
(3, 6, 13)
(3, 6, 0)
(3, 7, 1)
(3, 7, 13)
(3, 7, 0)
(3, 1, 13)
(3, 1, 0)
(3, 13, 0)
(1, 2, 6)
(1, 2, 7)
(1, 2, 1)
(1, 2, 13)
(1, 2, 0)
(1, 6, 7)
(1, 6, 1)
(1, 6, 13)
(1, 6, 0)
(1, 7, 1)
(1, 7, 13)
(1, 7, 0)
(1, 1, 13)
(1, 1, 0)
(1, 13, 0)
(2, 6, 7)
(2, 6, 1)
(2, 6, 13)
(2, 6, 0)
(2, 7, 1)
(2, 7, 13)
(2, 7, 0)
(2, 1, 13)
(2, 1, 0)
(2, 13, 0)
(6, 7, 1)
(6, 7, 13)
(6, 7, 0)
(6, 1, 13)
(6, 1, 0)
(6, 13, 0)
(7, 1, 13)
(7, 1, 0)
(7, 13, 0)
(1, 13, 0)
8


Fixed submission (verdict: Accepted):


import itertools
triangle = 0

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


for trio in itertools.combinations(L, 3):
    if(trio[0] + trio[1] > trio[2]
    and trio[1] + trio[2] > trio[0]
    and trio[2] + trio[0] > trio[1]
    and trio[0] != trio[1] 
    and trio[1] != trio[2] 
    and trio[0] != trio[2]):
        triangle += 1

print(triangle)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
6
4 5 8 3 5 5

Expected output:
6


Actual output:
9


Fixed submission (verdict: Accepted):
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)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from itertools import combinations

N = int(input())
L = [int(_) for _ in input().split()]

count = 0
for li, lj, lk in combinations(L, 3):
  if li == lj or li == lk or lj == lk:
    continue
  if li + lj > lk or li + lk > lj or lj + lk > li:
    count += 1
print(count)

Failing test case input:
10
9 11 22 2 9 6 7 6 7 8

Expected output:
46


Actual output:
96


Fixed submission (verdict: Accepted):
from itertools import combinations

N = int(input())
L = [int(_) for _ in input().split()]

count = 0
for li, lj, lk in combinations(L, 3):
  if li == lj or lj == lk or lk == li:
    continue
  tmp = sorted([li, lj, lk],reverse=True)
  if tmp[1] + tmp[2] >tmp[0]:
    count += 1
print(count)

Problem: p02583
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())
s=list(map(int,input().split()))
s.sort()
ans=0
for i in range(n):
  for j in range(n):
    if s[i]<s[j]:
      for k in range(n):
        if s[j]<s[k] and s[i]+s[j]<s[k]:
          ans+=1
print(ans)

Failing test case input:
5
4 0 3 7 5

Expected output:
3


Actual output:
6


Fixed submission (verdict: Accepted):


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

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
L = list(map(int,input().split()))

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

Failing test case input:
6
1 8 7 0 12 1

Expected output:
1


Actual output:
6


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

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
print(n)
l = list(map(int,input().split()))

res = 0
for t0 in range(0,len(l)-2):
    for t1 in range(t0+1,len(l)-1):
        for t2 in range(t1+1,len(l)):

             if (l[t0] + l[t1] > l[t2] and l[t0] + l[t2] > l[t1] and l[t1] + l[t2] > l[t0] and l[t0]!=l[t1] and l[t1]!=l[t2] and l[t0]!=l[t2]):
                 res += 1        

print(res)


Failing test case input:
10
9 7 13 2 9 6 10 6 6 8

Expected output:
63


Actual output:
10
63


Fixed submission (verdict: Accepted):
n = int(input())
l = list(map(int,input().split()))

res = 0
for t0 in range(0,len(l)-2):
    for t1 in range(t0+1,len(l)-1):
        for t2 in range(t1+1,len(l)):

             if (l[t0] + l[t1] > l[t2] and l[t0] + l[t2] > l[t1] and l[t1] + l[t2] > l[t0] and l[t0]!=l[t1] and l[t1]!=l[t2] and l[t0]!=l[t2]):
                 res += 1

print(res)
Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
l=list(map(int,input().split()))
l.sort(reverse=True)
d=dict()
for i in l:
  if i in d:
    d[i]+=1
  else:
    d[i]=1

li=list(d.keys())  
ans=0
for i in range(len(li)-1,0,-1):
  a,b=0,i-1
  while(a<b):
    if li[a]+li[b]>li[i]:
      
      ans+=d[li[a]]*d[li[b]]*d[li[i]]
      ans+=b-1
      b-=1
    else:
      a+=1
print(ans)

Failing test case input:
5
1 -8 1 1 -1

Expected output:
0


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
l=list(map(int,input().split()))
l.sort()
d=dict()
for i in l:
  if i in d:
    d[i]+=1
  else:
    d[i]=1

li=list(d.keys()) 
ans=0
for i in range(len(li)-1,0,-1):
  a,b=0,i-1
  while(a<b):
    if li[a]+li[b]>li[i]:
      
      for kk in range(a,b):
      	ans+=d[li[kk]]*d[li[b]]*d[li[i]]
      b-=1
    else:
      a+=1
print(ans)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
10
9 4 16 1 9 6 10 6 6 8

Expected output:
36


Actual output:
36.0


Fixed submission (verdict: Accepted):
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))

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import itertools

n = int(input())
nums = list(map(int,input().split()))
count= 0
for i, j, k in itertools.combinations(nums, 3):
    I = i**2
    J = j **2
    K = k **2
    if I == J + K:
        count += 1
    elif J == I + K:
        count += 1
    elif K == I + J:
        count += 1
                    
print(count)

Failing test case input:
10
16 4 3 2 2 12 13 1 13 0

Expected output:
14


Actual output:
2


Fixed submission (verdict: Accepted):
import itertools

n = int(input())
nums = list(map(int, input().split()))
count = 0
for i, j, k in itertools.combinations(nums, 3):
    if i != j and i != k and j != k:
        L = [i, j, k]
        L = sorted(L)
        if L[2] < L[0] + L[1]:
            count += 1


print(count)

Problem: p02583
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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 != k:
        if (L[i] + L[j] > L[k]) and (L[j] + L[k] > L[i]) and (L[k] + L[i] > L[j]):
          ans += 1
         
print(ans)


Failing test case input:
5
1 -8 1 1 -1

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
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[k] + L[i] > L[j]):
                ans += 1

print(ans