結果

問題 No.1876 Xor of Sum
ユーザー 👑 colognecologne
提出日時 2022-03-13 10:19:36
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 317 ms / 2,000 ms
コード長 421 bytes
コンパイル時間 2,768 ms
コンパイル使用メモリ 111,404 KB
実行使用メモリ 4,896 KB
最終ジャッジ日時 2023-10-17 22:54:58
合計ジャッジ時間 9,928 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 8 ms
4,896 KB
testcase_01 AC 8 ms
4,896 KB
testcase_02 AC 9 ms
4,896 KB
testcase_03 AC 126 ms
4,896 KB
testcase_04 AC 212 ms
4,896 KB
testcase_05 AC 31 ms
4,896 KB
testcase_06 AC 297 ms
4,896 KB
testcase_07 AC 36 ms
4,896 KB
testcase_08 AC 32 ms
4,896 KB
testcase_09 AC 196 ms
4,896 KB
testcase_10 AC 106 ms
4,896 KB
testcase_11 AC 252 ms
4,896 KB
testcase_12 AC 126 ms
4,896 KB
testcase_13 AC 184 ms
4,896 KB
testcase_14 AC 156 ms
4,896 KB
testcase_15 AC 172 ms
4,896 KB
testcase_16 AC 27 ms
4,896 KB
testcase_17 AC 274 ms
4,896 KB
testcase_18 AC 301 ms
4,896 KB
testcase_19 AC 301 ms
4,896 KB
testcase_20 AC 302 ms
4,896 KB
testcase_21 AC 302 ms
4,896 KB
testcase_22 AC 304 ms
4,896 KB
testcase_23 AC 311 ms
4,896 KB
testcase_24 AC 311 ms
4,896 KB
testcase_25 AC 317 ms
4,896 KB
testcase_26 AC 316 ms
4,896 KB
testcase_27 AC 314 ms
4,896 KB
testcase_28 AC 289 ms
4,896 KB
testcase_29 AC 290 ms
4,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bitset>
#include <iostream>
#include <vector>

using namespace std;
using Line = bitset<2000 * 2000 + 1>;
int main()
{
    int N;
    cin >> N;
    Line l = 0;
    l[0] = 1;
    for (int i = 0; i < N; i++)
    {
        int a;
        cin >> a;
        l ^= l << a;
    }
    int ans = 0;
    for (int i = 0; i < (int)l.size(); i++)
    {
        if (l[i])
            ans ^= i;
    }
    cout << ans << endl;
}
0