From b8632b8501b73435570eb0f02507cd9b90f59f56 Mon Sep 17 00:00:00 2001 From: Gyubin Han <89185979+Gyubin-Han@users.noreply.github.com> Date: Fri, 17 May 2024 19:19:01 +0900 Subject: [PATCH] add: swea/1860.py --- swea/1860.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 swea/1860.py diff --git a/swea/1860.py b/swea/1860.py new file mode 100644 index 0000000..91eb727 --- /dev/null +++ b/swea/1860.py @@ -0,0 +1,35 @@ +from queue import Queue +t=int(input()) +for tc in range(1,t+1): + n,m,k=map(int,input().split()) + arr=list(map(int,input().split())) + q=Queue() + arr.sort() + for i in arr: + q.put(i) + + isPos=True + time=1 + cnt=0 + last=q.get() + while isPos and not(last0: + last=q.get() + else: + last=-1 + if cnt<0: + isPos=False + break + time+=1 + if last==0: + isPos=False + isPosStr="" + if isPos: + isPosStr="Possible" + else: + isPosStr="Impossible" + print("#"+str(tc),isPosStr)