프린터 큐 1966
프린터 큐 1966
https://www.acmicpc.net/problem/1966
어렵진 않은데 좀 헷갈림
리스트 쓰지 말걸 그랬나 연습겸
```python
#1966
testcase=int(input())
for _ in range(testcase):
N,M=map(int,input().split())
docs_importance=list(map(int,input().split()))
tmp=[x for x in range(N)]
count=0
while len(tmp)>0:
if docs_importance[tmp[0]]>=max(docs_importance):
count+=1
if tmp[0]==M:
print(count)
break
docs_importance[tmp[0]]=0
tmp.pop(0)
else:
pop_idx=tmp.pop(0)
tmp.append(pop_idx)
```
댓글
댓글 쓰기