結果
| 問題 |
No.2442 線形写像
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-25 22:41:35 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 673 bytes |
| コンパイル時間 | 728 ms |
| コンパイル使用メモリ | 71,932 KB |
| 最終ジャッジ日時 | 2025-02-16 14:13:47 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 WA * 4 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
int n2 = 1 << n;
vector<int> A(n2);
for (int i = 0; i < n2; ++i) {
cin >> A[i];
}
for (int b = 0; b < n2; ++b) {
int a = A[b];
int b1 = b;
if (a != (A[b1] ^ A[b ^ b1])) {
cout << "No" << endl;
return 0;
}
int now = b & (b - 1);
while (now > (now ^ b)) {
if (a != (A[now] ^ A[now ^ b])) {
cout << "No" << endl;
return 0;
}
now = (now - 1) & b;
}
}
cout << "Yes" << endl;
return 0;
}