언어, 알고리즘 공부/백준2020. 5. 1. 20:09[백준 알고리즘] 1966번 프린터 큐 (Python)
import collections import sys test = int(sys.stdin.readline()) for _ in range(test): cnt = 0 n, m = map(int, sys.stdin.readline().split()) priority = collections.deque(map(int, sys.stdin.readline().split())) if len(priority) == 1: print(1) else: while True: index = priority.index(max(priority)) for _ in range(index): a = priority.popleft() priority.append(a) if m >= 1: m -= 1 else: m = len(prior..