목록N번째 큰 수 (1)
컴공생의 다이어리
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/creGdG/btrATcDFm62/quBVnweB9ClTOkgD7YHmpK/img.png)
백준 2075번 : N번째 큰 수 (문제 바로가기) 내 코드 import sys, heapq input = sys.stdin.readline heap = [] for _ in range(int(input())): arr = list(map(int, input().split())) if not heap: for a in arr: heapq.heappush(heap, a) else: for a in arr: if heap[0] < a: heapq.heappush(heap, a) heapq.heappop(heap) print(heap[0])
Development/Algorithm & Coding Test
2022. 5. 2. 00:01