1966
[백준 1966번][C++] 프린터 큐
같은 우선순위 내에서 비교하는 방법을 찾아야했던 문제 #include #include #include using namespace std; //우선순위들을 담을 PAIR QUEUE queue q; //최대 우선순위 큐가 나올때까지 큐를 순환시키는 하ㅏㅁ수 int delt_idx(int p) { //우선순위 p가 나올때까지 q안에 있는 우선순위를 뒤로 보낸다 while (q.front().first != p) { q.push(q.front()); q.pop(); } //우선순위 p와 같은 q원소의 2번째 인자 반환 return q.front().second; } int main() { int test; cin >> test; int total, index; int rank; while (test--) { ..