結果

問題 No.1876 Xor of Sum
ユーザー lloyz
提出日時 2022-03-13 22:35:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 242 bytes
コンパイル時間 72 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 52,500 KB
最終ジャッジ日時 2024-09-19 06:14:11
合計ジャッジ時間 59,164 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 TLE * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np

n = int(input())
A = list(map(int, input().split()))
DP = np.zeros(4000005, np.bool_)
DP[0] = 1
for i in range(n):
    DP[A[i]:] ^= DP[:-A[i]]

ans = 0
for i in range(1, 4000001):
    if DP[i]:
        ans ^= i
print(ans)
0