Problem p02947 (python)

Fixed submission:
import math
import collections

n=int(input())
a=[list(input()) for i in range(n)]
b=[str(sorted(list(i))) for i in a]
count=list(collections.Counter(b).values())
count=[i for i in count if i>1]
print(int(sum([math.factorial(x)/(math.factorial(x-2)*2) for x in count])))

Buggy submission (verdict: Runtime Error):
n=int(input())
string_list=[input() for i in range(n)]
b=[i.sort() for i in strint_list]
g=0
for i  in b:
    g+=(l.count(i)-1)
print(int(g*0.5))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[list(input()) for i in range(n)]
b=[str(sorted(list(i))) for i in a]
count=list(collections.Counter(b).values())
count=[i for i in count if i>1]
print(int(sum([math.factorial(x)/(math.factorial(x-2)*2) for x in count])))

Buggy submission (verdict: Runtime Error):
import itertools
def list_difference(list1, list2):
    result = list1.copy()
    for value in list2:
        if value in result:
            result.remove(value)

    return len(result)


#n=int(input())
#a=[list(input()) for i in range(n)]
count=0
a=list(itertools.combinations(a,2))
for i in range(len(a)):
    if list_difference(a[i][0],a[i][1])==0:
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import itertools
def list_difference(list1, list2):
    result = list1.copy()
    for value in list2:
        if value in result:
            result.remove(value)

    return len(result)


#n=int(input())
#a=[list(input()) for i in range(n)]
count=0
a=list(itertools.permutations(a))
for i in range(len(a[1])):
    if list_difference(a[i][0],a[i][1])==0:
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import itertools
def list_difference(list1, list2):
    result = list1.copy()
    for value in list2:
        if value in result:
            result.remove(value)

    return len(result)


n=int(input())
a=[list(input()) for i in range(n)]
count=0
a=list(itertools.permutations(a))
for i in len(a):
    if list_difference(a[i][0],a[i][1])==0:
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[list(input()) for i in range(n)]
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        p=[col for col  in a[i] if col not in a[j]]
        if len(lst)==0:
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        lst = a[i].copy()
        for element in a[j]:
            try:
                lst.remove(element)
            except ValueError:
                pass
        if len(lst)==0:
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[list(input()) for i in range(n)]
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        for element in a[j]:
             try:
                    a[i].remove(element)
                    if len(a[i])==0:
                        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
def intersect_list(lst1, lst2):
    arr = []
    lst = lst1.copy()
    for element in lst2:
        try:
            lst.remove(element)
        except ValueError:
            pass
        else:
            arr.append(element)
    return len(arr)

n=int(input())
a=[input() for i in range(n)]
a=list(map(lambda x:list(x),a))
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if intersect_list(a[i],a[j])==len(len(a[i])):
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[input() for i in range(n)]
a=list(map(lambda x:list(x),a))
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if intersect_list(a[i],a[j])==len(col):
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[list(input()) for i in range(n)]
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if intersect_list(a[i],a[j])==len(col):
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(stdin.readline().rstrip())
a= [stdin.readline().rstrip() for _ in range(n)]
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if intersect_list(a[i],a[j])==len(col):
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n = int(stdin.readline().rstrip())
a= [stdin.readline().rstrip().split() for _ in range(n)]
count=0
for i in range(len(a)):
    for j in range(i+1,len(a)):
        if intersect_list(a[i],a[j])==len(col):
            count+=1
print(count)