#37094: python 紀錄


BensonDC (python戰士)

學校 : 不指定學校
編號 : 240921
來源 : [163.32.78.214]
最後登入時間 :
2024-11-06 14:27:58
h026. 202001_1 猜拳 -- 2020年1月APCS | From: [36.238.105.93] | 發表日期 : 2023-08-21 03:35

F=int(input())
N=int(input())
list_N=[int(x) for x in input().split()]
list_F=[F,list_N[0]]+[0]*100
for i in range(2,N):
    if list_N[i-1]==list_N[i-2]:
        if list_N[i-1]==0:list_F[i]=5
        elif list_N[i-1]==2:list_F[i]=0
        else:list_F[i]=2
    else:list_F[i]=list_N[i-1]
count = 0
yn = True
for i in range(N):
    if list_F[i]==0 and list_N[i]==2 or list_F[i]==2 and list_N[i]==5 or list_F[i]==5 and list_N[i]==0:
        yn = False
        print(*list_F[:i+1],":","Won at round",i+1)
        break
    elif list_F[i]==0 and list_N[i]==5 or list_F[i]==2 and list_N[i]==0 or list_F[i]==5 and list_N[i]==2:
            yn = False
            print(*list_F[:i+1],":","Lost at round",i+1)
            break
if yn:print(*list_F[:i+1],":","Drew at round",N)

 
ZeroJudge Forum