結果

問題 No.1876 Xor of Sum
ユーザー Shirotsume
提出日時 2023-04-15 15:01:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 703 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 82,324 KB
実行使用メモリ 259,328 KB
最終ジャッジ日時 2024-10-11 01:48:20
合計ジャッジ時間 10,335 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

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