結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー beetbeet
提出日時 2018-08-09 14:30:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 473 bytes
コンパイル時間 1,554 ms
コンパイル使用メモリ 170,156 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-24 12:02:48
合計ジャッジ時間 4,306 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 3 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 3 ms
4,348 KB
testcase_06 AC 3 ms
4,348 KB
testcase_07 RE -
testcase_08 AC 122 ms
4,348 KB
testcase_09 AC 79 ms
4,348 KB
testcase_10 AC 97 ms
4,348 KB
testcase_11 AC 124 ms
4,348 KB
testcase_12 RE -
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 164 ms
4,348 KB
testcase_15 AC 130 ms
4,348 KB
testcase_16 AC 3 ms
4,348 KB
testcase_17 AC 32 ms
4,348 KB
testcase_18 RE -
testcase_19 AC 16 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  vector<Int> a(n);
  for(Int i=0;i<n;i++) cin>>a[i];
  const Int MAX = 1<<14;
  vector<Int> dp(MAX,0);
  dp[0]=1;
  for(Int i=0;i<n;i++){
    vector<Int> nx(MAX,0);
    for(Int j=0;j<MAX;j++){
      nx[j]|=dp[j];
      nx[j^a[i]]|=dp[j];
    }
    swap(dp,nx);
  }
  Int ans=0;
  for(Int i=0;i<MAX;i++) ans+=!!dp[i];
  cout<<ans<<endl;
  return 0;
}
0