def half_check(check_num, check_list):
    list_len = len(check_list)
    
    if(list_len == 0):
        return print('0')
    
    index = list_len // 2
    
    if(check_list[index] == check_num):
        return print('1')
    elif(check_list[index] > check_num):
        return half_check(check_num, check_list[:index])
    else:
        return half_check(check_num, check_list[index + 1:])

import sys
input = sys.stdin.readline    

N = int(input())
A = list(map(int, input().split()))
sorted_A = sorted(A)

M = int(input())
M_list = list(map(int, input().split()))

for check_num in M_list:
    half_check(check_num, sorted_A)

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 1654번(python)  (0) 2020.07.27
백준 10816번(python)  (0) 2020.07.19
백준 2261번(python)  (1) 2020.07.17
백준 6549번(python)  (0) 2020.07.13
백준 2749번(python)  (0) 2020.07.12


expression = input().split('-')
for_minimum_list = []

for exp in expression:
    splited = list(map(int, exp.split('+')))
    for_minimum_list.append(sum(splited))
    
sum_value = for_minimum_list[0]
for value in for_minimum_list[1:]:
    sum_value = sum_value - value
    
print(sum_value)

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 11653번(python)  (0) 2020.04.01
백준 5598번(python)  (0) 2020.04.01
백준 11399번(python)  (0) 2020.01.07
백준 1931번(python)  (0) 2020.01.03
백준 11047번(python)  (0) 2020.01.03


N = int(input())
time_list = list(map(int, input().split()))
time_list = sorted(time_list)
sum_value = time_list[0]

for i in range(1, N):
    sum_value = sum_value + sum(time_list[:i+1])
    
print(sum_value)

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 5598번(python)  (0) 2020.04.01
백준 1541번(python)  (0) 2020.01.07
백준 1931번(python)  (0) 2020.01.03
백준 11047번(python)  (0) 2020.01.03
백준 12865번(python)  (0) 2020.01.02


N = int(input())

meeting_list = [list(map(int, input().split())) for _ in range(N)]
# 파이썬에서 여러 조건으로 정렬하는 방법
meeting_list = sorted(meeting_list, key = lambda x:(x[1], x[0]))

max_meeting = 0
start = 0

for time in meeting_list:
    if(time[0] >= start):
        start = time[1]
        max_meeting += 1
        
print(max_meeting)

 

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 1541번(python)  (0) 2020.01.07
백준 11399번(python)  (0) 2020.01.07
백준 11047번(python)  (0) 2020.01.03
백준 12865번(python)  (0) 2020.01.02
백준 14889번(python)  (0) 2020.01.02


N, K = list(map(int, input().split()))
m_list = []
for _ in range(N):
    m_list.append(int(input()))
    
min_value = 0

for i in m_list[::-1]:
    if(i > K):
        continue
    else:     
        if((K % i) < K):
            min_value = min_value + (K // i)
            K = K % i
        
print(min_value)

'# 코딩 문제 관련 > 파이썬' 카테고리의 다른 글

백준 11399번(python)  (0) 2020.01.07
백준 1931번(python)  (0) 2020.01.03
백준 12865번(python)  (0) 2020.01.02
백준 14889번(python)  (0) 2020.01.02
백준 14888번(python)  (0) 2020.01.02