Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[]
pairs=[]
for i in range(N):
    a=int(input())
    A.append(a)
    pair=[]
    for j in range(a):
        x,y=map(int,input().split())
        pair.append([x-1,y])
    pairs.append(pair)

def judge(bit):
    for i in range(N):
        if bit&(1<<i)==False: #決め打ち時に不親切の場合
            continue
        for j in range(A[i]): #親切な人の発言検証
            tmpx=pairs[j][0][0]
            tmpy=pairs[j][0][1]
            if tmpy==1  and (bit&(1<<tmpx)==False):
                return False
            elif tmpy==0 and (bit&(1<<tmpx)):
                return False
    return True

ans=0
for bit in range((1<<N)):
    if judge(bit):
        count=0
        for i in range(N):
            if bit&(1<<i):
               count+=1
        ans=max(ans,count)

print(ans)

Fixed submission:
N=int(input())
A=[]
pairs=[]
for i in range(N):
    a=int(input())
    A.append(a)
    pair=[]
    for j in range(a):
        x,y=map(int,input().split())
        pair.append([x-1,y])
    pairs.append(pair)

def judge(bit):
    for i in range(N):
        if bit&(1<<i)==False: #決め打ち時に不親切の場合
            continue
        for j in range(A[i]): #親切な人の発言検証
            tmpx=pairs[i][j][0]
            tmpy=pairs[i][j][1]
            if tmpy==1  and (bit&(1<<tmpx)==False):
                return False
            if tmpy==0 and (bit&(1<<tmpx)):
                return False
    return True

ans=0
for bit in range((1<<N)):
    if judge(bit):
        count=0
        for i in range(N):
            if (bit&(1<<i)):
               count+=1
        ans=max(ans,count)

print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[]
pairs=[]
for i in range(N):
    a=int(input())
    A.append(a)
    pair=[]
    for j in range(a):
        x,y=map(int,input().split())
        pair.append([x-1,y])
    pairs.append(pair)

def judge(bit):
    for i in range(N):
        if bit&(1<<i)==False: #決め打ち時に不親切の場合
            continue
        for j in range(A[i]): #親切な人の発言検証
            tmpx=pairs[j][0][0]
            tmpy=pairs[j][0][1]
            if tmpy==1  and (bit&(1<<tmpx)==False):
                return False
            if tmpy==0 and (bit&(1<<tmpx)):
                return False
    return True

ans=0
for bit in range((1<<N)):
    if judge(bit)==True:
        count=0
        for i in range(N):
            if bit&(1<<i):
               count+=1
        ans=max(ans,count)

print(ans)

Fixed submission:
N=int(input())
A=[]
pairs=[]
for i in range(N):
    a=int(input())
    A.append(a)
    pair=[]
    for j in range(a):
        x,y=map(int,input().split())
        pair.append([x-1,y])
    pairs.append(pair)

def judge(bit):
    for i in range(N):
        if bit&(1<<i)==False: #決め打ち時に不親切の場合
            continue
        for j in range(A[i]): #親切な人の発言検証
            tmpx=pairs[i][j][0]
            tmpy=pairs[i][j][1]
            if tmpy==1  and (bit&(1<<tmpx)==False):
                return False
            if tmpy==0 and (bit&(1<<tmpx)):
                return False
    return True

ans=0
for bit in range((1<<N)):
    if judge(bit):
        count=0
        for i in range(N):
            if (bit&(1<<i)):
               count+=1
        ans=max(ans,count)

print(ans)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=[]
pairs=[]
for i in range(N):
    a=int(input())
    A.append(a)
    pair=[]
    for j in range(a):
        x,y=map(int,input().split())
        pair.append([x-1,y])
    pairs.append(pair)
print(pairs)
def judge(bit):
    for i in range(N):
        if bit&(1<<i)==False: #決め打ち時に不親切の場合
            continue
        for j in range(A[i]): #親切な人の発言検証
            tmpx=pairs[j][0][0]
            tmpy=pairs[j][0][1]
            if tmpy==1  and (bit&(1<<tmpx)==False):
                return False
            if tmpy==0 and (bit&(1<<tmpx)):
                return False
    return True

ans=0
for bit in range((1<<N)):
    if judge(bit)==True:
        count=0
        for i in range(N):
            if bit&(1<<i):
               count+=1
        ans=max(ans,count)

print(ans)

Fixed submission:
N=int(input())
A=[]
pairs=[]
for i in range(N):
    a=int(input())
    A.append(a)
    pair=[]
    for j in range(a):
        x,y=map(int,input().split())
        pair.append([x-1,y])
    pairs.append(pair)

def judge(bit):
    for i in range(N):
        if bit&(1<<i)==False: #決め打ち時に不親切の場合
            continue
        for j in range(A[i]): #親切な人の発言検証
            tmpx=pairs[i][j][0]
            tmpy=pairs[i][j][1]
            if tmpy==1  and (bit&(1<<tmpx)==False):
                return False
            if tmpy==0 and (bit&(1<<tmpx)):
                return False
    return True

ans=0
for bit in range((1<<N)):
    if judge(bit):
        count=0
        for i in range(N):
            if (bit&(1<<i)):
               count+=1
        ans=max(ans,count)

print(ans)