結果

問題 No.387 ハンコ
ユーザー titiatitia
提出日時 2023-01-31 02:59:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 4,075 ms / 5,000 ms
コード長 465 bytes
コンパイル時間 388 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 105,988 KB
最終ジャッジ日時 2023-09-12 22:21:32
合計ジャッジ時間 31,438 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4,075 ms
105,632 KB
testcase_01 AC 4,007 ms
105,988 KB
testcase_02 AC 3,301 ms
103,804 KB
testcase_03 AC 3,232 ms
103,520 KB
testcase_04 AC 470 ms
86,796 KB
testcase_05 AC 1,487 ms
95,336 KB
testcase_06 AC 2,678 ms
102,304 KB
testcase_07 AC 3,368 ms
104,140 KB
testcase_08 AC 3,347 ms
104,440 KB
権限があれば一括ダウンロードができます

ソースコード

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