This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
//Challenge: Accepted
#include <iostream>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <cmath>
#include <set>
#include <utility>
#include <assert.h>
using namespace std;
void debug() {cout << endl;}
template <class T, class ...U> void debug(T a, U ... b) { cout << a << " "; debug(b...);}
template <class T> void pary(T l, T r) {
while (l != r) {cout << *l << " ";l++;}
cout << endl;
}
#define ll long long
#define ld long double
#define maxn 400005
#define mod 1000000007
#define pii pair<int, int>
#define ff first
#define ss second
#define io ios_base::sync_with_stdio(0);cin.tie(0);
vector<int> ans;
void build(int n) {
ans.push_back(0);
int cur = 0;
for (int i = 1;i < (1<<n);i++) {
cur ^= i & (-i);
ans.push_back(cur);
}
}
void print(int x, int n) {
for (int i = 0;i < n;i++) cout << ((x & (1<<i)) ? 1 : 0);
cout << "\n";
}
int main() {
io
int n, k, cy;
cin >> n >> k >> cy;
int st = 0;
for (int i = 0;i < n;i++) {
char c;
cin >> c;
st += (1<<i) * (c - '0');
}
if (k % 2 == 0) {
cout << -1 << "\n";
return 0;
}
cout << (1<<n) << "\n";
if (k == 1) {
build(n);
for (int i = 0;i < (1<<n);i++) print(ans[i] ^ st, n);
} else if (n % (k + 1) == 0) {
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |