結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー hogeover30hogeover30
提出日時 2015-05-12 19:19:59
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 407 bytes
コンパイル時間 940 ms
コンパイル使用メモリ 69,040 KB
実行使用メモリ 5,784 KB
最終ジャッジ日時 2023-09-20 04:32:24
合計ジャッジ時間 22,360 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 4 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 5 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 TLE -
testcase_08 AC 2,155 ms
4,376 KB
testcase_09 AC 1,481 ms
4,436 KB
testcase_10 AC 1,835 ms
4,388 KB
testcase_11 AC 2,359 ms
4,380 KB
testcase_12 AC 8 ms
4,964 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2,493 ms
4,380 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 549 ms
4,456 KB
testcase_18 AC 3,666 ms
5,676 KB
testcase_19 AC 269 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <unordered_set>
using namespace std;
int main()
{
    int n;
    while (cin>>n) {
        unordered_set<int> dp[2];
        int k=0;
        dp[k].insert(0);
        while (n--) {
            int a; cin>>a;
            for(int v: dp[k]) dp[1-k].insert(a^v);
            for(int v: dp[k]) dp[1-k].insert(v);
            k=1-k;
        }
        cout<<dp[k].size()<<endl;
    }
}
0