結果

問題 No.183 たのしい排他的論理和(EASY)
コンテスト
ユーザー Hachimori
提出日時 2015-04-16 23:42:25
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 579 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 321 ms
コンパイル使用メモリ 71,544 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-25 22:56:57
合計ジャッジ時間 1,549 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 WA * 5 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include<numeric>
using namespace std;
const int VAL = 5005;
const int RANGE = (1 << 14) + 5;


int nVal, val[VAL];

void read() {
    cin >> nVal;
    for (int i = 0; i < nVal; ++i)
        cin >> val[i];
}


void work() {
    bool avail[RANGE] = {};
    avail[0] = true;
    
    for (int i = 0; i < RANGE; ++i) {
        if (!avail[i])
            continue;

        for (int j = 0; j < nVal; ++j)
            avail[i ^ val[j]] = true;
    }

    cout << accumulate(avail, avail + RANGE, 0) << endl;
}


int main() {
    read();
    work();
    return 0;
}
0