結果
問題 |
No.1876 Xor of Sum
|
ユーザー |
|
提出日時 | 2022-03-13 21:34:26 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 239 bytes |
コンパイル時間 | 143 ms |
コンパイル使用メモリ | 82,376 KB |
実行使用メモリ | 128,072 KB |
最終ジャッジ日時 | 2024-09-19 05:13:38 |
合計ジャッジ時間 | 3,753 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 26 |
ソースコード
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) ^ dp S += a ans = 0 for i in range(1,S+1): dp >>= 1 if dp & 1: ans ^= i print(ans)