結果
問題 |
No.1876 Xor of Sum
|
ユーザー |
![]() |
提出日時 | 2022-03-16 17:19:22 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 261 bytes |
コンパイル時間 | 144 ms |
コンパイル使用メモリ | 82,320 KB |
実行使用メモリ | 89,044 KB |
最終ジャッジ日時 | 2024-09-24 17:34:54 |
合計ジャッジ時間 | 3,778 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 26 |
ソースコード
N = int(input()) A = list(map(int, input().split())) U = sum(A) dp = [0] * (U + 1) dp[0] = 1 for a in A: for i in reversed(range(a, U+1)): dp[i] += dp[i-a] dp[i] %= 2 ans = 0 for i in range(U+1): if dp[i]: ans ^= i print(ans)