Buggy python submission (verdict: Runtime Error):
n = int(input())
XY = [[] for _ in range(n)]
for i in range(n):
    for j in range(int(input())):
        x, y = map(int, input().split())
        XY[i].append([x-1, y])
honest = 0
for bit in range(1<<n):
    flag = True 
    for i in range(n):
        if bit & (1<<i) :
            for a, b in XY[i]:
                if bit & (1<<a) != b:
                    flag = False 
                    break
    if flag:
        honest = max(honest, bin(i)[2:].count('1'))
print(ans)


Fixed submission:
n = int(input())
evidences = [[] for _ in range(n)]
for i in range(n):
    A = int(input())
    for _ in range(A):
        x, y = map(int, input().split())
        evidences[i].append((x-1, y))
result = 0
for i in range(1, 2**n):
    consistent = True 
    for j in range(n):
        if (i>>j) & 1 == 0:
            continue 
        for x, y in evidences[j]:
            if (i>>x)&1 != y:
                consistent = False 
                break
        if not consistent:
            break
    if consistent:
        result = max(result, bin(i)[2:].count('1'))
print(result)

Buggy python submission (verdict: Runtime Error):
#abc147c　HonestOrUnkind
from itertools import product 
n = int(input())
XY = [[] for _ in range(n)]
for i in range(n):
    for j in range(int(input())):
        x, y = map(int, input().split())
        XY[i].append([x-1, y])
honest = 0
for bit in range(1<<n):
    flag = True 
    for i in range(n):
        if bit & (1<<i) :
            for a, b in XY[i]:
                if bit & (1<<a) != b:
                    flag = False 
                    break
    if flag:
        hoenst = max(honest, bin(i)[2:].count('1'))
print(ans)


Fixed submission:
n = int(input())
evidences = [[] for _ in range(n)]
for i in range(n):
    A = int(input())
    for _ in range(A):
        x, y = map(int, input().split())
        evidences[i].append((x-1, y))
result = 0
for i in range(1, 2**n):
    consistent = True 
    for j in range(n):
        if (i>>j) & 1 == 0:
            continue 
        for x, y in evidences[j]:
            if (i>>x)&1 != y:
                consistent = False 
                break
        if not consistent:
            break
    if consistent:
        result = max(result, bin(i)[2:].count('1'))
print(result)

Buggy python submission (verdict: Runtime Error):
from itertools import product 
n = int(input())
XY = [[] for _ in range(n)]
for i in range(n):
    for j in range(int(input())):
        x, y = map(int, input().split())
        XY[i].append([x-1, y])
honest = 0
for bit in range(1<<n):
    flag = True 
    for i in range(n):
        if bit & (1<<i) :
            for a, b in XY[i]:
                if bit & (1<<a) != b:
                    flag = False 
                    break
    if flag:
        hoenst = max(honest, bin(i)[2:].count('1'))
        print(ans)
print(ans)

Fixed submission:
n = int(input())
evidences = [[] for _ in range(n)]
for i in range(n):
    A = int(input())
    for _ in range(A):
        x, y = map(int, input().split())
        evidences[i].append((x-1, y))
result = 0
for i in range(1, 2**n):
    consistent = True 
    for j in range(n):
        if (i>>j) & 1 == 0:
            continue 
        for x, y in evidences[j]:
            if (i>>x)&1 != y:
                consistent = False 
                break
        if not consistent:
            break
    if consistent:
        result = max(result, bin(i)[2:].count('1'))
print(result)