結果

問題 No.1876 Xor of Sum
ユーザー ShirotsumeShirotsume
提出日時 2023-04-15 15:01:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 731 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 259,656 KB
最終ジャッジ日時 2024-04-19 09:15:47
合計ジャッジ時間 10,978 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,096 KB
testcase_01 AC 42 ms
51,840 KB
testcase_02 AC 42 ms
51,584 KB
testcase_03 AC 133 ms
82,432 KB
testcase_04 AC 297 ms
193,856 KB
testcase_05 AC 59 ms
73,028 KB
testcase_06 AC 454 ms
258,560 KB
testcase_07 AC 62 ms
77,204 KB
testcase_08 AC 67 ms
73,984 KB
testcase_09 AC 254 ms
161,536 KB
testcase_10 AC 110 ms
81,024 KB
testcase_11 AC 381 ms
259,072 KB
testcase_12 AC 120 ms
82,504 KB
testcase_13 AC 213 ms
133,716 KB
testcase_14 AC 146 ms
84,752 KB
testcase_15 AC 195 ms
111,616 KB
testcase_16 AC 61 ms
70,144 KB
testcase_17 AC 410 ms
258,432 KB
testcase_18 AC 458 ms
258,828 KB
testcase_19 AC 451 ms
258,752 KB
testcase_20 AC 445 ms
258,672 KB
testcase_21 AC 454 ms
258,572 KB
testcase_22 AC 460 ms
258,876 KB
testcase_23 AC 718 ms
258,908 KB
testcase_24 AC 731 ms
259,656 KB
testcase_25 AC 719 ms
258,992 KB
testcase_26 AC 721 ms
258,840 KB
testcase_27 AC 716 ms
258,556 KB
testcase_28 AC 711 ms
259,024 KB
testcase_29 AC 48 ms
62,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
dp = 1

for i in a:
    dp ^= dp << i
dp = str(bin(dp))[2:][::-1]
ans = 0
for i, v in enumerate(dp):
    if v == '1':
        ans ^= i
print(ans)
0