結果

問題 No.2442 線形写像
ユーザー daiota
提出日時 2023-08-25 23:16:36
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 574 bytes
コンパイル時間 1,837 ms
コンパイル使用メモリ 167,744 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-24 11:06:49
合計ジャッジ時間 3,370 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(int i=0;i<int(n);i++)

ll a[(1<<17)+10];

int main(void){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
	int i,j,k;

	ll N;
	cin >> N;

	for(i=0;i<(1<<N);i++) cin >> a[i];

	if(a[0]!=0){
		cout << "No" << endl;
		return 0;
	}

	if(N==1 && a[0]==0){
		cout << "Yes" << endl;
		return 0;
	}

	for(i=3;i<(1<<N);i++){
		if(i%2==0) continue;
		if(a[i]!=(a[1])^(a[i-1])){
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;

	return 0;
}
0