qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())
L = list(map(int, input().split()))
ans = 0

for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            if 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)

Fixed code:
N = int(input())
L = list(map(int, input().split()))
ans = 0

for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            if L[i] != L[j] and L[i] != L[k] and 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)
Buggy code:
n=int(input())
l=list(map(int,input().split()))
res=0
if n<=2 :
  print(0)
else:
	for i in range(n):
  		for j in range(i,n):
    		for k in range(j,n):
      			if l[i]!=l[j] and l[j]!=l[k] and (l[i]+l[j]>l[k]) and (l[i]+l[k]>l[j]) and (l[j]+l[k]>l[i]):
        		res+=1
print(res)

Fixed code:
n=int(input())
l=list(map(int,input().split()))
res=0
if n<=2:
	print(0)
else:
	for i in range(n):
		for j in range(i,n):
			for k in range(j,n):
				if (l[i]!=l[j]) and (l[j]!=l[k]) and (l[i]!=l[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)
Buggy code:
n = int(input())
print(n)
l = list(map(int,input().split()))


print(l)
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(l[t0],l[t1],l[t2])

print(res)


Fixed code:
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)
Buggy code:
N=int(input())
L=list(map(int,input().split()))
L.sort()

ans=0
for i in range(N-2):
    a=L[i]
    for j in range(i+1,N-1):
        b=L[j]
        if a==b:
            continue
        for k in range(j+1,N):
            c=L[i]
            if b==c:
                continue
            ans+=a+b>c

print(ans)


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

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

print(ans)
Buggy code:
N = int(input(""))
L = map(int, input("").split(" "))
L = sorted(L)

n = 0

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

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

n = 0

for i in range(0, len(L)):
    for j in range(i, len(L)):
        for k in range(j, len(L)):
            if L[i] + L[j] > L[k] and L[j] + L[k] > L[i] and L[k] + L[i] > L[j]:
                if L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
                    n += 1
print(n)
Buggy code:
n = int(input())
a = (int(x) for x in input().split())

b = list(a)
cnt = 0

for i in range(len(list(b))) :
        for j in range(len(list(b))) :
                for k in range(len(list(b))):
                        c = [i,j,k]
                        if len(c) == len(set(c)) :
                                d = [b[i],b[j],b[k]]
                                m = max(d) 
                                if m < sum(d) - m :
                                        cnt += 1
                                else :
                                        None
                        else :
                                None
                                
print(int(cnt/6))

Fixed code:
n = int(input())
a = (int(x) for x in input().split())

b = list(a)

cnt = 0

for i in range(len(b)) :
        for j in range(len(b)) :
                for k in range(len(b)):
                        c = [i,j,k]
                        if len(c) == len(set(c)) :
                                d = [b[i],b[j],b[k]]
                                m = max(d) 
                                if m < sum(d) - m and b[i] != b[j] and b[j] != b[k] and b[k] !=b[i]:
                                        cnt += 1
                                else :
                                        None
                        else :
                                None
                                
print(int(cnt/6))
Buggy code:
import itertools
num = int(input())
lis = list(map(int,input().split()))
tri = list(itertools.combinations(lis,3))
print(tri)
count = 0

for i in range(len(tri)):
    a = tri[i][0]
    b = tri[i][1]
    c = tri[i][2]
    if len(tri[i]) == len(set(tri[i])):
        if a+b > c and b+c > a and a+c > b:
            count += 1

print(count)

Fixed code:
import itertools
num = int(input())
lis = list(map(int,input().split()))
tri = list(itertools.combinations(lis,3))
count = 0

for i in range(len(tri)):
    a = tri[i][0]
    b = tri[i][1]
    c = tri[i][2]
    if len(tri[i]) == len(set(tri[i])):
        if a+b > c and b+c > a and a+c > b:
            count += 1

print(count)
Buggy code:
import itertools

n = int(input())

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

li = list(itertools.combinations(li, 3))

# print(li)
count = 0

for i in li:
    print(i)
    amari = sum(i) - max(i)
    if amari > max(i):
        if len(set(i)) == 3:
            count += 1

print(count)




Fixed code:
import itertools

n = int(input())

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

li = list(itertools.combinations(li, 3))

count = 0

for i in li:
    amari = sum(i) - max(i)
    if amari > max(i):
        if len(set(i)) == 3:
            count += 1

print(count)
Buggy code:
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)


Fixed code:
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)
Buggy code:
n=int(input())
r=list(map(int,input().split()))
t=0
for i in range(n):
  for j in range(i+1,n):
	for k in range(j+1,n):
      s=[r[i],r[j],r[k]]
      s.sort()
      if s[0]+s[1]>s[2]:t+=1
print(t)

Fixed code:
n=int(input())
r=list(map(int,input().split()))
t=0
for i in range(n):
	for j in range(i+1,n):
		for k in range(j+1,n):
			if r[i]==r[j] or r[j]==r[k] or r[i]==r[k]:continue
			s=[r[i],r[j],r[k]]
			s.sort()
			if s[0]+s[1]>s[2]:
				t+=1
print(t)
Buggy code:
N = int(input())
L_list = list(map(int,input().split()))


conter = 0

for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            if a==b or b==c or c==a or a+b<=c or b+c<=a or c+a<=b:
                continue
            counter += 1


print(counter)

Fixed code:
N = int(input())
L_list = list(map(int,input().split()))


counter = 0

for i in range(N-2):
    for j in range(i+1,N-1):
        for k in range(j+1,N):
            a = L_list[i]
            b = L_list[j]
            c = L_list[k]
            if a==b or b==c or c==a or a+b<=c or b+c<=a or c+a<=b:
                continue
            counter += 1


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

print(ans)

Fixed code:
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] and l[j]!=l[k]:
                    ans+=1

    print(ans)
Buggy code:
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)

Fixed code:
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//6)
Buggy code:
n=int(input())
l=list(map(int,input().split()))
count=0
for i in range (n-2):
    for j in range (i+1,n-1):
        if l[i]==l[j]:
            continue
        l[i]+l[j]
        for k in range (j+1,n):
            if l[k]<l[i]+l[j] and l[i]<l[j]+l[k] and l[j]<l[k]+l[i] :
                count+=1
print(count)
    


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

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

L.sort()
# print(input_L.sort())
length = len(L)
count = 0

# print(L)
if N <= 2:
    print("0")

else:
    for i in range(0, length - 2):
        for j in range(i + 1, length - 1):
            for k in range(j + 1, length):
                if (L[i] + L[j] > L[k] and L[i] != L[j] and L[j] != L[k] and L[k] != L[i]):
                    # print(i, j, k)
                    count += 1

print(count)


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

L.sort()
# print(input_L.sort())
length = len(L)
count = 0

# print(L)
if N <= 2:
    print("0")

else:
    for i in range(0, length - 2):
        for j in range(i + 1, length - 1):
            for k in range(j + 1, length):
                if (L[i] + L[j] > L[k] and L[i] != L[j] and L[j] != L[k] and L[k] != L[i]):
                    # print(i, j, k)
                    count += 1

    print(count)
Buggy code:
from itertools import combinations 

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

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

print(ans)


Fixed code:
from itertools import combinations 

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

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

print(ans)
Buggy code:
n = int(input())
l = list(map(int,input().split()))
count = 0
x = []
for i in range(len(l)-2):
    for j in range(i+1,len(l)-1):
        if l[i]!=l[j]:
            for k in range(j+1,len(l)):
                if l[i]!=l[k] and l[j]!=l[k]:
                    x.append([i+1,j+1,k+1])
                    
print(len(x))


Fixed code:
n = int(input())
l = list(map(int,input().split()))
count = 0
x = []
e = []
for i in range(len(l)-2):
    for j in range(i+1,len(l)-1):
        if l[i]!=l[j]:
            for k in range(j+1,len(l)):
                if l[i]!=l[k] and l[j]!=l[k]:
                    x.append([i+1,j+1,k+1])
                    e.append([l[i],l[j],l[k]])
count = 0           
for i in range(len(x)):
    e[i].sort()
    if e[i][0] + e[i][1] > e[i][2]:
        count +=1
print(count)
Buggy code:
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)

Fixed code:
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()
Buggy code:
n = int(input())
l = list(map(int,input().split()))

ans = 0

l.sort()

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] < l[k]:
                    ans += 1

print(ans)

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

l.sort()

ans = 0

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

print(ans)
Buggy code:
import itertools

n = int(input())
dt = input()
l = dt.split()
print(l)
count = 0
for team in itertools.combinations(l,3):
    team1 = list(team)
    for i in range(3):
        team1[i] = int(team1[i])
        
    if team1[0] != team1[1] and team1[1] != team1[2] and team1[0] != team1[2]:
        if team1[0] + team1[1] > team1[2] and team1[0] + team1[2] > team1[1] and team1[1] + team1[2] > team1[0]:
            count += 1

print(count)


Fixed code:
import itertools

n = int(input())
dt = input()
l = dt.split()
count = 0
for team in itertools.combinations(l,3):
    team1 = list(team)
    for i in range(3):
        team1[i] = int(team1[i])
        
    if team1[0] != team1[1] and team1[1] != team1[2] and team1[0] != team1[2]:
        if team1[0] + team1[1] > team1[2] and team1[0] + team1[2] > team1[1] and team1[1] + team1[2] > team1[0]:
            count += 1

print(count)
Buggy code:

def main():
    N = int(input())
    L = list(map(int, input().split()))
    ans = 0

    for i in range(N-2):
        for j in range(i+1, N-1):
            for k in range(j+1, N):
                a = L[i]
                b = L[j]
                c = L[k]
                if (a + b <= c) or (b + c <= a) or (c + a <= b):
                    continue
                if (a != b and b != c and c != a):
                    ans += 1
                    print(f"({i+1}, {j+1}, {k+1})")
    
    print(ans)


if __name__ == '__main__':
    main()

Fixed code:

def main():
    N = int(input())
    L = list(map(int, input().split()))
    ans = 0

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


if __name__ == '__main__':
    main()
Buggy code:
n = int(input())
l = map(int,input().split())
count = 0
if len(l) < 3:
  print(0)
  exit()
l = sorted(l)
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] > l[k]:
        count += 1
print(count)
    

Fixed code:
n = int(input())
l = list(map(int,input().split()))
if len(l) < 3:
  print(0)
  exit()
count = 0
l = sorted(l)
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] > l[k]:
        count += 1
print(count)
Buggy code:
n = int(input())
l = list(map(int,input().split()))
count = 0
for i in range(n-2):
  for j in range(i+1,n-1):
    for k in range(j+1,n):
      if l[i]!=l[j] and l[j]!=l[k] and l[k]!=l[i]:
        count+=1
print(count)

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


Fixed code:
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)
Buggy code:
N=int(input())
L=map(int,input().split())
L=list(L)
L_un=list(set(L))
Lunc=len(L_un)
b=0

for i in range(0,Lunc):
    for m in range(i+1,Lunc):
        for n in range(m+1,Lunc):
            if L_un[i]+L_un[m]>L_un[n] and L_un[m]+L_un[n]>L_un[i] and L_un[n]+L_un[i]>L_un[m]:
                c_i=L.count(L_un[i])
                c_m=L.count(L_un[m])
                c_n=L.count(L_un[n])
                
                print(L_un[i],c_i)
                print(L_un[m],c_m)
                print(L_un[n],c_n)
                
                b+=c_i*c_m*c_n

print(b)

Fixed code:
N=int(input())
L=map(int,input().split())
L=list(L)
L_un=list(set(L))
Lunc=len(L_un)
b=0

for i in range(0,Lunc):
    for m in range(i+1,Lunc):
        for n in range(m+1,Lunc):
            if L_un[i]+L_un[m]>L_un[n] and L_un[m]+L_un[n]>L_un[i] and L_un[n]+L_un[i]>L_un[m]:
                c_i=L.count(L_un[i])
                c_m=L.count(L_un[m])
                c_n=L.count(L_un[n])
                
                b+=c_i*c_m*c_n

print(b)
Buggy code:
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)

Fixed code:
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)
Buggy code:
N = int(input())
dic = {}
L = list(map(int, input().split()))
L.sort()
s = 0
for i in range(0, len (L)):
    for j in range(i+1 , len (L)):
        for k in range ( j+1 ,len(L)):
            if L[i] > k:
                s+=1
print (s)
                        



Fixed code:
N = int(input())
dic = {}
L = list(map(int, input().split()))
L.sort()
s = 0
for i in range(0, len (L)):
    for j in range(i+1 , len (L)):
        for k in range ( j+1 ,len(L)):
            if L[i]+L[j] > L[k] and L[i] != L[j] and L[j] != L[k] and L[i] != L[k] :
                s+=1
print (s)
Buggy code:
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:
                print(i+1, j+1, k+1)
                cnt += 1
print(cnt)

Fixed code:
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)
Buggy code:
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)

Fixed code:
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)
Buggy code:
n=int(input())
arr=list(map(int,input().split()))
arr.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(k+1,n):
      if arr[i]<arr[j] and arr[j]<arr[k]:
        if arr[i]+arr[j]>arr[k]:
          ans+=1
print(ans)

Fixed code:
n=int(input())
arr=list(map(int,input().split()))
arr.sort()
ans=0
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      if arr[i]<arr[j] and arr[j]<arr[k]:
        if arr[i]+arr[j]>arr[k]:
          ans+=1
print(ans)
Buggy code:
from itertools import combinations

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

ans = 0
for i, j, k in combinations(range(N),3):
  ell = sorted([L[i], L[j], L[k]])
  if ell[2] < ell[0] + ell[1] and ell[0] != ell[1]:
    ans += 1
print(ans)

Fixed code:
from itertools import combinations

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

ans = 0
for i, j, k in combinations(range(N),3):
  ell = sorted([L[i], L[j], L[k]])
  if ell[2] < ell[0] + ell[1] and len(set(ell)) == 3:
    ans += 1
print(ans)
Buggy code:
vn = int(input())
ll = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            a,b,c = ll[i], ll[j], ll[k]
            if a == b or b == c or c == a:
                continue
            vs = [a,b,c]
            vs.sort()
            if vs[0] + vs[1] > vs[2]: 
                cnt += 1
                # print(vs)

print(cnt)


Fixed code:
n = int(input())
ll = list(map(int, input().split()))
cnt = 0
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            a,b,c = ll[i], ll[j], ll[k]
            if a == b or b == c or c == a:
                continue
            vs = [a,b,c]
            vs.sort()
            if vs[0] + vs[1] > vs[2]: 
                cnt += 1
                # print(vs)

print(cnt)
Buggy code:
N=int(input())
L=list(map(int,input().split()))
count=0
0<=a<=N,0<=b<=N,0<=c<=N
for a in range(N):
    for b in range(N)
        for c in range(N)
        if L[a]>(L[b]+L[c]),L[b]>(L[a]+L[c]),L[c]>(L[b]+L[a]) a!=b, b!=c, c!=a:
            count=count+1
        else:
            continue
print(count)

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


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

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