Buggy python submission (verdict: Time Limit Exceeded):
has_duplicates= lambda seq:len(seq) == len(set(seq))
def main():
    n=int(input())
    l=list(map(int,input().split()))
    tel=[-1,-1,-1]
    temp=0
    bn=0
    tc=0
    pc=0
    i=0
    while len(bin(i))-3<n:
        if str(bin(i)).count('1')==3:
            bn=bin(i)
            tc=0
            tel=[-1,-1,-1]
            for j in range(len(str(bn)[2:])):
                if (i>>j)&1:
                    tel[tc]=l[n-j-1]
                    tc+=1
            if has_duplicates(tel):
                tel.sort()
                if tel[0]+tel[1]>tel[2]:
                    pc+=1
        i+=1
    print(pc)
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n=int(input())
    l=list(map(int,input().split()))
    ans=0
    for i in range(n):
        for k in range(i+1,n):
            for j in range(k+1,n):
                temp=[l[i],l[k],l[j]]
                if len(set(temp))==len(temp):
                    temp.sort()
                    if temp[0]+temp[1]>temp[2]:
                        ans+=1
    print(ans)
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
has_duplicates= lambda seq:len(seq) == len(set(seq))
def main():
    n=int(input())
    l=list(map(int,input().split()))
    tel=[-1,-1,-1]
    temp=0
    bn=0
    tc=0
    pc=0
    i=0
    while len(bin(i))-3<n:
        if str(bin(i)).count('1')==3:
            bn=bin(i)
            tc=0
            tel=[-1,-1,-1]
            for j in range(len(str(bn)[2:])):
                if (i>>j)&1:
                    tel[tc]=l[n-j-1]
                    tc+=1
            if has_duplicates(tel):
                tel.sort()
                if abs(tel[1]-tel[2])<tel[0] and tel[0] < tel[1]+tel[2]:
                    pc+=1
        i+=1
    print(pc)
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n=int(input())
    l=list(map(int,input().split()))
    ans=0
    for i in range(n):
        for k in range(i+1,n):
            for j in range(k+1,n):
                temp=[l[i],l[k],l[j]]
                if len(set(temp))==len(temp):
                    temp.sort()
                    if temp[0]+temp[1]>temp[2]:
                        ans+=1
    print(ans)
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
has_duplicates= lambda seq:len(seq) == len(set(seq))
def main():
    n=int(input())
    l=list(map(int,input().split()))
    tel=[-1,-1,-1]
    temp=0
    bn=0
    tc=0
    pc=0
    i=0
    while len(bin(i))-3<n:
        bn=bin(i)
        if str(bn).count('1')==3:
            tc=0
            tel=[-1,-1,-1]
            for j in range(len(str(bn)[2:])):
                if (i>>j)&1:
                    tel[tc]=l[n-j-1]
                    tc+=1
            if has_duplicates(tel):
                tel.sort()
                if abs(tel[1]-tel[2])<tel[0] and tel[0] < tel[1]+tel[2]:
                    pc+=1
        i+=1
    print(pc)
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n=int(input())
    l=list(map(int,input().split()))
    ans=0
    for i in range(n):
        for k in range(i+1,n):
            for j in range(k+1,n):
                temp=[l[i],l[k],l[j]]
                if len(set(temp))==len(temp):
                    temp.sort()
                    if temp[0]+temp[1]>temp[2]:
                        ans+=1
    print(ans)
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def has_duplicates(seq):
    return len(seq) == len(set(seq))
def main():
    n=int(input())
    l=list(map(int,input().split()))
    tel=[-1,-1,-1]
    temp=0
    bn=0
    tc=0
    pc=0
    i=0
    while len(bin(i))-3<n:
        bn=bin(i)
        if str(bn).count('1')==3:
            tc=0
            tel=[-1,-1,-1]
            for j in range(len(str(bn)[2:])):
                if (i>>j)&1:
                    tel[tc]=l[n-j-1]
                    tc+=1
            if has_duplicates(tel):
                tel.sort()
                if abs(tel[1]-tel[2])<tel[0] and tel[0] < tel[1]+tel[2]:
                    pc+=1
        i+=1
    print(pc)
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n=int(input())
    l=list(map(int,input().split()))
    ans=0
    for i in range(n):
        for k in range(i+1,n):
            for j in range(k+1,n):
                temp=[l[i],l[k],l[j]]
                if len(set(temp))==len(temp):
                    temp.sort()
                    if temp[0]+temp[1]>temp[2]:
                        ans+=1
    print(ans)
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def has_duplicates(seq):
    return len(seq) == len(set(seq))
def main():
    n=int(input())
    l=list(map(int,input().split()))
    tel=[-1,-1,-1]
    temp=0
    bn=0
    tc=0
    pc=0
    i=0
    while len(bin(i))-3<n:
        bn=bin(i)
        if str(bn).count('1')==3:
            tc=0
            tel=[-1,-1,-1]
            for j in range(len(str(bn)[2:])):
                if (i>>j)&1:
                    tel[tc]=l[n-j-1]
                    tc+=1
            if has_duplicates(tel):
                tel.sort()
                if abs(tel[1]-tel[2])<tel[0] and tel[0] < tel[1]+tel[2]:
                    pc+=1
        i+=1
    print(pc)
if __name__ == "__main__":
    main()

Fixed submission:
def main():
    n=int(input())
    l=list(map(int,input().split()))
    ans=0
    for i in range(n):
        for k in range(i+1,n):
            for j in range(k+1,n):
                temp=[l[i],l[k],l[j]]
                if len(set(temp))==len(temp):
                    temp.sort()
                    if temp[0]+temp[1]>temp[2]:
                        ans+=1
    print(ans)
if __name__ == "__main__":
    main()