๐ฅSilver 5 https://www.acmicpc.net/problem/10815 โ
1์ฐจ ํ์ดimport sysinput=sys.stdin.readlineanswer=''n=int(input())having_cards=set(map(int,input().rstrip().split()))m=int(input())num_list=list(map(int,input().rstrip().split()))for num in num_list: if num in having_cards: answer+='1' else: answer+='0'print(' '.join(answer))input์ ๋ฒ์๊ฐ 10^7์ผ๋ก ์ด๋ถํ์์ ํด์ผํ๋ ํ์ง๋ง, ์ผ๋จ ํ๋ฒ ์ ์งํ๊ฒ ํ์ด๋ณด์๋ค.์๊ทผ์ด..
์ ๋ ฌ
https://school.programmers.co.kr/learn/courses/30/lessons/42747 ํ๋ก๊ทธ๋๋จธ์ค์ฝ๋ ์ค์ฌ์ ๊ฐ๋ฐ์ ์ฑ์ฉ. ์คํ ๊ธฐ๋ฐ์ ํฌ์ง์
๋งค์นญ. ํ๋ก๊ทธ๋๋จธ์ค์ ๊ฐ๋ฐ์ ๋ง์ถคํ ํ๋กํ์ ๋ฑ๋กํ๊ณ , ๋์ ๊ธฐ์ ๊ถํฉ์ด ์ ๋ง๋ ๊ธฐ์
๋ค์ ๋งค์นญ ๋ฐ์ผ์ธ์.programmers.co.kr โ
์ ๋ตํ์ด (Python)def solution(citations): citations.sort(reverse=True) h=0 for i in range(len(citations)): if citations[i]>=i+1: h=i+1 return hh๋ฒ ์ด์ ์ธ์ฉ๋ ๋
ผ๋ฌธ์ด hํธ์ด์์ด๋ผ๋ ์กฐ๊ฑด์ ๋ง์กฑํ๋ h๊ฐ ์ค, ์ ์ผ ํฐ h๊ฐ์ ์ฐพ์์ผํ..