結果

問題 No.387 ハンコ
ユーザー titia
提出日時 2023-01-31 02:59:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 4,039 ms / 5,000 ms
コード長 465 bytes
コンパイル時間 504 ms
コンパイル使用メモリ 82,468 KB
実行使用メモリ 105,504 KB
最終ジャッジ日時 2024-12-19 12:55:53
合計ジャッジ時間 32,296 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

LIST=[[] for i in range(100001)]

for i in range(N):
    LIST[A[i]].append(i)

now=0
for i in range(N):
    if B[i]==1:
        now^=(1<<i)

ANS=0

for i in range(100001):
    if LIST[i]==[]:
        continue

    score=0
    for j in LIST[i]:
        score|=now<<j
    ANS^=score

for i in range(2*N-1):
    if ANS & (1<<i) ==0:
        print("EVEN")
    else:
        print("ODD")
0