結果
| 問題 | No.387 ハンコ |
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-04-03 03:58:09 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,259 ms / 5,000 ms |
| コード長 | 446 bytes |
| 記録 | |
| コンパイル時間 | 103 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 29,776 KB |
| 最終ジャッジ日時 | 2024-06-28 17:40:46 |
| 合計ジャッジ時間 | 10,502 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
ソースコード
N = int(input())
A = tuple(map(int,input().split()))
B = int(''.join(input().split())[::-1],2)
U = 10 ** 5
color_ind = [[] for _ in range(U + 1)]
for i, x in enumerate(A):
color_ind[x].append(i)
dp = 0
for ind in color_ind:
if not ind:
continue
x = 0
for i in ind:
x |= B << i
dp ^= x
dp ^= (1 << (N + N))
answer = ('ODD' if x == '1' else 'EVEN' for x in bin(dp)[::-1][:N + N - 1])
print('\n'.join(answer))
maspy