結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー rpy3cpp
提出日時 2015-04-17 09:11:21
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 227 ms / 5,000 ms
コード長 398 bytes
コンパイル時間 356 ms
コンパイル使用メモリ 55,656 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-29 01:44:20
合計ジャッジ時間 2,615 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
constexpr int MAXN = 32768;

int main()
{
    int n;
    bool b[MAXN] = {0};
    b[0] = true;
    cin >> n;
    int a;
    for(int i = 0; i != n; ++i){
        cin >> a;
        for(int j = 0; j != MAXN; ++j) if(b[j]) b[j ^ a] = true;
    }
    int result = 0;
    for(int j = 0; j != MAXN; ++j) result += b[j];
    cout << result << endl;
    return 0;
}
0