본문 바로가기
백준 문제풀이

baekjoon - python - 1920

by winston1214 2020. 10. 10.
반응형

www.acmicpc.net/problem/1920

 

1920번: 수 찾기

첫째 줄에 자연수 N(1≤N≤100,000)이 주어진다. 다음 줄에는 N개의 정수 A[1], A[2], …, A[N]이 주어진다. 다음 줄에는 M(1≤M≤100,000)이 주어진다. 다음 줄에는 M개의 수들이 주어지는데, 이 수들이 A안��

www.acmicpc.net

import sys
a = int(sys.stdin.readline())
x = list(map(int,sys.stdin.readline().split()))
b = int(sys.stdin.readline())
y = list(map(int,sys.stdin.readline().split()))
dic={}
for i in x:
    dic[i]=True
for j in y:
    if j in dic:
        print(1)
    else:
        print(0)

 

반응형

'백준 문제풀이' 카테고리의 다른 글

baekjoon - python - 5355  (0) 2020.10.14
baekjoon - python - 10845  (0) 2020.10.10
baekjoon - python - 10815  (0) 2020.10.10
baekjoon - python - 10867  (0) 2020.10.10
baekjoon - python - 1927  (0) 2020.10.04

댓글