結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー huka_hukahuka_huka
提出日時 2021-09-24 18:46:49
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 823 bytes
コンパイル時間 1,870 ms
コンパイル使用メモリ 147,860 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-18 20:17:45
合計ジャッジ時間 3,987 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 185 ms
4,376 KB
testcase_08 AC 94 ms
4,380 KB
testcase_09 AC 65 ms
4,376 KB
testcase_10 AC 77 ms
4,380 KB
testcase_11 AC 103 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 107 ms
4,380 KB
testcase_16 WA -
testcase_17 AC 25 ms
4,380 KB
testcase_18 AC 181 ms
4,376 KB
testcase_19 AC 13 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# ifndef ONLINE_JUDGE
# define _GLIBCXX_DEBUG
# endif
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using pii = pair<int, int>;
# define rep(i, n) for(int i = 0; i < (int)(n); i++)
# define all(v) v.begin(), v.end()

int main(){
  constexpr char endl = '\n';
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(10);
  //input();
  int N;cin >> N;
  vi A(N);
  for(auto &&e : A)  cin >> e;
  //solve();
  vector<bool> dp(pow(2, 15), false);
  //dp[i]:=iを作れるか
  dp[0] = true;
  rep(i, N){
    dp[A[i]] = true;
  }
  rep(i, pow(2, 15)){
    if(!dp[i])  continue;
    for(int &a : A){
      dp[i^a] = true;
    }
  }
  //output();
  int cnt = 0;
  for(bool &&e : dp)  if(e)  ++cnt;
  cout << cnt << endl;
}
0