結果

問題 No.1876 Xor of Sum
ユーザー ああいいああいい
提出日時 2022-03-13 21:47:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 687 ms / 2,000 ms
コード長 252 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 81,716 KB
実行使用メモリ 258,632 KB
最終ジャッジ日時 2023-10-19 09:14:26
合計ジャッジ時間 10,615 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,468 KB
testcase_01 AC 39 ms
53,468 KB
testcase_02 AC 37 ms
53,468 KB
testcase_03 AC 100 ms
79,972 KB
testcase_04 AC 265 ms
189,320 KB
testcase_05 AC 48 ms
62,612 KB
testcase_06 AC 458 ms
258,036 KB
testcase_07 AC 58 ms
64,900 KB
testcase_08 AC 48 ms
62,668 KB
testcase_09 AC 218 ms
157,460 KB
testcase_10 AC 88 ms
79,012 KB
testcase_11 AC 346 ms
258,100 KB
testcase_12 AC 102 ms
80,056 KB
testcase_13 AC 189 ms
129,892 KB
testcase_14 AC 125 ms
81,432 KB
testcase_15 AC 161 ms
108,280 KB
testcase_16 AC 47 ms
62,496 KB
testcase_17 AC 372 ms
258,100 KB
testcase_18 AC 429 ms
258,352 KB
testcase_19 AC 421 ms
258,172 KB
testcase_20 AC 420 ms
258,164 KB
testcase_21 AC 428 ms
258,080 KB
testcase_22 AC 432 ms
258,152 KB
testcase_23 AC 682 ms
258,300 KB
testcase_24 AC 679 ms
258,612 KB
testcase_25 AC 682 ms
258,308 KB
testcase_26 AC 682 ms
258,332 KB
testcase_27 AC 687 ms
258,376 KB
testcase_28 AC 669 ms
258,632 KB
testcase_29 AC 44 ms
60,004 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 = bin(dp)
for i in range(1,S+1):
    if T[-1-i] == "1":
        ans ^= i
print(ans)
0