結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー HeyHey0111HeyHey0111
提出日時 2016-03-07 23:33:19
言語 C++11
(gcc 11.4.0)
結果
MLE  
実行時間 -
コード長 490 bytes
コンパイル時間 1,364 ms
コンパイル使用メモリ 68,876 KB
実行使用メモリ 813,876 KB
最終ジャッジ日時 2023-10-24 19:02:39
合計ジャッジ時間 6,561 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>
#include<set>
using namespace std;


int main(){
  set<int> dp[5001];
  dp[0].insert(0);
  int N;
  cin  >> N;
  vector<int> A(N);
  for(int i= 0 ; i< N; i++){
      cin >> A[i];
  }
  for(int i=1;i<=N;i++){
      dp[i].insert(0);
      for (set<int>::iterator iti = dp[i-1].begin(); iti != dp[i-1].end(); iti++) {
          dp[i].insert(*iti);
          dp[i].insert((*iti)^A[i-1]);
      }
  }
  cout<<dp[N].size()<<endl;
  return 0;
}
0