목록우선순위 큐 (12)
넘치게 채우기
https://www.acmicpc.net/problem/1753BOJ - 최단경로문제 유형: 최단거리, 다익스트라, 우선순위 큐문제 난이도: Gold IV시간 제한: 1초메모리 제한: 256MB 문제방향그래프가 주어지면 주어진 시작점에서 다른 모든 정점으로의 최단 경로를 구하는 프로그램을 작성하시오. 단, 모든 간선의 가중치는 10 이하의 자연수이다. 입력첫째 줄에 정점의 개수 V와 간선의 개수 E가 주어진다. (1 ≤ V ≤ 20,000, 1 ≤ E ≤ 300,000) 모든 정점에는 1부터 V까지 번호가 매겨져 있다고 가정한다. 둘째 줄에는 시작 정점의 번호 K(1 ≤ K ≤ V)가 주어진다. 셋째 줄부터 E개의 줄에 걸쳐 각 간선을 나타내는 세 개의 정수 (u, v, w)가 순서대로 주어진다. 이는..
https://leetcode.com/problems/kth-largest-element-in-a-stream/description/?envType=daily-question&envId=2024-08-12leetcode = Kth Largest Element in a Stream문제 유형 : 우선순위 큐문제 난이도 : Easy 문제Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element.Implement KthLargest class:KthLargest(int k, int[] nums) Initi..