結果

問題 No.1717 Levi-Civita Triangle
ユーザー ああいいああいい
提出日時 2022-06-01 13:49:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 484 bytes
コンパイル時間 180 ms
コンパイル使用メモリ 81,856 KB
実行使用メモリ 95,868 KB
最終ジャッジ日時 2023-10-21 00:48:45
合計ジャッジ時間 5,273 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,444 KB
testcase_01 AC 38 ms
53,444 KB
testcase_02 AC 38 ms
53,444 KB
testcase_03 AC 38 ms
53,444 KB
testcase_04 AC 38 ms
53,444 KB
testcase_05 AC 42 ms
59,460 KB
testcase_06 AC 43 ms
62,088 KB
testcase_07 AC 59 ms
82,144 KB
testcase_08 AC 41 ms
53,444 KB
testcase_09 AC 38 ms
53,444 KB
testcase_10 AC 41 ms
59,460 KB
testcase_11 AC 42 ms
61,784 KB
testcase_12 AC 50 ms
71,776 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 38 ms
53,444 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 37 ms
53,444 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

s1 = {(0,1,2),(1,2,0),(2,0,1)}
s2 = {(2,1,0),(1,0,2),(0,2,1)}

import sys
def calc(l):
    n = len(l)
    ans = []
    for i in range(1,n - 1):
        if (l[i-1],l[i],l[i+1]) in s1:
            ans.append(1)
        elif (l[i-1],l[i],l[i+1]) in s2:
            ans.append(2)
        else:
            ans.append(0)
    return ans
if N <= 5:
    for _ in range(N):
        A = calc(A)
    print(A[0])
    exit()
else:
    print(0)
0