結果
問題 |
No.1876 Xor of Sum
|
ユーザー |
|
提出日時 | 2022-05-03 17:31:43 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 341 bytes |
コンパイル時間 | 2,683 ms |
コンパイル使用メモリ | 245,568 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-02 14:20:47 |
合計ジャッジ時間 | 10,515 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 26 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; const int mxN = 4e6; int main(){ int n; cin >> n; bitset <mxN> dp; dp[0] = 1; for(int i = 0, a;i < n;i++){ cin >> a; dp ^= (dp << a); } int ans = 0; for(int i = 0;i < mxN;i++) if(dp[i]) ans ^= i; cout << ans << "\n"; return 0; }