diff --git a/H0ngJu/README.md b/H0ngJu/README.md index 51325d9c..15aa5387 100644 --- a/H0ngJu/README.md +++ b/H0ngJu/README.md @@ -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 | --- diff --git "a/H0ngJu/\355\236\231/N\353\262\210\354\247\270 \355\201\260 \354\210\230.py" "b/H0ngJu/\355\236\231/N\353\262\210\354\247\270 \355\201\260 \354\210\230.py" new file mode 100644 index 00000000..5a22ef79 --- /dev/null +++ "b/H0ngJu/\355\236\231/N\353\262\210\354\247\270 \355\201\260 \354\210\230.py" @@ -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]) \ No newline at end of file