절대값
[실1] 11286 - 절대값 힙
#include #include #include #include using namespace std; #define y first #define x second int main() { using pq_type = pair; cin.sync_with_stdio(0); cin.tie(0); priority_queue q; int n; cin >> n; for (int i = 0; i > val; if (val != 0) q.push({ abs(val), val }); else { if (q.empty()) cout