2075번

· 백준
코드 import sys, heapq input = sys.stdin.readline n = int(input()) hq = [] for _ in range(n): for i in map(int, input().split()): if len(hq) hq[0]: # 힙의 1번째 값은 최소값임이 보장된다. heapq.heappop(hq) heapq.heappush(hq,i) print(heapq.heappop(hq)) # hq[0]으로 해도 정답이 출력된다. 한 배열에 다 때려박고 정렬을 해도 최대 데이터 개수가 1500이라 시간은 충분한데, 메모리 초과가 난다. 그래서 최대 개수를 5개로 맞춰주면서 우선순위 큐로 해결하는 방법을 사용했다..