// Success consists of going from failure to failure without loss of enthusiasm
#include <bits/stdc++.h>
using namespace std;
#define nl '\n'
using str = string;
template<class T> using V = vector<T>;
int main() {
cin.tie(0)->sync_with_stdio(0);
int N, K, T; cin >> N >> K >> T;
str S; cin >> S;
V<pair<int, int>> A;
for(int x = 0; x < (1 << N); x++) if (__builtin_popcount(x) == K) {
pair<int, int> cur = {x, x};
for(auto p : A) cur.first = min(cur.first, p.first ^ cur.first);
if (!cur.first) continue;
for(int i = 0; i <= int(size(A)); i++) if (i == int(size(A)) || cur.first > A[i].first) {
A.insert(begin(A) + i, cur);
break;
}
}
// cout << 1 << endl;
V<int> dif(1<<N);
for(int i = 0; i < N; i++) for(int j = (1 << i); j < (1 << N); j += (2 << i)) dif[j] = A[i].second;
cout << (1 << N) << nl;
for(int i = 0; i < (1 << N); i++) {
for(int j = 0; j < N; j++) if ((dif[i] >> j) & 1) S[j] = '0' + '1' - S[j];
cout << S << nl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
468 KB |
Found solution while it does not exist |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
17 ms |
6260 KB |
Ok |
2 |
Correct |
9 ms |
3156 KB |
Ok |
3 |
Correct |
1 ms |
340 KB |
Ok |
4 |
Correct |
1 ms |
320 KB |
Ok |
5 |
Correct |
1 ms |
320 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Ok |
2 |
Correct |
1 ms |
468 KB |
Ok |
3 |
Correct |
9 ms |
3196 KB |
Ok |
4 |
Correct |
5 ms |
1620 KB |
Ok |
5 |
Correct |
1 ms |
212 KB |
Ok |
6 |
Correct |
1 ms |
340 KB |
Ok |
7 |
Correct |
3 ms |
980 KB |
Ok |
8 |
Correct |
0 ms |
212 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
6300 KB |
Ok |
2 |
Correct |
21 ms |
6264 KB |
Ok |
3 |
Correct |
21 ms |
6296 KB |
Ok |
4 |
Correct |
9 ms |
3168 KB |
Ok |
5 |
Correct |
9 ms |
3148 KB |
Ok |
6 |
Correct |
5 ms |
1620 KB |
Ok |
7 |
Correct |
7 ms |
1620 KB |
Ok |
8 |
Correct |
3 ms |
980 KB |
Ok |
9 |
Correct |
3 ms |
884 KB |
Ok |
10 |
Correct |
2 ms |
580 KB |
Ok |
11 |
Correct |
1 ms |
212 KB |
Ok |
12 |
Correct |
1 ms |
340 KB |
Ok |
13 |
Correct |
1 ms |
212 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
17 ms |
6260 KB |
Ok |
2 |
Correct |
9 ms |
3156 KB |
Ok |
3 |
Correct |
1 ms |
340 KB |
Ok |
4 |
Correct |
1 ms |
320 KB |
Ok |
5 |
Correct |
1 ms |
320 KB |
Ok |
6 |
Correct |
0 ms |
212 KB |
Ok |
7 |
Correct |
1 ms |
468 KB |
Ok |
8 |
Correct |
9 ms |
3196 KB |
Ok |
9 |
Correct |
5 ms |
1620 KB |
Ok |
10 |
Correct |
1 ms |
212 KB |
Ok |
11 |
Correct |
1 ms |
340 KB |
Ok |
12 |
Correct |
3 ms |
980 KB |
Ok |
13 |
Correct |
0 ms |
212 KB |
Ok |
14 |
Correct |
19 ms |
6300 KB |
Ok |
15 |
Correct |
21 ms |
6264 KB |
Ok |
16 |
Correct |
21 ms |
6296 KB |
Ok |
17 |
Correct |
9 ms |
3168 KB |
Ok |
18 |
Correct |
9 ms |
3148 KB |
Ok |
19 |
Correct |
5 ms |
1620 KB |
Ok |
20 |
Correct |
7 ms |
1620 KB |
Ok |
21 |
Correct |
3 ms |
980 KB |
Ok |
22 |
Correct |
3 ms |
884 KB |
Ok |
23 |
Correct |
2 ms |
580 KB |
Ok |
24 |
Correct |
1 ms |
212 KB |
Ok |
25 |
Correct |
1 ms |
340 KB |
Ok |
26 |
Correct |
1 ms |
212 KB |
Ok |
27 |
Correct |
18 ms |
6300 KB |
Ok |
28 |
Correct |
9 ms |
3156 KB |
Ok |
29 |
Correct |
24 ms |
6356 KB |
Ok |
30 |
Correct |
2 ms |
576 KB |
Ok |
31 |
Correct |
1 ms |
212 KB |
Ok |
32 |
Correct |
1 ms |
468 KB |
Ok |
33 |
Correct |
3 ms |
960 KB |
Ok |
34 |
Correct |
1 ms |
316 KB |
Ok |
35 |
Correct |
1 ms |
212 KB |
Ok |
36 |
Correct |
0 ms |
320 KB |
Ok |
37 |
Correct |
0 ms |
212 KB |
Ok |
38 |
Correct |
9 ms |
3156 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
3156 KB |
Ok |
2 |
Correct |
18 ms |
6268 KB |
Ok |
3 |
Correct |
23 ms |
6228 KB |
Ok |
4 |
Correct |
2 ms |
596 KB |
Ok |
5 |
Correct |
1 ms |
212 KB |
Ok |
6 |
Correct |
4 ms |
980 KB |
Ok |
7 |
Correct |
18 ms |
6264 KB |
Ok |
8 |
Correct |
1 ms |
340 KB |
Ok |
9 |
Correct |
1 ms |
212 KB |
Ok |
10 |
Correct |
0 ms |
212 KB |
Ok |
11 |
Correct |
5 ms |
1620 KB |
Ok |
12 |
Correct |
9 ms |
3192 KB |
Ok |