結果

問題 No.2442 線形写像
ユーザー Nzt3
提出日時 2023-08-25 21:40:04
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 416 bytes
コンパイル時間 1,703 ms
コンパイル使用メモリ 194,260 KB
最終ジャッジ日時 2025-02-16 13:51:26
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll=long long;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin>>N;
  vector A(1<<N,0ull);
  for(auto &i:A)cin>>i;
  if(A[0]!=0){
    cout<<"No\n";
    return 0;
  }
  for(int i=0;i<N;i++){
    for(int j=0;j<1<<N;j++){
      if((A[j]^A[1<<i])!=A[(j^(1<<i))]){
        cout<<"No\n";
        return 0;
      }
    }
  }
  cout<<"Yes\n";
}
0