프린터큐 (1) 썸네일형 리스트형 [ 백준 / BOJ ] 1966 프린터 큐 / 제출 1 / from collections import deque T = int(input()) for _ in range(T): n, target = map(int, input().split()) docs = enumerate(list(map(int, input().split()))) docs = deque(docs) print(docs) count = 0 while docs: now = docs.popleft() count += 1 if docs: for doc in docs: if now[1] < doc[1]: count -= 1 docs.append(now) break if now[0] == target and now not in docs: break print(count) 풀이 소요시간: 2.. 이전 1 다음