結果

問題 No.2442 線形写像
ユーザー hiromi_ayasehiromi_ayase
提出日時 2023-08-25 21:57:25
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 878 bytes
コンパイル時間 4,490 ms
コンパイル使用メモリ 306,744 KB
実行使用メモリ 4,640 KB
最終ジャッジ日時 2023-08-25 21:57:34
合計ジャッジ時間 5,747 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 RE -
testcase_06 AC 1 ms
4,380 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 1 ms
4,380 KB
testcase_10 RE -
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 11 ms
4,376 KB
testcase_16 AC 23 ms
4,496 KB
testcase_17 RE -
testcase_18 AC 26 ms
4,460 KB
testcase_19 AC 27 ms
4,444 KB
testcase_20 AC 23 ms
4,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#include <atcoder/all>
using namespace std;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
#define FAST_IO                \
  ios::sync_with_stdio(false); \
  cin.tie(0);
const i64 INF = 1001001001001001001;
using Modint = atcoder::static_modint<998244353>;


int main() {
  FAST_IO

  int n;
  cin >> n;
  u64 a[1 << n];
  for (auto i : views::iota(0, 1 << n)) {
    cin >> a[i];
  }
  if (a[0] != 0) {
    cout << "No" << endl;
    return 1;
  }

  u64 base[n];
  for (auto i : views::iota(0, n)) {
    base[i] = a[1 << i];
  }

  for (auto i : views::iota(0, 1 << n)) {
    u64 x = 0;

    for (auto j : views::iota(0, n)) {
      if ((i >> j & 1) == 1) {
        x ^= base[j];
      }
    }
    if (x != a[i]) {
      cout << "No" << endl;
      return 1;
    }
  }
  

  cout << "Yes" << endl;
}
0