結果
| 問題 | No.1717 Levi-Civita Triangle | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2022-06-01 13:49:37 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 484 bytes | 
| コンパイル時間 | 193 ms | 
| コンパイル使用メモリ | 82,100 KB | 
| 実行使用メモリ | 96,128 KB | 
| 最終ジャッジ日時 | 2024-09-21 01:29:20 | 
| 合計ジャッジ時間 | 4,408 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 12 WA * 30 | 
ソースコード
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)
            
            
            
        