Submission #161853

# Submission time Handle Problem Language Result Execution time Memory
161853 2019-11-04T19:12:32 Z boolodifjenula Baza (COCI17_baza) Python 3
50 / 50
625 ms 36124 KB
N,M=map(int,input().split())
L=[]
for i in range(N):
    L+=[list(map(int,input().split()))]
Q=int(input())
R=Q*[0]
for x in range (Q):
    Z=list(map(int,input().split()))
    for y in range(N):
        for z in range(M):
            if Z[z]!=-1 and Z[z]!=L[y][z]:
                break
            if z==M-1:
                R[x]+=1
for i in range(Q):
    print(R[i])
                
                
        
        
        
    
    
# Verdict Execution time Memory Grader output
1 Correct 203 ms 13628 KB Output is correct
2 Correct 146 ms 10172 KB Output is correct
3 Correct 435 ms 24652 KB Output is correct
4 Correct 121 ms 8380 KB Output is correct
5 Correct 300 ms 19952 KB Output is correct
6 Correct 485 ms 28424 KB Output is correct
7 Correct 625 ms 36124 KB Output is correct
8 Correct 386 ms 24492 KB Output is correct
9 Correct 279 ms 16160 KB Output is correct
10 Correct 573 ms 35284 KB Output is correct