結果
問題 | No.1717 Levi-Civita Triangle |
ユーザー | zkou |
提出日時 | 2021-08-04 21:09:17 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 859 bytes |
コンパイル時間 | 168 ms |
コンパイル使用メモリ | 81,776 KB |
実行使用メモリ | 116,840 KB |
最終ジャッジ日時 | 2023-10-24 11:24:43 |
合計ジャッジ時間 | 5,069 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 36 ms
57,688 KB |
testcase_01 | AC | 35 ms
53,340 KB |
testcase_02 | AC | 37 ms
53,340 KB |
testcase_03 | AC | 36 ms
53,340 KB |
testcase_04 | AC | 37 ms
53,340 KB |
testcase_05 | AC | 49 ms
63,764 KB |
testcase_06 | AC | 71 ms
76,368 KB |
testcase_07 | AC | 140 ms
93,824 KB |
testcase_08 | AC | 36 ms
53,340 KB |
testcase_09 | AC | 36 ms
53,340 KB |
testcase_10 | AC | 51 ms
63,768 KB |
testcase_11 | AC | 70 ms
75,624 KB |
testcase_12 | AC | 105 ms
84,832 KB |
testcase_13 | AC | 38 ms
53,340 KB |
testcase_14 | AC | 37 ms
53,340 KB |
testcase_15 | AC | 41 ms
57,436 KB |
testcase_16 | AC | 134 ms
75,596 KB |
testcase_17 | TLE | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
testcase_44 | -- | - |
ソースコード
# 高速化愚直解 想定 TLE import sys input = sys.stdin.buffer.readline N = int(input()) As = list(map(int, input().split())) bit_0 = int(''.join([str(int(e == 0)) for e in As]), 2) bit_1 = int(''.join([str(int(e == 1)) for e in As]), 2) bit_2 = int(''.join([str(int(e == 2)) for e in As]), 2) for i in range(N): l = 2 * (N - i) - 1 bit_10 = bit_1 & (bit_0 >> 1) new_bit_1 = 0 new_bit_1 |= bit_0 & (bit_2 >> 1) & (bit_1 >> 2) new_bit_1 |= bit_2 & (bit_10 >> 1) new_bit_1 |= bit_10 & (bit_2 >> 2) bit_01 = bit_0 & (bit_1 >> 1) new_bit_2 = 0 new_bit_2 |= bit_01 & (bit_2 >> 2) new_bit_2 |= bit_1 & (bit_2 >> 1) & (bit_0 >> 2) new_bit_2 |= bit_2 & (bit_01 >> 1) bit_1 = new_bit_1 bit_2 = new_bit_2 bit_0 = (-1) ^ bit_1 ^ bit_2 if bit_1: print(1) elif bit_2: print(2) else: print(0)