백준 10815

Baekjoon/이분탐색

[백준] 10815 숫자 카드 (실버5) / 이분탐색

문제요약 나의 코드 및 설명 n = int(input()) a = list(map(int, input().split())) a.sort() m = int(input()) b = list(map(int, input().split())) result = [] for x in b: start = 0 end = n-1 ans = False while start x: end = mid-1 elif a[mid] < x: start = mid+1 else: ans = True break if ans: result.append(1) else: result.append(0) print(" ".join(map(str, result))) 피드백 이전에 풀었던 이분탐색 문제와 크게 다르지 않은 문제여서 역시나 이분탐색 알고리..

hellosonic
'백준 10815' 태그의 글 목록