Skip to content

Commit

Permalink
Merge pull request #156 from AlgoLeadMe/3-H0ngJu
Browse files Browse the repository at this point in the history
3-H0ngJu
  • Loading branch information
H0ngJu authored Mar 25, 2024
2 parents 1ee7e98 + d46feb3 commit 301cbcc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
7 changes: 4 additions & 3 deletions H0ngJu/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
## โœ๏ธ ๊ธฐ๋ก

| ์ฐจ์‹œ | ๋‚ ์งœ | ๋ฌธ์ œ์œ ํ˜• | ๋งํฌ | ํ’€์ด |
| :---: | :--------: | :------: | :-----------------------------------------------------------------------------------: | :-------------------------------------------------: |
| 1์ฐจ์‹œ | 2024.03.05 | ํ | [ํ”„๋กœ์„ธ์Šค](https://school.programmers.co.kr/learn/courses/30/lessons/42587) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/151 |
| ์ฐจ์‹œ | ๋‚ ์งœ | ๋ฌธ์ œ์œ ํ˜• | ๋งํฌ | ํ’€์ด |
| :---: | :--------: | :------: | :-------------------------------------------------------------------------: | :-------------------------------------------------: |
| 1์ฐจ์‹œ | 2024.03.05 | ํ | [ํ”„๋กœ์„ธ์Šค](https://school.programmers.co.kr/learn/courses/30/lessons/42587) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/151 |
| 2์ฐจ์‹œ | 2024.03.07 | ํ | [๋‹ค๋ฆฌ๋ฅผ ์ง€๋‚˜๋Š” ํŠธ๋Ÿญ](https://school.programmers.co.kr/learn/courses/30/lessons/42583) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/153 |
| 3์ฐจ์‹œ | 2024.03.10 | ํž™ | [N๋ฒˆ์งธ ํฐ ์ˆ˜](https://www.acmicpc.net/problem/2075) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/156 |

---
19 changes: 19 additions & 0 deletions H0ngJu/ํž™/N๋ฒˆ์งธ ํฐ ์ˆ˜.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import sys
import heapq

line = int(sys.stdin.readline().strip())

heap = []
heapq.heapify(heap)

for i in range(line):
data = list(map(int, sys.stdin.readline().strip().split()))
for s in data:
if len(heap) < line:
heapq.heappush(heap, s)
else:
if s > heap[0]:
heapq.heappop(heap)
heapq.heappush(heap, s)

print(heap[0])

0 comments on commit 301cbcc

Please sign in to comment.