//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 |
1 |
Correct |
0 ms |
204 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
The output is not complete! |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Ok |
2 |
Correct |
1 ms |
204 KB |
Ok |
3 |
Correct |
1 ms |
204 KB |
Ok |
4 |
Correct |
0 ms |
204 KB |
Ok |
5 |
Correct |
1 ms |
204 KB |
Ok |
6 |
Correct |
1 ms |
204 KB |
Ok |
7 |
Correct |
1 ms |
204 KB |
Ok |
8 |
Correct |
0 ms |
204 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
277 ms |
6472 KB |
Ok |
2 |
Correct |
130 ms |
3244 KB |
Ok |
3 |
Correct |
1 ms |
204 KB |
Ok |
4 |
Correct |
1 ms |
204 KB |
Ok |
5 |
Correct |
1 ms |
204 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
The output is not complete! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
The output is not complete! |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
277 ms |
6472 KB |
Ok |
2 |
Correct |
130 ms |
3244 KB |
Ok |
3 |
Correct |
1 ms |
204 KB |
Ok |
4 |
Correct |
1 ms |
204 KB |
Ok |
5 |
Correct |
1 ms |
204 KB |
Ok |
6 |
Incorrect |
1 ms |
204 KB |
The output is not complete! |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
The output is not complete! |
2 |
Halted |
0 ms |
0 KB |
- |