백준

백준 2776번: 암기왕 (파이썬)

inns21 2023. 7. 29. 23:04

import sys
T = int(sys.stdin.readline().strip())

for i in range(T):
  note1 = int(sys.stdin.readline().strip())
  num1 = list(map(int, sys.stdin.readline().split()))
  num1 = {i:0 for i in num1}
  note2 = int(sys.stdin.readline().strip())
  num2 = list(map(int, sys.stdin.readline().split()))
  for i in num2:
    if i in num1:
      print(1)
    else:
      print(0)