結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー Fpga18Gansn1230Fpga18Gansn1230
提出日時 2017-10-05 17:27:50
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 251 ms / 5,000 ms
コード長 486 bytes
コンパイル時間 1,238 ms
コンパイル使用メモリ 51,756 KB
実行使用メモリ 286,032 KB
最終ジャッジ日時 2023-09-12 15:16:52
合計ジャッジ時間 2,951 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 3 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 251 ms
286,032 KB
testcase_08 AC 207 ms
192,352 KB
testcase_09 AC 143 ms
151,440 KB
testcase_10 AC 170 ms
200,840 KB
testcase_11 AC 222 ms
242,400 KB
testcase_12 AC 2 ms
4,384 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 192 ms
163,540 KB
testcase_15 AC 231 ms
263,300 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 53 ms
74,056 KB
testcase_18 AC 215 ms
279,424 KB
testcase_19 AC 27 ms
37,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

short int map[5001][0b1000000000000000]={0};

int main(){
  int H;
  int A[5000];
  cin >> H;
  for(int i=0;i<H;i++){
    cin >> A[i];
  }
  map[0][0]=1;
  int count=0;
  for(int i=0;i<H;i++){
    for(int j=0;j<0b1000000000000000;j++){
      if(map[i][j]==1){
        map[i+1][j]=1;
        map[i+1][j^A[i]]=1;
      }
    }
  }
  int counter=0;
  for(int i=0;i<0b1000000000000000;i++){
    counter+=map[H][i];
  }
  cout << counter <<endl;
}
0