結果

問題 No.2442 線形写像
ユーザー bortikbortik
提出日時 2023-08-25 23:06:57
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 732 bytes
コンパイル時間 2,009 ms
コンパイル使用メモリ 200,336 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-25 23:07:02
合計ジャッジ時間 3,255 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++)
#define rrep(i, n, a) for (int i = (int)(n); i >= (int)(a); i--)

void solve(){
    int n; cin >> n;
    vector<int> a(pow(2,n));
    rep(i,0,pow(2,n)) cin >> a[i];
    if(a[0] != 0){
        cout << "No";
        return;
    }
    rep(i,0,n){
        rep(j,0,n){
            int k = i ^ (1<<j);

            if(k < n){
                if(a[i]^a[1<<j] != a[k]){
                    cout << "No";
                    return;
                }
            }
        }
        
    }
    cout << "Yes";
    return;
}

int main(){

    int t = 1;
    //cin >> t;
    rep(i,0,t) solve();

    return 0;
}
0