[백준][Python] 11286 절댓값 힙 말 그대로 절댓값 힙 import sys input = sys.stdin.readline from heapq import heappop,heappush N = int(input()) arr = [] for _ in range(N): x = int(input()) if x: heappush(arr,(abs(x),x)) continue try: print(heappop(arr)[1]) except: print(0) practivceAlgorithm/백준 2021.09.13