結果

問題 No.1717 Levi-Civita Triangle
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2021-10-22 23:47:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 903 bytes
コンパイル時間 1,072 ms
コンパイル使用メモリ 81,576 KB
実行使用メモリ 147,896 KB
最終ジャッジ日時 2023-10-24 16:06:20
合計ジャッジ時間 4,911 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,456 KB
testcase_01 AC 35 ms
53,456 KB
testcase_02 AC 35 ms
53,456 KB
testcase_03 AC 34 ms
53,456 KB
testcase_04 AC 34 ms
53,456 KB
testcase_05 AC 45 ms
62,228 KB
testcase_06 AC 55 ms
75,264 KB
testcase_07 AC 111 ms
123,796 KB
testcase_08 AC 35 ms
53,456 KB
testcase_09 AC 34 ms
53,456 KB
testcase_10 AC 43 ms
62,228 KB
testcase_11 AC 53 ms
73,820 KB
testcase_12 AC 86 ms
107,356 KB
testcase_13 AC 35 ms
53,456 KB
testcase_14 WA -
testcase_15 AC 36 ms
53,456 KB
testcase_16 WA -
testcase_17 AC 110 ms
128,264 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 40 ms
59,476 KB
testcase_21 AC 49 ms
68,392 KB
testcase_22 AC 80 ms
102,572 KB
testcase_23 WA -
testcase_24 AC 35 ms
53,456 KB
testcase_25 AC 44 ms
62,248 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 34 ms
53,456 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 124 ms
130,576 KB
testcase_34 WA -
testcase_35 AC 108 ms
130,312 KB
testcase_36 WA -
testcase_37 AC 117 ms
130,576 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 127 ms
130,576 KB
testcase_41 WA -
testcase_42 AC 110 ms
130,312 KB
testcase_43 WA -
testcase_44 AC 118 ms
130,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
m=2*n+1
x=list(map(int,input().split()))

one=[(0,1,2),(1,2,0),(2,0,1)]
two=[(2,1,0),(1,0,2),(0,2,1)]
def f(x):

    while len(x)>1:
        y=[]
        for i in range(len(x)-2):
            tup=(x[i],x[i+1],x[i+2])
            if tup in one:y.append(1)
            elif tup in two:y.append(2)
            else:y.append(0)
        x=y
    return x[0]

res=[]


for i in range(m):
    if len(res)==0:res.append(0)
    elif res[-1]==0:res.append(1)
    elif res[-1]==2:res.append(1)
    else:
        if res[-2]==0:res.append(2)
        else:res.append(0)

p=[(0,1,2),(1,2,0),(2,0,1),(2,1,0),(1,0,2),(0,2,1)]


for tup in p:
    res1=[]
    for i in range(m):
        res1.append(tup[res[i]])
    if x==res1:
        y=tuple((res1[:2]))
        if y in one:ans=1
        else:ans=2
        if n%2==0:ans+=1

        if ans%2==1:print(2)
        else:print(1)
        exit()




print(0)

0