Submission #243574

# Submission time Handle Problem Language Result Execution time Memory
243574 2020-07-01T10:40:38 Z toonewbie "The Lyuboyn" code (IZhO19_lyuboyn) C++17
0 / 100
34 ms 6500 KB
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define endl '\n'

const int MOD = 1e9 + 7;
const int N = 10005;

void add(vector<ll> &bs, ll A) {
    for (ll x : bs) A = min(A, A ^ x);
    if (A) {
        bs.push_back(A);
    }
}

int main() {
    ios_base :: sync_with_stdio(0);
    cin.tie(0);
    int n, k;
    cin >> n >> k;
    if (!(k & 1)) return cout << "NO" << endl, 0;
    vector <ll> A;
    for (int i = 0; i < (1 << n); i++) {
        if (__builtin_popcount(i) == k) {
            add(A, i);
        }
    }
    cout << "YES" << endl;
    vector <ll> v, tmp; v.push_back(0); tmp = v;
    for (ll cur : A) {
        for (ll x : tmp) {
            v.push_back(cur ^ x);
        }
        tmp = v;
        reverse(tmp.begin(), tmp.end());
    }
    for (ll x : v) {
        cout << x << endl;
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Expected integer, but "YES" found
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Expected integer, but "YES" found
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Expected integer, but "NO" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 6500 KB Expected integer, but "YES" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 384 KB Expected integer, but "YES" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 6360 KB Expected integer, but "YES" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 33 ms 6500 KB Expected integer, but "YES" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 3436 KB Expected integer, but "YES" found
2 Halted 0 ms 0 KB -