TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
l = list(map(int,input().split()))
ans = 0

for i in l:
  ans = ans + i

print(ans)

l = list(map(int,input().split()))
ans = 'bust'
a = 0
 
for i in l:
  a = a + i
 
if a < 22:
  ans = 'win'

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a = map(int, input())
if sum(a) >= 22:
  print('bust')
else:
  print('win')

a, b, c = map(int, input().split())
if a + b + c >= 22:
  print('bust')
else:
  print('win')

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
A1, A2, A3 = map(input().split(), int)

print('win' if A1+A2+A3 <= 21 else 'bust')

A1, A2, A3 = map(int, input().split())
 
print('win' if A1+A2+A3 <= 21 else 'bust')

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
 A, B, C = map(int, input().split())

if A + B + C >= 22:
    print('bust')
else:
    print('win')

 
A, B, C = map(int, input().split())
val = A + B + C
if val >= 22:
    print('bust')
else:
    print('win')


Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):

a1 = int(input())
a2 = int(input())
a3 = int(input())


result = a1 + a2 + a3
if result >= 22:
    print("bust")
else:
    print("win")


a = input().split()
# print(a)

result = int(a[0]) + int(a[1]) + int(a[2])
if result >= 22:
    print("bust")
else:
    print("win")

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a,s,d=map(int,input().split())
print("bust" if sum([a,s,d])<=22 else "win")

a,s,d=map(int,input().split())
print("bust" if sum([a,s,d])>=22 else "win")


Verdicts: Wrong Answer

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
A,B,C = map(lambda x: int(x),input().split())
if A+B+C >21:
  print("bust")
else:
  orint("win")

A,B,C = map(lambda x: int(x),input().split())
if A+B+C >21:
  print("bust")
else:
  print("win")


Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
A1, A2, A3 = map(int, input().split())
if A1 + A2 + A3 >= 22:
  print('bust')
else;
  print('win')


A1, A2, A3 = map(int, input().split())
if A1 + A2 + A3 >= 22:
  print('bust')
else:
  print('win')


Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
#ABC147
a = [map(int,input().split())]
print("bust" if sum(a)>=22 else "win")

#ABC147
a = list(map(int,input().split()))
print("bust" if sum(a)>=22 else "win")

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
sum = 0
for num range(3):
  num = input()
  sum += int(num)
 if sum >= 22:
  print("bust")
 else:
  print("win")

a , b , c  = map(int , (input().split()))
sum = a + b + c
if sum >= 22:
    print("bust")
else:
    print("win")

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
A, B, C = map(int, input().split())

if A + B + C<=22:
	print("bust")
else:
	print("win")

A, B, C = map(int, input().split())

if sum(A, B, C)<=22:
	print("bust")
else:
	print("win")

A, B, C = map(int, input().split())

if A + B + C>=22:
	print("bust")
else:
	print("win")

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
in = list(map(int, input().split()))
s = sum(in)
if s>21:
  print('burst')
else:
  print('win')

nums = [int(e) for e in input().split()]

s = sum(nums)
if s>21:
  print('bust')
else:
  print('win')

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a, b, c = map(int, input().split())
ig a + b + c >= 22:
  print("bust")
else:
  print("win")

a, b, c = map(int, input().split())
if a + b + c >= 22:
  print("bust")
else:
  print("win")


Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
X=int(input())
Y=int(input())
Z=int(input())

if(X+Y+Z>=22):
    print("bust")
else:
    print("win")

X=int(input())
Y=int(input())
Z=int(input())

if(X+Y+Z>=22):
    print("bust")
else:
    print("win")

X,Y,Z = map(int,input().split())

if(X+Y+Z>=22):
    print("bust")
else:
    print("win")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a1, a2, a3 = map(int, input())
if a1+a2+a3 >= 22:
    print('bust')
else:
    print('win')

a1, a2, a3 = map(int, input().split())
if a1+a2+a3 >= 22:
    print('bust')
else:
    print('win')

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
import numpy as np

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

p = len(format(max(A), 'b'))
digit = ['0' + str(p) + 'b'] * N
S = list(map(format, A, digit))
X = np.array([[int(c) for c in s] for s in S])
#print(X)
r = np.sum(X, 0)
#print(r)
r = r * (N - r)
#print(r)

res = 0
for j in range(p):
  res += r[j] * (2 ** (p-1-j))

print(res % (10**9 + 7))

a1, a2, a3 = map(int, input().split())
if a1 + a2 + a3 >= 22:
  print('bust')
else:
  print('win')

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):

if __name__ == "__main__":
    A_s = input().split()
    A_i = [int(s) for s in A_s]
    print(A_i)
    ret = sum(A_i)
    if ret > 21:
        print("bust")
    else:
        print("win")
    exit(0)


if __name__ == "__main__":
    A_s = input().split()
    A_i = [int(s) for s in A_s]
    ret = sum(A_i)
    if ret > 21:
        print("bust")
    else:
        print("win")
    exit(0)


Verdicts: Wrong Answer

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a1, a2, a3 = int(input().split())

if a1+a2+a3 >= 22:
    print("bust")
else:
    print("win")


a1, a2, a3 = (int(x) for x in input().split())

if a1+a2+a3 >= 22:
    print("bust")
else:
    print("win")

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a = list(int,input().split())
if sum(a) >= 22:
  print('bust')
else:
  print('win')

a = list(map(int,input().split()))
if sum(a) >= 22:
  print('bust')
else:
  print('win')

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
A1 = int(input('Input A1:'))
A2 = int(input('Input A2:'))
A3 = int(input('Input A3:'))
if (A1+A2+A3) >= 22:
    print('bust')
else:
    print('win')

def blackjack(A1, A2, A3):
    if (A1+A2+A3) >= 22:
        return "bust"
    else:
        return "win"

A1 = int(input('Input A1:'))
A2 = int(input('Input A2:'))
A3 = int(input('Input A3:'))
if (A1+A2+A3) >= 22:
    print('bust')
else:
    print('win')


def blackjack(a, b, c):
    if (a+b+c) >= 22:
        return "bust"
    else:
        return "win"

A1 = int(input('Input A1:'))
A2 = int(input('Input A2:'))
A3 = int(input('Input A3:'))
print(blackjack(A1, A2, A3))


def blackjack(A1, A2, A3):
    if (A1+A2+A3) >= 22:
        return "bust"
    else:
        return "win"

A1 = int(input('Input A1:'))
A2 = int(input('Input A2:'))
A3 = int(input('Input A3:'))
print(blackjack(A1, A2, A3))

print("bust") if sum(map(int,input().split(" "))) >= 22 else print('win')

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a,b,c = stdin.readline().rstrip().split()
if a+b+c >= 22:
	print('bust')
else:
	print('win')

a,b,c = stdin.readline().rstrip().split()
if a+b+c >= 22:
  print('bust')
else:
  print('win')

from sys import stdin
a, b, c = [int(x) for x in stdin.readline().rstrip().split()]
if a+b+c >= 22:
  print('bust')
else:
  print('win')

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
x = int(input())
y = int(input())
z = int(input())
point = x + y + z

if point <= 21:
  print("win")

else:
  print("bust")

x , y, z = map(int,input().split(" "))

point = x + y + z

if point <= 21:print("win")

else: print("bust")

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
A: a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")

a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
def main():
	a,b,c = map(int,input().split())
	if a + b + c >= 22:
    	print('bust')
	else:
    	print('win')
main()

def main():
  a,b,c = map(int,input().split())
  if a + b + c >= 22:
      print('bust')
  else:
      print('win')
main()

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a,b,c=int(input())
if a+b+c<=21:
  print("win")
else:
  print("bust")

a,b,c=map(int,input().split())
if a+b+c<=21:
  print("win")
else:
  print("bust")

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
A1 = input()
A2 = input()
A3 = input()

if A1 + A2 + A3 < 22:
    print('win')
else :
    print('bust')


A1,A2,A3 = (int(x) for x in input().split())
if A1 + A2 + A3 < 22:
    print('win')
else :
    print('bust')


Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a1 = int(input())
a2 - int(input())
a3 = int(input())

x = a1 + a2 + a3

if x >= 22 :
  print("bust")
  
else :
  print("win")

a1 = int(input())
a2 = int(input())
a3 = int(input())

x = a1 + a2 + a3

if x >= 22 :
  print("bust")
  
else :
  print("win")


a1, a2, a3 = map(int,input().split())
 
x = a1 + a2 + a3
 
if x >= 22 :
  print("bust")
  
else :
  print("win")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a, b, c = input().split()

if a + b + c >= 22:
  print('bust')
else:
  print('win')

a, b, c = input().split()

if int(a) + int(b) + int(c) >= 22:
  print('bust')
else:
  print('win')

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
res: str = 'bust' if sum([int(x) for x in input().split(' ')]) >= 22 else 'win')
  
print(res)

print('bust' if sum([int(x) for x in input().split(' ')]) >= 22 else 'win')
  



Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
# -*- coding: utf-8 -*-

a, b, c = map(int, input().split())
d = a+b+c

if d >= 22:
  print('bust')
else:
  print('win)

# -*- coding: utf-8 -*-

a, b, c = map(int, input().split())
d = a+b+c

if d >= 22:
  print('bust')
else:
  print('win')


Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a,b,c = map(int,input().split())

if sum(a,b,c) >= 22:
    print('bust')
else:
    print('win')

a,b,c = map(int,input().split())

if a + b + c >= 22:
    print('bust')
else:
    print('win')


Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
li = list(map(int,input().split()))
if sum(li) <22:
  print('win')
  else:
    print('bust')

li = list(map(int,input().split()))
if sum(li) <22:
  print('win')
else:
  print('bust')

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
A1, A2, A3= map(int, input().split())
sum=A1+A2+A3
if sum>=22:
    print(“bust”)
else:
    print(“win”)

A1, A2, A3= map(int, input().split())
sum=A1+A2+A3
if sum>=22:
    print('bust')
else:
    print('win')

Verdicts: Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
values = input()
values = [int(x) for x in values]
 
sum = 0
 
for val in values:
  sum += val
  
if sum >= 22:
  print("bust")
else:
  print("win")

values = input()
values = [int(x) for x in values]

sum = 0

for val in values:
  sum += val
  
if val >= 22:
  print("bust")
else:
  print("win")

values = input().split()
values = [int(x) for x in values]

sum = 0

for val in values:
    sum += val

if sum >= 22:
    print("bust")
else:
    print("win")


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
word = list(input())

count = 0  

if len(word) % 2 == 0:  
  for i in range(0,int(len(word)/2)):
    if word[i] != word[int(len(word))-1-i]:
      count += 1
  print(count)

else:
  for j in range(0,int((len(word)+1)/2-1)):
    if word[j] != word[int(len(word))-1-j]:
      count += 1            
  print(count)


nums = input().split(" ")
sum = int(nums[0]) + int(nums[1]) + int(nums[2])
if sum >= 22:
	print("bust")
else:
	print("win")


Verdicts: Wrong Answer

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
a,b,c = map(int,input().split())
if a+b+c>=k22:
  print('bust')
else:
  print('win')

a=int(input())
b=int(input())
c=int(input())
if a+b+c>22:
  print('bust')
else:
  print('win')

a,b,c = map(int,input().split())
if a+b+c=>22:
  print('bust')
else:
  print('win')

a,b,c = map(int,input().split())
if a+b+c=>22:
  print('bust')
else:
  print('win')

a,b,c = map(int,input().split())
if a+b+c>=22:
  print('bust')
else:
  print('win')

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
(A, B, C) = map(input().split(), int)

if A + B + C >= 22:
  print("bust")
else:
  print("win")

(A, B, C) = int(input().split())

if A + B + C >= 22:
  print("bust")
else:
  print("win")

(A, B, C) = map(int, input().split())

if A + B + C >= 22:
  print("bust")
else:
  print("win")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
A1=int(input())
A2= int(input())
A3= int(input())
if(A1+A2+A3>=22):
    print("bust")
else:
    print("win")

A1 = int(input())
A2 = int(input())
A3 = int(input())
sum  = A1+A2+A3
if(sum>=22):
    print("bust")
else:
    print("win")

a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Given are three integers A_1, A_2, and A_3.  If A_1+A_2+A_3 is greater than or equal to 22, print `bust`; otherwise, print `win`.

Submission attempts (in order):
ans = A1+A2+A3

if ans >= 22:
     print ("bust")

else:
     print ("win")

import random

A1 = random.randint(1,13)
A2 = random.randint(1,13)
A3 = random.randint(1,13)

ans = A1+A2+A3

if ans >= 22:
     print ("bust")

else:
     print ("win")

A1,A2,A3=map(int,input().split())
ans =(A1+A2+A3)

if ans >= 22:
     print ("bust")
else:
     print ("win")

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
n = int(input())
A = []
X = []
for i in range(n):
    a = int(input())
    A.append(a)
    lis = []
    for j in range(a):
        lis.append(list(map(int, input().split())))
    X.append(lis)

ans = 0
for i in range(2 ** n):
    H_lis = [0 for i in range(n)]
    for j in range(n):
        if ((i >> j) & 1):
            H_lis[j] = 1
    flag = True
    j = 0
    while j < n and flag:
        if H_lis[j] == 1:
            for k in range(A[k]):
                if X[j][k][1] != H_lis[X[j][k][0] - 1]:
                    flag = False
                    break
        j += 1
    if flag:
        ans = max(ans, H_lis.count(1))
print(ans)

n = int(input())
A = []
X = []
for i in range(n):
    a = int(input())
    A.append(a)
    lis = []
    for j in range(a):
        lis.append(list(map(int, input().split())))
    X.append(lis)

ans = 0
for i in range(2 ** n):
    H_lis = [0 for i in range(n)]
    for j in range(n):
        if ((i >> j) & 1):
            H_lis[j] = 1
    flag = True
    j = 0
    while j < n and flag:
        if H_lis[j] == 1:
            for k in range(A[j]):
                if X[j][k][1] != H_lis[X[j][k][0] - 1]:
                    flag = False
                    break
        j += 1
    if flag:
        ans = max(ans, H_lis.count(1))
print(ans)

Verdicts: Runtime Error

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
def popcount(x):
  r, q = 0, x
  while x:
    r += 1
    x &= x - 1
  return r, q
 
n = int(input())
r = range(n)
a = [[0, 0] for _ in r]
for i in r:
  for _ in range(int(input())):
    x, y = map(int, input().split())
    a[i][y] |= 1 << (x - 1)
l = (1 << n) - 1 
b = sorted(map(popcount, range(1, l + 1)))
ans = next((i for i, x in reversed(b)
           if all(a[j][0] & x == a[j][1] & l - x == 0 for j in r if x >> j & 1), 0) 
print(ans)


from itertools import combinations

n = int(input())
r = range(n)
a = [([], []) for _ in r]
for i in r:
  for _ in range(int(input())):
    x, y = map(int, input().split())
    a[i][y].append(x - 1)

fail = lambda x: not all(x.isdisjoint(a[i][0] and x.issuperset(a[i][1])) for i in x)

while all(map(fail, map(set, combinations(r, n)))):
  n -= 1
print(n)


from itertools import combinations, count
 
n = int(input())
r = range(n)
a = [(set(), set()) for _ in r]
for i in r:
  for _ in range(int(input())):
    x, y = map(int, input().split())
    a[i][y].add(x - 1)
ans = next(i for i in count(n, -1) for x in map(set, combinations(r, i))
           if all(a[j][0].isdisjoint(x) and a[j][1] < x for j in x))
print(ans)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
def main():
    N = int(input())
    XY = [[] for _ in range(N)]
    for i in range(N):
        A = int(input())
        for _ in range(A):
            x, y = map(int, input().split())
            XY[i].append((x-1, y))
#

    ans = 0
    for i in range(1, 2**N):
        flag = True
        cnt = 0
        for j in range(N):
            if i>>j & 1: 
                cnt += 1 
                for x, y in XY[j]:
                    if i>>x & 1 != y:
                        flag = False
                        break
        if flag:
            ans = max(ans, cnt)

    print(ans)

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()
n=I()
lis=[[]for i in range(n)]
for i in range(n):
    u=I()
    for j in range(u):
        a,b=MI()
        lis[i].append([a,b])
#print(lis)
z=[]
for x in range(2**n):
    u=[]
    for j in range(n):
        u.append(x%2)
        x=x>>1
    #print(u)
    count2=0
    for i in range(n):
        if u[i]==1:
            count=0
            for k in range(len(lis[i])):
                if lis[i][k][1]==u[lis[i][k][0]-1]:
                    count+=1
            if count==len(lis[i]):
                count2+=1
    if count2==sum(u):
        z.append(sum(u))
print(max(z))

Verdicts: Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
import itertools 
n=int(input())
g=[[-1 for _ in range(15)] for _ in range(15)]
for i in range(n):
    a=int(input())
    for j in range(a):
        x,y=map(int,input().split())
        g[i][x-1]=y
ans=0

for i in range(2**n):
    honests = [0 for _ in range(n)]
    for j in range(n):
        if(i>>j)&1:
            honests[j]=1
    print(honests)
    ok=True
    for j in range(n):
        if honests[j]:
            for k in range(n):
                if g[j][k]==-1: continue
                if g[j][k]!=honests[k]: ok=False
    if ok:
        ans=max(ans,honests.count(1))
print(ans)

import itertools 
n=int(input())
g=[[-1 for _ in range(15)] for _ in range(15)]
for i in range(n):
    a=int(input())
    for j in range(a):
        x,y=map(int,input().split())
        g[i][x-1]=y
ans=0

for i in range(2**n):
    honests = [0 for _ in range(n)]
    for j in range(n):
        if(i>>j)&1:
            honests[j]=1
    ok=True
    for j in range(n):
        if honests[j]:
            for k in range(n):
                if g[j][k]==-1: continue
                if g[j][k]!=honests[k]: ok=False
    if ok:
        ans=max(ans,honests.count(1))
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):

N = int(input())


es = [[] for _ in range(N)]
for i in range(N):
    A = int(input())
    for n in range(A):
        x,y = map(int, input().split())
        es[i].append((x-1,y))



ans = 0
for i in range(2**N):
    bnum = (bin(i)[2:]).zfill(N)

    f = True
    for j in range(N):
        
        if bnum[j] == "1":
            
            for x,y in es[j]:
                
                #print(j,x,y,bnum[x])
                if bnum[x] != str(y):
                    print("aaa")
                    f = False
    #print(bnum, f)
    if f:
        ans = max(ans, bnum.count("1"))
    
print(ans)


import sys
sys.setrecursionlimit(10**7)


N = int(input())


es = [[] for _ in range(N)]
for i in range(N):
    A = int(input())
    for n in range(A):
        x,y = map(int, input().split())
        es[i].append((x-1,y))




def dfs(node, c, parent, arr):

    arr[node] = c
    for next, d in es[node]:
        #print(next, d, parent, arr)
        f = False
        if arr[next] != -1:
            if   d != arr[next]:
                ans[parent] = 0
                return
        if ans[next] != -1:
            if d != arr[next]:
                ans[parent] = 0
                return
        if arr[next] == -1:
            dfs(next, d, parent, arr)
        


ans = [-1] * N
ans [0] = 1
for i in range(N):
    tmp = [-1]*N
    for j in range(N):
        if ans[j] != -1:
            tmp[j] = ans[j]
            tmp[j] = 1
    dfs(i,tmp[i],i,tmp)

print(ans.count(1))

import sys
sys.setrecursionlimit(10**7)


N = int(input())


es = [[] for _ in range(N)]
for i in range(N):
    A = int(input())
    for n in range(A):
        x,y = map(int, input().split())
        es[i].append((x-1,y))




def dfs(node, c, parent, arr):

    arr[node] = c
    for next, d in es[node]:
        print(next, d, parent, arr)
        if arr[next] != -1:
            if arr[node] == 1 and  d != arr[next]:
                arr[parent] = 0
        else:
            dfs(next, d, parent, arr)
        


ans = [-1] * N
ans [0] = 1
for i in range(N):
    for j in range(i+1,N):
        ans[j] = -1
    dfs(i,ans[i],i,ans)

print(ans.count(1))

N = int(input())
es = [[] for _ in range(N)]
for i in range(N):
    a = int(input())
    for _ in range(a):
        x,y = map(int, input().split())
        es[i].append((x-1,y))

ans = 0
for bit in range(1 << N):
    flag = True
    for i in range(N):
        if bit & (1 << i):
            for x, y in es[i]:
                if y == 1 and not bit & (1 << x) or y == 0 and bit & (1 << x):
                    flag = False
    
    if flag:

        ans = max(ans, bin(bit).count("1"))

print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
n = int(input())
a = [[-1for _ in range(n)]for _ in range(n)]

ans = 0

for i in range(n):
  m = int(input())
  for j in range(m):
    x,y = map(int,input().split())
    a[i][x-1] = y

for i in range(2**n):
  
  
  d = []
  p = len(bin(i))
  q = bin(i)
  for j in range(p-2):
    q = bin(i>>j)
    if int(q[len(q)-1]) == 1:
      d.append(j)
  
  res = True
  for j in d:
    for k in range(n):
      
      if a[j][k] == 1:
        if k not in d:
          res = False
      
      elif a[j][k] == 0:
        if k in d:
          res = False
    if res:
      ans = max(ans,len(d))

print(ans)

n = int(input())
a = [[-1for _ in range(n)]for _ in range(n)]

ans = 0

for i in range(n):
  m = int(input())
  for j in range(m):
    x,y = map(int,input().split())
    a[i][x-1] = y

for i in range(2**n):
  
  
  d = []
  p = len(bin(i))
  q = bin(i)
  for j in range(p-2):
    q = bin(i>>j)
    if int(q[len(q)-1]) == 1:
      d.append(j)
  
  res = True
  for j in d:
    for k in range(n):
      
      if a[j][k] == 1:
        if k not in d:
          res = False
      
      elif a[j][k] == 0:
        if k in d:
          res = False
  if res:
    ans = max(ans,len(d))

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
import itertools

n = int(input())
l =[]

for _ in range(n):
  a = int(input())
  m = []
  for _ in range(a):
    xn, yn = map(int, input().split())
    m.append([xn-1, yn])
  l.append(m)

for i in itertools.product([1, 0], repeat=n):
  i = list(i)
  flg = 0
  for j in range(n):
    for k in l[j]:
      if i[j] == 1:
        if i[k[0]] != k[1]:
          flg += 1
          break
      if flg != 0:
        break
  print(i)
  if flg == 0:
    break
    
print(sum(i))

import itertools

n = int(input())
l =[]

for _ in range(n):
  a = int(input())
  m = []
  for _ in range(a):
    xn, yn = map(int, input().split())
    m.append([xn-1, yn])
  l.append(m)

for i in itertools.product([1, 0], repeat=n):
  i = list(i)
  flg = 0
  for j in range(n):
    for k in l[j]:
      if i[j] == 1:
        if i[k[0]] != k[1]:
          flg += 1
          break
      if flg != 0:
        break
  if flg == 0:
    break
    
print(sum(i))

Verdicts: Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
import sys
input = sys.stdin.readline

_n = int(input())

said = []
for i in range(_n):
    ai = int(input())
    said.append([list(map(int, input().split())) for _ in range(ai)])

ans = 0
for i in range(2 ** _n):
    ynflg = 1
    flg = format(i, 'b').zfill(_n)
    for sy, tag in zip(said, flg):
        if tag == 0:
            continue

        for s in sy:
            if flg[s[0] - 1] != str(s[1]):
                ynflg = 0
                break

        if ynflg == 0:
            break

    if ynflg == 1:
        ans = max(ans, flg.count('1'))

print(ans)


import sys
input = sys.stdin.readline

_n = int(input())

said = []
for i in range(_n):
    ai = int(input())
    said.append([list(map(int, input().split())) for _ in range(ai)])

ans = 0
for i in range(2 ** _n):
    ynflg = 1
    flg = format(i, 'b').zfill(_n)
    for sy, tag in zip(said, flg):
        if tag == '0':
            continue

        for s in sy:
            if flg[s[0] - 1] != str(s[1]):
                ynflg = 0
                break

        if ynflg == 0:
            break

    if ynflg == 1:
        ans = max(ans, flg.count('1'))

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
n = int(input())
a = [[-1for _ in range(n)]for _ in range(n)]

ans = 0

for i in range(n):
  m = int(input())
  for j in range(m):
    x,y = map(int,input().split())
    a[i][x-1] = y

for i in range(2**n):
  
  
  d = []
  p = len(bin(i))
  q = bin(i)
  for j in range(p-2):
    q = bin(i>>j)
    if int(q[len(q)-1]) == 1:
      d.append(j)
  print(d)

  res = True
  for j in d:
    for k in range(n):
      
      if a[j][k] == 1:
        if k not in d:
          res = False
      
      elif a[j][k] == 0:
        if k in d:
          res = False
  if res:
    ans = max(ans,len(d))

print(ans)


n = int(input())
a = [[-1for _ in range(n)]for _ in range(n)]

ans = 0

for i in range(n):
  m = int(input())
  for j in range(m):
    x,y = map(int,input().split())
    a[i][x-1] = y

for i in range(2**n):
  
  
  d = []
  p = len(bin(i))
  q = bin(i)
  for j in range(p-2):
    q = bin(i>>j)
    if int(q[len(q)-1]) == 1:
      d.append(j)
  #print(d)

  res = True
  for j in d:
    for k in range(n):
      
      if a[j][k] == 1:
        if k not in d:
          res = False
      
      elif a[j][k] == 0:
        if k in d:
          res = False
  if res:
    ans = max(ans,len(d))

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
N = int(input())
A = []
x = []
y = []
xy = [[] for _ in range(N)]
for i in range(N):
    A1 = int(input())
    A.append(A1)
    for _ in range(A1):
        x, y = map(int, input().split())
        xy[i].append((x-1, y))

c_max = 0
cnt = 0
for i in range(1 << N):
    ok = True
    for j in range(N):
        if (i >> j) & 1:
            continue
        for x, y in (xy[j]):
            if (i >> x) & 1 != y:
                ok = False
                break
        if not ok:
            break

    if ok:
        cnt = bin(i)[2:].count('1')
        if cnt > c_max:
            c_max = cnt

print(c_max)

N = int(input())
A = []
x = []
y = []
xy = [[] for _ in range(N)]
for i in range(N):
    A1 = int(input())
    A.append(A1)
    for _ in range(A1):
        x, y = map(int, input().split())
        xy[i].append((x-1, y))

c_max = 0
cnt = 0
for i in range(1 << N):
    ok = True
    for j in range(N):
        if (i << j) & 1:
            continue
        for x, y in (xy[j]):
            if (i << x) & 1 != y:
                ok = False
                break
        if not ok:
            break

    if ok:
        cnt = bin(i)[2:].count('1')
        if cnt > c_max:
            c_max = cnt

print(c_max)


N = int(input())
A = []
x = []
y = []
xy = [[] for _ in range(N)]
for i in range(N):
    A1 = int(input())
    A.append(A1)
    for _ in range(A1):
        x, y = map(int, input().split())
        xy[i].append((x-1, y))

c_max = 0
cnt = 0
for i in range(1 << N):
    ok = True
    for j in range(N):
        if (i >> j) & 1:
            for x, y in (xy[j]):
                if (i >> x) & 1 != y:
                    ok = False
                    break
        if not ok:
            break

    if ok:
        cnt = bin(i)[2:].count('1')
        if cnt > c_max:
            c_max = cnt

print(c_max)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
def main():
    n = int(input())
    ans = []
    for _ in range(n):
        a_num = int(input())
        t = []
        for _ in range(a_num):
            t.append(tuple(map(int, input().split())))
        t = tuple(t)
        ans.append(t)
   
    r = 0
    for bit in range(1 << n):
        honest = []
        for i1 in range(n):
            mask = 1<<i1
            if bit & mask:
                honest.append(i1)

        flag = 1
        if not honest:
            flag = 0
        for eh in honest:
            say = ans[eh]
            for esay in say:
                if esay[0] - 1 in honest:
                    if esay[1] == 0:
                        flag = 0
                else:
                    if esay[1]:
                        flag = 0
        if flag:
            r = max(r, len(honest))
    print(r)

if __name__ == '__main__':
    main(


def main():
    n = int(input())
    ans = []
    for _ in range(n):
        a_num = int(input())
        t = []
        for _ in range(a_num):
            t.append(tuple(map(int, input().split())))
        t = tuple(t)
        ans.append(t)

    r = 0
    for bit in range(1 << n):
        honest = []
        for i1 in range(n):
            mask = 1<<i1
            if bit & mask:
                honest.append(i1)
        flag = 1       
        for eh in honest:
            say = ans[eh]
            for esay in say:
                if esay[0] - 1 in honest:
                    if esay[1] == 0:
                        flag = 0
                else:
                    if esay[1]:
                        flag = 0
        if flag:
            r = max(r, len(honest))
    print(r)

if __name__ == '__main__':
    main()

Verdicts: Runtime Error

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
n = int(input())
a = []
xy = []
for i in range(n):
    a += [int(input())]
    xy += [[list(map(int,input().split())) for i in range(a[i])]]
honest = []
for i in range(2 ** n):
    flag = 0
    for j in range(n):
        if (i >> j)&1 == 1: 
            for person_state in xy[j]:
                if (i >> person_state[0] & 1) != person_state[1]:
                    flag = 1 
                    break
    if flag == 0:
        honest += [bin(i)[2:].count("1")]
print(max(honest))

n = int(input())
a = []
xy = []
for i in range(n):
    a += [int(input())]
    xy += [[list(map(int,input().split())) for i in range(a[i])]]
honest = []
for i in range(2 ** n):
    flag = 0
    for j in range(n):
        if (i >> j)&1 == 1: 
            for person_state in xy[j]:
              if (i >> (person_state[0]-1) & 1) != person_state[1]:
                  flag = 1 
                  break
    if flag == 0:
        honest += [bin(i)[2:].count("1")]
print(max(honest))

Verdicts: Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
import copy

N = int(input())
X = []
for i in range(N):
  A = int(input())
  X.append([])
  for _ in range(A):
    X[i].append(list(map(int, input().split())))

print(X)

def rec(condition, i):
  if i==N:
    return condition.count(1)
  _X = X[i]
  _condition = copy.copy(condition)
  through_condition = copy.copy(condition)
  through_condition[i] = 0
  if condition[i]==0:
    return rec(copy.copy(through_condition), i+1)
  for x in _X:
    if _condition[ x[0]-1 ] == -1:
      _condition[ x[0]-1 ] = x[1]
    elif _condition[ x[0]-1 ] != x[1]:
      return 0 if _condition[i]==1 else rec(copy.copy(through_condition), i+1)
  _condition[i] = 1
  return max(rec(copy.copy(through_condition), i+1), rec(copy.copy(_condition), i+1))

print( rec([-1 for _ in range(N)], 0) )


import copy

N = int(input())
X = []
for i in range(N):
  A = int(input())
  X.append([])
  for _ in range(A):
    X[i].append(list(map(int, input().split())))

def rec(condition, i):
  if i==N:
    return condition.count(1)
  _X = X[i]
  _condition = copy.copy(condition)
  through_condition = copy.copy(condition)
  through_condition[i] = 0
  if condition[i]==0:
    return rec(copy.copy(through_condition), i+1)
  for x in _X:
    if _condition[ x[0]-1 ] == -1:
      _condition[ x[0]-1 ] = x[1]
    elif _condition[ x[0]-1 ] != x[1]:
      return 0 if _condition[i]==1 else rec(copy.copy(through_condition), i+1)
  _condition[i] = 1
  return max(rec(copy.copy(through_condition), i+1), rec(copy.copy(_condition), i+1))

print( rec([-1 for _ in range(N)], 0) )


Verdicts: Wrong Answer

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):

from itertools import combinations


def main():
    N = int(input())
    testimonies = [[] for _ in range(N + 1)]
    for i in range(1, N + 1):
        A = int(input())
        for _ in range(A):
            testimonies[i].append(map(int, input().split()))

    for cnt_honest in range(N, 0, -1):
        for honest_people in combinations(range(1, N + 1), cnt_honest):
            is_consistent = True
            for i in honest_people:
                for x, y in testimonies[i]:
                    if (x in honest_people and not y) or (x not in honest_people and y):
                        is_consistent = False
                        break
                if not is_consistent:
                    break
            if is_consistent:
                print(cnt_honest)
                return
    print(0)


if __name__ == "__main__":
    main()



from itertools import combinations


def main():
    N = int(input())
    testimonies = [[] for i in range(N + 1)]
    for i in range(1, N + 1):
        A = int(input())
        for _ in range(A):
            x, y = map(int, input().split())
            testimonies[i].append((x, y))

    for cnt_honest in range(N, 0, -1):
        for honest_people in combinations(range(1, N + 1), cnt_honest):
            is_consistent = True
            for i in honest_people:
                for x, y in testimonies[i]:
                    if (x in honest_people and not y) or (x not in honest_people and y):
                        is_consistent = False
                        break
                if not is_consistent:
                    break
            if is_consistent:
                print(cnt_honest)
                return
    print(0)


if __name__ == "__main__":
    main()

Verdicts: Runtime Error

Accepted
Problem: There are N people numbered 1 to N. Each of them is either an _honest_ person whose testimonies are always correct or an _unkind_ person whose testimonies may be correct or not.  Person i gives A_i testimonies. The j-th testimony by Person i is represented by two integers x_{ij} and y_{ij}. If y_{ij} = 1, the testimony says Person x_{ij} is honest; if y_{ij} = 0, it says Person x_{ij} is unkind.  How many honest persons can be among those N people at most?

Submission attempts (in order):
N = int(input())
path = []
ans = 0
ap = path.append
Ap = path[-1].append
for i in range(N):
    A = int(input())
    ap([])
    for j in range(A):
        x, y = map(int,input().split())
        x -= 1
        Ap((x, y))
for i in range(1<<N):
    i |= (1<<N)
    judge = True
    for j in range(N):
        if (1<<j) & i:
            for k in range(len(path[j])):
                if path[j][k][1] != int(bin(i)[-path[j][k][0] - 1]):
                    judge = False
    if judge:
        if ans < bin(i).count("1") - 1:
            ans = bin(i).count("1") - 1
print(ans)

N = int(input())
path = []
ans = 0
for i in range(N):
    A = int(input())
    path.append([])
    for j in range(A):
        x, y = map(int,input().split())
        x -= 1
        path[-1].append((x, y))
for i in range(1<<N):
    i |= (1<<N)
    judge = True
    for j in range(N):
        if not judge:
            break
        if (1<<j) & i:
            for k in range(len(path[j])):
                if path[j][k][1] != int(bin(i)[-path[j][k][0] - 1]):
                    judge = False
                    break
    if judge:
        if ans < bin(i).count("1") - 1:
            ans = bin(i).count("1") - 1
print(ans)

Verdicts: Runtime Error

Accepted