힙(Heap) > 더 맵게
-
힙(Heap) > 더 맵게프로그래머스(Programmers) 2018. 9. 30. 19:09
https://programmers.co.kr/learn/courses/30/lessons/42626 1. 문제 2. 알고리즘키워드 - 힙 3. 코드 12345678910111213141516171819202122232425262728293031323334353637383940#include #include #include #include #include using namespace std; int solution(vector scoville, int K) { int answer = 0; priority_queue q; for (int i = 0; i = K) { break; } if(q.size() == 1) { answer = -1; break; } q.pop(); int b = q.top(); q...