코딩테스트 준비

BOJ 백준

백준 11286, 절댓값 힙(C, C++)

#include #include #include using namespace std; int main(){ priority_queue pq; int N; cin>>N; for(int i = 0; i >temp; if(temp){ pq.push(make_pair(abs(temp), temp)); }else if(!temp){ if(pq.empty()){ cout

BOJ 백준

백준 21939번, 문제 추천 시스템 Version 1(C, C++)

#include #include #include using namespace std; priority_queue maxheap; priority_queue minheap; map m; int main(){ int N; int M; int L; int P; int command; cin>>N; for(int i = 0; i >P>>L; m[P] = L; maxheap.push(make_pair(L, P)); minheap.push(make_pair(L, P)); } cin>>M; for(int i = 0; i >command; if(command == "recommend"){ int x; cin>>x; if(x == 1){ ..

simun
'코딩테스트 준비' 태그의 글 목록