Submission #762812

# Submission time Handle Problem Language Result Execution time Memory
762812 2023-06-21T19:52:31 Z NK_ "The Lyuboyn" code (IZhO19_lyuboyn) C++17
0 / 100
19 ms 6328 KB
// 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 Incorrect 1 ms 212 KB The output is neither -1 nor the length of the answer
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB The output is neither -1 nor the length of the answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB The output is neither -1 nor the length of the answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 6292 KB The output is neither -1 nor the length of the answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB The output is neither -1 nor the length of the answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 6328 KB The output is neither -1 nor the length of the answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 6292 KB The output is neither -1 nor the length of the answer
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 3148 KB The output is neither -1 nor the length of the answer
2 Halted 0 ms 0 KB -