結果

問題 No.1717 Levi-Civita Triangle
ユーザー KudeKude
提出日時 2021-10-22 23:12:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 81,716 KB
実行使用メモリ 115,636 KB
最終ジャッジ日時 2023-10-24 15:14:19
合計ジャッジ時間 3,805 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,388 KB
testcase_01 AC 35 ms
53,388 KB
testcase_02 AC 35 ms
53,388 KB
testcase_03 AC 34 ms
53,388 KB
testcase_04 AC 34 ms
53,388 KB
testcase_05 AC 39 ms
60,012 KB
testcase_06 AC 41 ms
65,120 KB
testcase_07 AC 67 ms
93,664 KB
testcase_08 AC 35 ms
53,388 KB
testcase_09 AC 34 ms
53,388 KB
testcase_10 AC 39 ms
60,012 KB
testcase_11 AC 41 ms
64,520 KB
testcase_12 AC 53 ms
78,868 KB
testcase_13 AC 36 ms
53,388 KB
testcase_14 AC 34 ms
53,388 KB
testcase_15 AC 35 ms
53,388 KB
testcase_16 AC 42 ms
64,268 KB
testcase_17 AC 77 ms
103,620 KB
testcase_18 AC 37 ms
53,388 KB
testcase_19 AC 37 ms
53,388 KB
testcase_20 AC 35 ms
53,388 KB
testcase_21 AC 41 ms
64,268 KB
testcase_22 AC 66 ms
90,832 KB
testcase_23 AC 35 ms
53,388 KB
testcase_24 AC 36 ms
53,388 KB
testcase_25 AC 39 ms
60,012 KB
testcase_26 AC 42 ms
62,220 KB
testcase_27 AC 50 ms
72,884 KB
testcase_28 AC 35 ms
53,388 KB
testcase_29 AC 34 ms
53,388 KB
testcase_30 AC 40 ms
60,012 KB
testcase_31 AC 42 ms
64,268 KB
testcase_32 AC 82 ms
103,920 KB
testcase_33 AC 90 ms
115,636 KB
testcase_34 AC 90 ms
115,636 KB
testcase_35 AC 90 ms
115,636 KB
testcase_36 AC 90 ms
115,636 KB
testcase_37 AC 90 ms
115,636 KB
testcase_38 AC 90 ms
115,636 KB
testcase_39 AC 89 ms
115,636 KB
testcase_40 AC 90 ms
115,636 KB
testcase_41 AC 91 ms
115,636 KB
testcase_42 AC 89 ms
115,636 KB
testcase_43 AC 89 ms
115,636 KB
testcase_44 AC 89 ms
115,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
d = []
for x, y in zip(a, a[1:]):
    d.append((y - x + 1) % 3 - 1)

m = len(d)
for i in range(0, m, 2):
    if d[i] != d[i + 1]:
        print(0)
        exit(0)
for i in range(0, m - 2, 2):
    if d[i] != -d[i + 2]:
        print(0)
        exit(0)
print(d[m - 1] % 3)
0