結果

問題 No.1876 Xor of Sum
ユーザー HentciHentci
提出日時 2022-04-27 14:47:19
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 373 ms / 2,000 ms
コード長 686 bytes
コンパイル時間 3,460 ms
コンパイル使用メモリ 242,896 KB
実行使用メモリ 5,120 KB
最終ジャッジ日時 2023-09-10 16:34:53
合計ジャッジ時間 12,147 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
4,968 KB
testcase_01 AC 7 ms
4,864 KB
testcase_02 AC 9 ms
4,972 KB
testcase_03 AC 156 ms
4,884 KB
testcase_04 AC 262 ms
4,836 KB
testcase_05 AC 37 ms
4,984 KB
testcase_06 AC 362 ms
4,812 KB
testcase_07 AC 42 ms
4,812 KB
testcase_08 AC 38 ms
5,116 KB
testcase_09 AC 239 ms
4,888 KB
testcase_10 AC 130 ms
4,864 KB
testcase_11 AC 313 ms
4,812 KB
testcase_12 AC 154 ms
4,848 KB
testcase_13 AC 223 ms
5,120 KB
testcase_14 AC 187 ms
4,840 KB
testcase_15 AC 209 ms
5,116 KB
testcase_16 AC 32 ms
4,868 KB
testcase_17 AC 333 ms
4,864 KB
testcase_18 AC 370 ms
4,812 KB
testcase_19 AC 367 ms
4,972 KB
testcase_20 AC 365 ms
4,988 KB
testcase_21 AC 367 ms
4,812 KB
testcase_22 AC 370 ms
4,816 KB
testcase_23 AC 373 ms
4,816 KB
testcase_24 AC 366 ms
4,860 KB
testcase_25 AC 368 ms
4,868 KB
testcase_26 AC 365 ms
4,904 KB
testcase_27 AC 362 ms
4,816 KB
testcase_28 AC 366 ms
4,984 KB
testcase_29 AC 368 ms
4,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()
#define ar array
#define sz(x) ((int)x.size())
template <class T,class S> inline bool chmin(T &a,const S &b) {return (a> b? a= b, 1: 0);}
template <class T,class S> inline bool chmax(T &a,const S &b) {return (a< b? a= b, 1: 0);}
const int mxN = 2000 * 2000 + 5;
int main(){
    ios_base::sync_with_stdio(false),cin.tie(0);
    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 = 1;i <= mxN;i++)
        if(dp[i]) ans ^= i;

    cout << ans << "\n";

    return 0;
}
0