結果
| 問題 | 
                            No.2442 線形写像
                             | 
                    
| コンテスト | |
| ユーザー | 
                             hiromi_ayase
                         | 
                    
| 提出日時 | 2023-08-25 21:57:57 | 
| 言語 | C++23  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 34 ms / 2,000 ms | 
| コード長 | 878 bytes | 
| コンパイル時間 | 4,645 ms | 
| コンパイル使用メモリ | 308,476 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-25 08:01:43 | 
| 合計ジャッジ時間 | 5,687 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 22 | 
ソースコード
#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 0;
  }
  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 0;
    }
  }
  
  cout << "Yes" << endl;
}
            
            
            
        
            
hiromi_ayase