ํฐ์คํ ๋ฆฌ ๋ทฐ
๐ฉ๐ป๐ป ๋ฌธ์
โ๐ป ํ์ด
๐จ Python3
# https://www.acmicpc.net/problem/14235
import sys, heapq
if __name__ == "__main__":
n = int(sys.stdin.readline())
h = []
for i in range(n):
inputs = list(map(int, sys.stdin.readline().split()))
if inputs[0] == 0:
if len(h) == 0:
print(-1)
else:
print(-1*heapq.heappop(h))
else:
for j in range(1, inputs[0]+1):
heapq.heappush(h, -1*inputs[j])
728x90
'dev > algorithm' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
BOJ / 2204๋ฒ / ๋๋น์ ๋๋ ์ฆ ํ ์คํธ [Go][Python3] (0) | 2020.12.03 |
---|---|
BOJ / 20291๋ฒ / ํ์ผ ์ ๋ฆฌ [Go][Python3] (0) | 2020.12.02 |
BOJ / 11286๋ฒ / ์ ๋๊ฐ ํ [Go][Python3] (0) | 2020.11.30 |
BOJ / 1927๋ฒ / ์ต์ ํ [Go][Python3] (0) | 2020.11.29 |
BOJ / 11279๋ฒ / ์ต๋ ํ [Go][Python3] (0) | 2020.11.28 |
๋๊ธ
๊ธ ๋ณด๊ดํจ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
TAG
- ๋ฐฑ์ค
- Golang
- ๋ธ๋ฃจํธํฌ์ค
- ์ด๋ถํ์
- Macbook pro 2012 mid 13
- dp
- ์๊ฐ๊ต์ฒด
- Algorithm
- ์๊ณ ๋ฆฌ์ฆ
- BOJ
- AWS
- go
- ๋งฅ๋ถ
- ํ
- ๋ฐ๋
- ๋ชฝ๊ณ ๋๋น
- ๋งฅ๋ถ ์ ๊ทธ๋ ์ด๋
- ํ๋ก์ด๋์์ฌ
- ํด์๋งต
- baekjoon
- ๋งฅ๋ถํ๋ก
- python3
- ballet
- java
- MongoDB
- BFS
- ์๋ฐ
- ์คํ
- ๋ถํ ์ ๋ณต
- dfs
- Total
- Today
- Yesterday