結果

問題 No.1876 Xor of Sum
ユーザー ああいいああいい
提出日時 2022-03-13 21:50:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,248 ms / 2,000 ms
コード長 270 bytes
コンパイル時間 597 ms
コンパイル使用メモリ 81,600 KB
実行使用メモリ 470,556 KB
最終ジャッジ日時 2023-10-19 09:17:21
合計ジャッジ時間 15,574 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,232 KB
testcase_01 AC 40 ms
53,232 KB
testcase_02 AC 39 ms
53,232 KB
testcase_03 AC 195 ms
174,200 KB
testcase_04 AC 348 ms
247,920 KB
testcase_05 AC 64 ms
84,020 KB
testcase_06 AC 534 ms
269,068 KB
testcase_07 AC 70 ms
90,060 KB
testcase_08 AC 66 ms
85,616 KB
testcase_09 AC 312 ms
234,300 KB
testcase_10 AC 147 ms
139,044 KB
testcase_11 AC 435 ms
270,420 KB
testcase_12 AC 195 ms
174,792 KB
testcase_13 AC 292 ms
230,068 KB
testcase_14 AC 229 ms
197,132 KB
testcase_15 AC 252 ms
197,456 KB
testcase_16 AC 61 ms
80,228 KB
testcase_17 AC 472 ms
260,096 KB
testcase_18 AC 544 ms
270,236 KB
testcase_19 AC 542 ms
273,052 KB
testcase_20 AC 531 ms
268,828 KB
testcase_21 AC 539 ms
275,596 KB
testcase_22 AC 547 ms
272,828 KB
testcase_23 AC 1,119 ms
439,404 KB
testcase_24 AC 1,246 ms
438,736 KB
testcase_25 AC 1,248 ms
439,624 KB
testcase_26 AC 1,141 ms
440,132 KB
testcase_27 AC 1,100 ms
439,516 KB
testcase_28 AC 1,125 ms
470,556 KB
testcase_29 AC 85 ms
61,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
rr = sys.stdin

N = int(rr.readline())
A = list(map(int,rr.readline().split()))

dp = 1
S = 0
for a in A:
    dp ^= (dp << a)
    S += a
ans = 0
mask = 1

T = list(map(int,list(bin(dp)[2:])))
for i in range(1,S+1):
    if T[-1-i]:
        ans ^= i
print(ans)
0