結果

問題 No.1876 Xor of Sum
ユーザー 00 0000 00
提出日時 2022-05-03 17:31:43
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 341 bytes
コンパイル時間 2,625 ms
コンパイル使用メモリ 244,856 KB
実行使用メモリ 5,084 KB
最終ジャッジ日時 2023-09-15 10:35:22
合計ジャッジ時間 10,448 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
4,812 KB
testcase_01 AC 7 ms
4,892 KB
testcase_02 AC 9 ms
5,004 KB
testcase_03 AC 142 ms
4,856 KB
testcase_04 AC 243 ms
4,800 KB
testcase_05 AC 35 ms
4,940 KB
testcase_06 AC 340 ms
5,084 KB
testcase_07 AC 40 ms
4,856 KB
testcase_08 AC 35 ms
4,832 KB
testcase_09 AC 224 ms
5,004 KB
testcase_10 AC 123 ms
4,804 KB
testcase_11 AC 289 ms
4,804 KB
testcase_12 AC 142 ms
4,780 KB
testcase_13 AC 209 ms
4,876 KB
testcase_14 AC 177 ms
4,812 KB
testcase_15 AC 194 ms
4,780 KB
testcase_16 AC 29 ms
4,804 KB
testcase_17 AC 307 ms
4,764 KB
testcase_18 AC 343 ms
4,832 KB
testcase_19 AC 344 ms
4,808 KB
testcase_20 AC 342 ms
4,812 KB
testcase_21 AC 339 ms
4,856 KB
testcase_22 AC 346 ms
4,764 KB
testcase_23 AC 342 ms
4,776 KB
testcase_24 AC 345 ms
4,920 KB
testcase_25 AC 340 ms
4,780 KB
testcase_26 AC 338 ms
4,800 KB
testcase_27 AC 338 ms
4,920 KB
testcase_28 WA -
testcase_29 AC 341 ms
4,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0