Submission #5909511


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for (ll i = (a); i < (b); i++)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

signed main() {
    ll M, K;
    cin>>M>>K;
    if (K < 0 || K >= (1<<M)) {
        cout<<-1<<endl;
        return 0;
    }

    if (M == 1) {
        if (K == 0) {
            cout<<"0 0 1 1"<<endl;
        } else {
            cout<<-1<<endl;
        }
        return 0;
    }

    rep(i, 0, 1<<M){
        if (i != K) {
            cout<<i<<" ";
        }
    }
    cout<<K<<" ";
    for (ll i=(1<<M)-1; i>=0; i--) {
        if (i != K) {
            cout<<i<<" ";
        }
    }
    cout<<K<<endl;

    return 0;
}

Submission Info

Submission Time
Task F - XOR Matching
User bobuhiro11
Language C++14 (GCC 5.4.1)
Score 600
Code Size 733 Byte
Status
Exec Time 24 ms
Memory 1920 KB

Test Cases

Set Name Score / Max Score Test Cases
All 600 / 600 sample_01, sample_02, sample_03, testcase_01, testcase_02, testcase_03, testcase_04, testcase_05, testcase_06, testcase_07, testcase_08, testcase_09, testcase_10, testcase_11, testcase_12, testcase_13, testcase_14, testcase_15, testcase_16, testcase_17, testcase_18, testcase_19, testcase_20, testcase_21, testcase_22, testcase_23, testcase_24, testcase_25, testcase_26, testcase_27, testcase_28, testcase_29, testcase_30, testcase_31, testcase_32, testcase_33, testcase_34, testcase_35, testcase_36, testcase_37, testcase_38, testcase_39, testcase_40
Sample 0 / 0 sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
sample_01 1 ms 256 KB
sample_02 1 ms 256 KB
sample_03 1 ms 256 KB
testcase_01 1 ms 256 KB
testcase_02 1 ms 256 KB
testcase_03 1 ms 256 KB
testcase_04 1 ms 256 KB
testcase_05 1 ms 256 KB
testcase_06 24 ms 1792 KB
testcase_07 24 ms 1792 KB
testcase_08 24 ms 1792 KB
testcase_09 24 ms 1792 KB
testcase_10 24 ms 1920 KB
testcase_11 24 ms 1792 KB
testcase_12 24 ms 1792 KB
testcase_13 24 ms 1792 KB
testcase_14 1 ms 256 KB
testcase_15 1 ms 256 KB
testcase_16 1 ms 256 KB
testcase_17 1 ms 256 KB
testcase_18 1 ms 256 KB
testcase_19 1 ms 256 KB
testcase_20 1 ms 256 KB
testcase_21 1 ms 256 KB
testcase_22 1 ms 256 KB
testcase_23 1 ms 256 KB
testcase_24 1 ms 256 KB
testcase_25 1 ms 256 KB
testcase_26 3 ms 384 KB
testcase_27 1 ms 256 KB
testcase_28 2 ms 256 KB
testcase_29 1 ms 256 KB
testcase_30 1 ms 256 KB
testcase_31 1 ms 256 KB
testcase_32 2 ms 256 KB
testcase_33 1 ms 256 KB
testcase_34 7 ms 640 KB
testcase_35 1 ms 256 KB
testcase_36 1 ms 256 KB
testcase_37 1 ms 256 KB
testcase_38 1 ms 256 KB
testcase_39 1 ms 256 KB
testcase_40 1 ms 256 KB