結果
| 問題 |
No.1717 Levi-Civita Triangle
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-01 13:50:31 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 485 bytes |
| コンパイル時間 | 191 ms |
| コンパイル使用メモリ | 82,436 KB |
| 実行使用メモリ | 98,188 KB |
| 最終ジャッジ日時 | 2024-09-21 01:29:24 |
| 合計ジャッジ時間 | 3,844 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 28 |
ソースコード
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 <= 20:
for _ in range(N):
A = calc(A)
print(A[0])
exit()
else:
print(0)