結果

問題 No.1717 Levi-Civita Triangle
ユーザー 👑 rin204rin204
提出日時 2024-05-06 15:06:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 441 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 152,720 KB
最終ジャッジ日時 2024-05-06 15:06:25
合計ジャッジ時間 5,078 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,968 KB
testcase_01 AC 35 ms
52,096 KB
testcase_02 AC 34 ms
51,712 KB
testcase_03 AC 44 ms
51,712 KB
testcase_04 AC 35 ms
51,968 KB
testcase_05 AC 42 ms
59,904 KB
testcase_06 AC 51 ms
71,168 KB
testcase_07 AC 105 ms
135,424 KB
testcase_08 AC 35 ms
51,840 KB
testcase_09 AC 34 ms
51,456 KB
testcase_10 AC 42 ms
60,032 KB
testcase_11 AC 54 ms
71,040 KB
testcase_12 AC 76 ms
102,144 KB
testcase_13 AC 38 ms
51,712 KB
testcase_14 AC 35 ms
51,712 KB
testcase_15 AC 35 ms
52,480 KB
testcase_16 AC 49 ms
66,944 KB
testcase_17 AC 99 ms
126,464 KB
testcase_18 AC 35 ms
52,352 KB
testcase_19 AC 35 ms
51,968 KB
testcase_20 AC 39 ms
57,728 KB
testcase_21 AC 47 ms
62,720 KB
testcase_22 AC 69 ms
92,160 KB
testcase_23 AC 45 ms
51,968 KB
testcase_24 AC 33 ms
51,840 KB
testcase_25 AC 40 ms
59,648 KB
testcase_26 AC 45 ms
62,208 KB
testcase_27 AC 62 ms
83,200 KB
testcase_28 AC 35 ms
51,328 KB
testcase_29 AC 35 ms
52,224 KB
testcase_30 AC 41 ms
59,904 KB
testcase_31 AC 48 ms
65,152 KB
testcase_32 AC 122 ms
152,720 KB
testcase_33 AC 116 ms
146,432 KB
testcase_34 AC 133 ms
146,688 KB
testcase_35 AC 95 ms
117,504 KB
testcase_36 AC 142 ms
146,304 KB
testcase_37 AC 129 ms
132,064 KB
testcase_38 AC 123 ms
146,176 KB
testcase_39 AC 133 ms
146,580 KB
testcase_40 AC 117 ms
146,524 KB
testcase_41 AC 147 ms
146,944 KB
testcase_42 AC 96 ms
117,760 KB
testcase_43 AC 122 ms
146,816 KB
testcase_44 AC 110 ms
131,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int, input().split()))

for i in range(3):
    X = [i, (i + 1) % 3, (i + 2) % 3]
    for _ in range(n - 1):
        X.append(X[-2])
        X.append(X[-4])

    if A == X:
        print(2 - n % 2)
        exit()

for i in range(3):
    X = [i, (i - 1) % 3, (i - 2) % 3]
    for _ in range(n - 1):
        X.append(X[-2])
        X.append(X[-4])

    if A == X:
        print(1 + n % 2)
        exit()

print(0)
0