結果
問題 | No.1717 Levi-Civita Triangle |
ユーザー | hari64 |
提出日時 | 2021-10-22 22:59:42 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,353 bytes |
コンパイル時間 | 543 ms |
コンパイル使用メモリ | 82,300 KB |
実行使用メモリ | 108,772 KB |
最終ジャッジ日時 | 2024-09-23 06:52:08 |
合計ジャッジ時間 | 4,532 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 38 ms
53,724 KB |
testcase_01 | WA | - |
testcase_02 | AC | 37 ms
52,008 KB |
testcase_03 | AC | 39 ms
52,192 KB |
testcase_04 | AC | 38 ms
54,028 KB |
testcase_05 | AC | 44 ms
62,084 KB |
testcase_06 | AC | 81 ms
76,892 KB |
testcase_07 | AC | 104 ms
93,072 KB |
testcase_08 | AC | 37 ms
53,408 KB |
testcase_09 | AC | 38 ms
52,452 KB |
testcase_10 | AC | 46 ms
61,672 KB |
testcase_11 | AC | 82 ms
76,452 KB |
testcase_12 | AC | 92 ms
84,784 KB |
testcase_13 | WA | - |
testcase_14 | AC | 38 ms
52,320 KB |
testcase_15 | WA | - |
testcase_16 | AC | 57 ms
68,408 KB |
testcase_17 | WA | - |
testcase_18 | AC | 39 ms
52,544 KB |
testcase_19 | AC | 38 ms
53,056 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 37 ms
53,948 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 56 ms
66,348 KB |
testcase_27 | AC | 61 ms
73,188 KB |
testcase_28 | AC | 38 ms
53,000 KB |
testcase_29 | WA | - |
testcase_30 | AC | 50 ms
63,632 KB |
testcase_31 | AC | 57 ms
67,512 KB |
testcase_32 | AC | 92 ms
99,528 KB |
testcase_33 | WA | - |
testcase_34 | AC | 97 ms
106,160 KB |
testcase_35 | WA | - |
testcase_36 | AC | 96 ms
105,548 KB |
testcase_37 | WA | - |
testcase_38 | AC | 95 ms
105,964 KB |
testcase_39 | AC | 108 ms
107,764 KB |
testcase_40 | WA | - |
testcase_41 | AC | 107 ms
108,088 KB |
testcase_42 | WA | - |
testcase_43 | AC | 107 ms
108,772 KB |
testcase_44 | WA | - |
ソースコード
N = int(input()) As = list(map(int, input().split())) cnt = 0 while len(As) >= 3 and cnt <= 0: cnt += 1 Bs = [None]*(len(As)-2) for i in range(1, len(As)-1): if (As[i - 1] == 0 and As[i] == 1 and As[i + 1] == 2): Bs[i - 1] = 1 elif (As[i - 1] == 1 and As[i] == 2 and As[i + 1] == 0): Bs[i - 1] = 1 elif (As[i - 1] == 2 and As[i] == 0 and As[i + 1] == 1): Bs[i - 1] = 1 elif (As[i - 1] == 2 and As[i] == 1 and As[i + 1] == 0): Bs[i - 1] = 2 elif (As[i - 1] == 1 and As[i] == 0 and As[i + 1] == 2): Bs[i - 1] = 2 elif (As[i - 1] == 0 and As[i] == 2 and As[i + 1] == 1): Bs[i - 1] = 2 else: Bs[i - 1] = 0 As = Bs # print(As) if (len(As) == 1): print(As[0]) exit() if all(i == 0 for i in As[1::2]): if all(i == 1 for i in As[::4]) and all(i == 2 for i in As[2::4]) and len(As) % 4 == 3: print(1) elif all(i == 2 for i in As[::4]) and all(i == 1 for i in As[2::4]) and len(As) % 4 == 1: print(2) elif all(i == 1 for i in As[::4]) and all(i == 2 for i in As[2::4]) and len(As) % 4 == 1: print(2) elif all(i == 2 for i in As[::4]) and all(i == 1 for i in As[2::4]) and len(As) % 4 == 3: print(1) else: print(0) else: print(0)