結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー tenmantenman
提出日時 2019-01-03 22:15:26
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 572 bytes
コンパイル時間 1,648 ms
コンパイル使用メモリ 166,680 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-03 02:35:08
合計ジャッジ時間 2,790 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 WA -
testcase_08 AC 67 ms
5,376 KB
testcase_09 AC 46 ms
5,376 KB
testcase_10 AC 58 ms
5,376 KB
testcase_11 AC 75 ms
5,376 KB
testcase_12 WA -
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 78 ms
5,376 KB
testcase_15 AC 77 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 18 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 10 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using P = pair<int, int>;

const int INF = 1e9;
const int MOD = 1e9 + 7;

// 4近傍、8近傍
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};

int flag[50000];

int main() {
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++) cin >> a[i];

  flag[0] = 1;
  for (int i = 0; i < N; i++) {
    for (int j = 20010; j >= 0; j--) {
      if (flag[j]) {
        flag[j^a[i]] = 1;
      }
    }
  }

  cout << accumulate(flag, flag + 20010, 0) << endl;
  return 0;
}
0