์ •๋ ฌ

๐Ÿฅˆ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๊ฐ’์„ ์ฐพ์•„์•ผํ•œ..
Yuuuki
'์ •๋ ฌ' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก