結果
問題 | No.1717 Levi-Civita Triangle |
ユーザー | hari64 |
提出日時 | 2021-10-22 23:03:25 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,354 bytes |
コンパイル時間 | 360 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 14,360 KB |
最終ジャッジ日時 | 2024-09-23 06:57:30 |
合計ジャッジ時間 | 31,654 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 32 ms
10,880 KB |
testcase_01 | AC | 31 ms
10,880 KB |
testcase_02 | AC | 32 ms
11,008 KB |
testcase_03 | AC | 32 ms
11,008 KB |
testcase_04 | AC | 33 ms
11,008 KB |
testcase_05 | AC | 43 ms
11,008 KB |
testcase_06 | AC | 190 ms
11,392 KB |
testcase_07 | AC | 1,054 ms
13,140 KB |
testcase_08 | AC | 32 ms
11,008 KB |
testcase_09 | AC | 31 ms
11,008 KB |
testcase_10 | AC | 45 ms
11,008 KB |
testcase_11 | AC | 177 ms
11,264 KB |
testcase_12 | AC | 612 ms
11,976 KB |
testcase_13 | AC | 31 ms
10,880 KB |
testcase_14 | AC | 32 ms
10,880 KB |
testcase_15 | WA | - |
testcase_16 | AC | 152 ms
11,136 KB |
testcase_17 | WA | - |
testcase_18 | AC | 32 ms
10,880 KB |
testcase_19 | AC | 32 ms
10,880 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 31 ms
11,008 KB |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 67 ms
11,136 KB |
testcase_27 | AC | 421 ms
11,776 KB |
testcase_28 | AC | 31 ms
10,880 KB |
testcase_29 | WA | - |
testcase_30 | AC | 45 ms
11,008 KB |
testcase_31 | AC | 117 ms
11,008 KB |
testcase_32 | AC | 1,535 ms
13,624 KB |
testcase_33 | WA | - |
testcase_34 | AC | 1,785 ms
14,100 KB |
testcase_35 | WA | - |
testcase_36 | AC | 1,786 ms
14,108 KB |
testcase_37 | WA | - |
testcase_38 | AC | 1,788 ms
14,228 KB |
testcase_39 | AC | 1,791 ms
14,108 KB |
testcase_40 | WA | - |
testcase_41 | AC | 1,779 ms
14,100 KB |
testcase_42 | WA | - |
testcase_43 | AC | 1,928 ms
14,100 KB |
testcase_44 | WA | - |
ソースコード
N = int(input()) As = list(map(int, input().split())) cnt = 0 while len(As) >= 3 and cnt <= 10: 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)