結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー suakiisuakii
提出日時 2019-05-01 11:28:36
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 279 ms / 5,000 ms
コード長 455 bytes
コンパイル時間 1,359 ms
コンパイル使用メモリ 143,116 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-14 16:10:44
合計ジャッジ時間 4,096 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 271 ms
4,384 KB
testcase_08 AC 249 ms
4,376 KB
testcase_09 AC 172 ms
4,376 KB
testcase_10 AC 206 ms
4,380 KB
testcase_11 AC 269 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 248 ms
4,380 KB
testcase_15 AC 279 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 63 ms
4,380 KB
testcase_18 AC 254 ms
4,380 KB
testcase_19 AC 31 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const int MAX = 1 << 15;
int dp[MAX];

int main() {
    ios::sync_with_stdio(false);
    int n, t; cin >> n;
    dp[0] = true;
    for (int i = 0; i < n; i++) {
        cin >> t;
        for (int j = 0; j < MAX; j++)
            if(dp[j])
                dp[t ^ j] = true;
    }
    int ans = 0;
    for (int i = 0; i < MAX; i++)
        if(dp[i])
            ans++;
    cout << ans << endl;

    return 0;
}
0