結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー y_mazuny_mazun
提出日時 2015-04-17 00:06:32
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 707 bytes
コンパイル時間 471 ms
コンパイル使用メモリ 44,204 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-17 16:21:59
合計ジャッジ時間 2,950 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 41 ms
4,380 KB
testcase_09 AC 10 ms
4,380 KB
testcase_10 AC 32 ms
4,376 KB
testcase_11 AC 23 ms
4,380 KB
testcase_12 AC 48 ms
4,380 KB
testcase_13 AC 51 ms
4,376 KB
testcase_14 AC 30 ms
4,380 KB
testcase_15 AC 56 ms
4,380 KB
testcase_16 AC 47 ms
4,376 KB
testcase_17 AC 51 ms
4,380 KB
testcase_18 AC 2 ms
4,380 KB
testcase_19 AC 1 ms
4,384 KB
testcase_20 AC 13 ms
4,384 KB
testcase_21 AC 58 ms
4,380 KB
testcase_22 AC 57 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 1 ms
4,376 KB
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 56 ms
4,376 KB
testcase_34 AC 55 ms
4,376 KB
testcase_35 AC 57 ms
4,376 KB
testcase_36 AC 57 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <queue>
typedef long long ll;

#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }

#include <set>

using namespace std;

/*
y1 = x00 * x0 + x10 * x1 + ... + xn0 * xn
y2 = x01 * x0 + x11 * x1 + ... + xn1 * xn
...
yk = x0k * x0 + x1k * x1 + ... + xnk * xn

 */

int main(){
  const int n = getInt();
  vector<ll> a(n);
  REP(i,n) scanf("%lld", &a[i]);

  ll ans = 1;
  REP(i,62){
    int p = 0;
    for(; p < n; p++)
      if(a[p] & (1ll << i))
        break;
    if(p == n) continue;
    ans *= 2;

    REP(j,n) if(a[j] & (1ll << i)){
      a[j] = (a[j] ^ a[p]) | (1ll << i);
    }
  }

  printf("%lld\n", ans);

  return 0;
}
0