← Back to List

2776번: 암기왕 ↗

Solutions

Python 3
277 B | 277 chars
for t in range(int(input())):
    d = {}
    input()
    for i in list(map(int,input().split())):
        d[i] = 1
    input()
    for i in list(map(int,input().split())):
        try:
            d[i] +=1
        except:
            print(0)
        else:
            print(1)