結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー kyo1kyo1
提出日時 2020-07-10 04:20:39
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 442 bytes
コンパイル時間 1,730 ms
コンパイル使用メモリ 199,432 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 16:44:20
合計ジャッジ時間 4,697 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 RE -
testcase_08 AC 258 ms
5,376 KB
testcase_09 AC 184 ms
5,376 KB
testcase_10 AC 213 ms
5,376 KB
testcase_11 AC 288 ms
5,376 KB
testcase_12 RE -
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 294 ms
5,376 KB
testcase_15 AC 290 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 65 ms
5,376 KB
testcase_18 RE -
testcase_19 AC 34 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  vector<bool> X(1 << 14, false);
  X[0] = true;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < (int)X.size(); j++) {
      X[j ^ A[i]] = X[j ^ A[i]] | X[j];
    }
  }
  cout << count(X.begin(), X.end(), true) << '\n';
  return 0;
}
0