結果

問題 No.1876 Xor of Sum
ユーザー Akidai16Akidai16
提出日時 2022-12-06 01:20:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 256 ms / 2,000 ms
コード長 886 bytes
コンパイル時間 4,828 ms
コンパイル使用メモリ 256,088 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 22:39:50
合計ジャッジ時間 9,656 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
6,816 KB
testcase_01 AC 8 ms
6,816 KB
testcase_02 AC 9 ms
6,944 KB
testcase_03 AC 107 ms
6,944 KB
testcase_04 AC 172 ms
6,940 KB
testcase_05 AC 27 ms
6,944 KB
testcase_06 AC 256 ms
6,940 KB
testcase_07 AC 30 ms
6,944 KB
testcase_08 AC 27 ms
6,944 KB
testcase_09 AC 169 ms
6,944 KB
testcase_10 AC 90 ms
6,944 KB
testcase_11 AC 206 ms
6,944 KB
testcase_12 AC 101 ms
6,940 KB
testcase_13 AC 147 ms
6,940 KB
testcase_14 AC 128 ms
6,944 KB
testcase_15 AC 139 ms
6,940 KB
testcase_16 AC 23 ms
6,944 KB
testcase_17 AC 218 ms
6,940 KB
testcase_18 AC 247 ms
6,940 KB
testcase_19 AC 249 ms
6,948 KB
testcase_20 AC 240 ms
6,944 KB
testcase_21 AC 241 ms
6,944 KB
testcase_22 AC 239 ms
6,944 KB
testcase_23 AC 240 ms
6,940 KB
testcase_24 AC 241 ms
6,940 KB
testcase_25 AC 247 ms
6,944 KB
testcase_26 AC 241 ms
6,944 KB
testcase_27 AC 246 ms
6,940 KB
testcase_28 AC 240 ms
6,944 KB
testcase_29 AC 251 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

#define REP(i, init, n) for(int i = (int)(init); i < (int)(n); i++)
#define All(A) A.begin(), A.end()
#define rAll(A) A.rbegin(), A.rend()

#define vi vector<int>
#define vl vector<long>
#define vvi vector<vector<int>>
#define vvl vector<vector<long>>
#define pint pair<int, int>
#define plong pair<long, long>

int N;
vi A;

void solve() {
    bitset<4000100> bs;
    bs.set(1);
    REP(i, 0, N) {
        bitset<4000100> bs_tmp = bs;
        bs_tmp <<= A[i];
        bs ^= bs_tmp;
    }
    int ans = 0;
    REP(i, 1, 4000010) {
        if(bs[i]) {
            ans ^= (i - 1);
        }
    }
    cout << ans << endl;
}

int main() {
    cin >> N;
    A.resize(N);
    REP(i, 0, N) cin >> A[i];
    solve();
}
0