結果

問題 No.387 ハンコ
ユーザー maspymaspy
提出日時 2020-04-03 04:02:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 905 ms / 5,000 ms
コード長 295 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,960 KB
実行使用メモリ 29,176 KB
最終ジャッジ日時 2023-09-11 03:09:25
合計ジャッジ時間 8,433 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 905 ms
28,756 KB
testcase_01 AC 898 ms
28,744 KB
testcase_02 AC 749 ms
29,176 KB
testcase_03 AC 748 ms
29,100 KB
testcase_04 AC 183 ms
21,116 KB
testcase_05 AC 419 ms
24,796 KB
testcase_06 AC 686 ms
27,996 KB
testcase_07 AC 878 ms
28,692 KB
testcase_08 AC 857 ms
24,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=map(int,input().split())
B=int(''.join(input().split())[::-1],2)
C=[[] for _ in range(1<<17)]
for i,x in enumerate(A):
  C[x]+=[i]
d=0
for I in C:
  x = 0
  for i in I:
    x|=B<<i
  d^=x
d^=(1<<N+N)
print('\n'.join('ODD' if x == '1' else 'EVEN' for x in bin(d)[::-1][:N+N-1]))
0