結果

問題 No.1717 Levi-Civita Triangle
ユーザー rlangevinrlangevin
提出日時 2024-02-02 12:33:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 599 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 98,220 KB
最終ジャッジ日時 2024-02-02 12:33:39
合計ジャッジ時間 4,845 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
53,460 KB
testcase_01 AC 30 ms
53,460 KB
testcase_02 AC 30 ms
53,460 KB
testcase_03 AC 30 ms
53,460 KB
testcase_04 AC 30 ms
53,460 KB
testcase_05 AC 39 ms
59,448 KB
testcase_06 AC 34 ms
62,104 KB
testcase_07 AC 51 ms
82,140 KB
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 32 ms
53,460 KB
testcase_10 AC 33 ms
59,448 KB
testcase_11 AC 35 ms
61,824 KB
testcase_12 AC 43 ms
71,704 KB
testcase_13 AC 31 ms
53,460 KB
testcase_14 AC 35 ms
53,460 KB
testcase_15 AC 31 ms
53,460 KB
testcase_16 AC 33 ms
61,940 KB
testcase_17 WA -
testcase_18 AC 29 ms
53,460 KB
testcase_19 AC 30 ms
53,460 KB
testcase_20 WA -
testcase_21 AC 34 ms
61,940 KB
testcase_22 AC 48 ms
80,584 KB
testcase_23 AC 30 ms
53,460 KB
testcase_24 AC 30 ms
53,460 KB
testcase_25 AC 33 ms
59,832 KB
testcase_26 AC 41 ms
59,832 KB
testcase_27 AC 41 ms
68,112 KB
testcase_28 AC 29 ms
53,460 KB
testcase_29 WA -
testcase_30 AC 34 ms
59,832 KB
testcase_31 AC 33 ms
61,952 KB
testcase_32 AC 55 ms
89,808 KB
testcase_33 WA -
testcase_34 AC 62 ms
98,220 KB
testcase_35 AC 61 ms
98,220 KB
testcase_36 AC 61 ms
98,220 KB
testcase_37 AC 63 ms
98,220 KB
testcase_38 AC 62 ms
98,220 KB
testcase_39 AC 62 ms
98,220 KB
testcase_40 WA -
testcase_41 AC 61 ms
98,220 KB
testcase_42 AC 62 ms
98,220 KB
testcase_43 AC 62 ms
98,220 KB
testcase_44 AC 72 ms
98,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(t):
    if t in [[0,1,2],[1,2,0],[2,0,1]]:
        return 1
    elif t in [[2,1,0],[1,0,2],[0,2,1]]:
        return 2
    return 0

N = int(input())
A = list(map(int, input().split()))
if N == 1:
    print(f(A))
    exit()
    
ans = [-1] * 4
for i in range(2 * N + 1):
    if A[i] != ans[i%4] and ans[i%4] != -1:
        print(0)
        exit()
    ans[i%4] = A[i]
    
if ans in [[0,1,2,1],[1,2,0,2],[2,0,2,0]]:
    if N % 2:
        print(1)
    else:
        print(2)
elif ans in [[0,2,1,2],[1,0,2,0],[2,1,0,1]]:
    if N % 2:
        print(2)
    else:
        print(1)
else:
    print(0)
0