최대 힙최대 힙을 사용하기 위해 queue 자료구조를 사용하였다.pop()은 최대값을 삭제할 뿐 최대값을 반환해주지는 않으므로 top()을 통해 최대값을 반환받은 후 pop()으로 제거해주었다.#include#include#includeusing namespace std;int main() { ios::sync_with_stdio(false); cin.tie(NULL); priority_queuemax_heap; long long num; int x; cin >> num; for (int i = 0;i > x; if (x == 0) { if (max_heap.empty()) { cout