practivceAlgorithm/백준

[백준][Python] 1920 수찾기

findTheValue 2021. 10. 15. 19:54

간단한 hash-map

 

import sys
input = sys.stdin.readline

num_set = {}
N = int(input())
A = list(map(int, input().split()))
for num in A:
    num_set[num] = True
M = int(input())
Q = list(map(int, input().split()))
for num in Q:
    if num in num_set:
        print(1)
    else:
        print(0)