Submission #8884999


Source Code Expand

Copy
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import itertools
import numpy as np

N = int(readline())
info = []
for i in range(N):
    A = int(readline())
    for _ in range(A):
        x,y = map(int,readline().split())
        info.append((i,x-1,y))
        
A = np.array(list(itertools.product([0,1],repeat=N)),np.bool)
for i,x,y in info:
    bl = (~A[:,i]) | (A[:,x] == bool(y))
    A = A[bl]

answer = A.sum(axis = 1).max()
print(answer)

Submission Info

Submission Time
Task C - HonestOrUnkind2
User maspy
Language Python (3.4.3)
Score 300
Code Size 537 Byte
Status AC
Exec Time 286 ms
Memory 18440 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 15
Set Name Test Cases
Sample sample00, sample01, sample02
All handmade03, handmade04, handmade05, handmade06, handmade07, handmade08, random09, random10, random11, random12, random13, random14, sample00, sample01, sample02
Case Name Status Exec Time Memory
handmade03 AC 280 ms 18440 KB
handmade04 AC 286 ms 18440 KB
handmade05 AC 197 ms 18152 KB
handmade06 AC 283 ms 18184 KB
handmade07 AC 280 ms 18440 KB
handmade08 AC 149 ms 12408 KB
random09 AC 214 ms 18184 KB
random10 AC 219 ms 18440 KB
random11 AC 168 ms 13448 KB
random12 AC 236 ms 18152 KB
random13 AC 250 ms 18152 KB
random14 AC 246 ms 18440 KB
sample00 AC 148 ms 12440 KB
sample01 AC 149 ms 12440 KB
sample02 AC 149 ms 12440 KB