Submission #870544

# Submission time Handle Problem Language Result Execution time Memory
870544 2023-11-08T09:06:01 Z KiaRez "The Lyuboyn" code (IZhO19_lyuboyn) C++17
14 / 100
190 ms 6592 KB
/*
    IN THE NAME OF GOD
*/
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef long double ld;

#define F                                      first
#define S                                      second
#define Mp                                     make_pair
#define pb                                     push_back
#define pf                                     push_front
#define size(x)                                ((ll)x.size())
#define all(x)                                 (x).begin(),(x).end()
#define kill(x)		                           cout << x << '\n', exit(0);
#define fuck(x)                                cout << "(" << #x << " , " << x << ")" << endl
#define endl                                   '\n'

int n, k, t, a[16];
string s;

vector<int> dfs(int ind, int b) {
	if(b == 0) return {ind};
	vector<int> res, v1, v2;
	v1 = dfs(ind, b-1);
	for(int i=0; i<size(v1); i++) {
		v2.pb(v1[i] + (1<<(b-1)));
	}
	res.pb(v1[0]);
	res.pb(v2[0]);
	for(int i=size(v2)-1; i>0; i--) {
		res.pb(v2[i]);
	}
	for(int i=1; i<size(v1); i++) {
		res.pb(v1[i]);
	}
	return res;
}

int main() {
	cin>>n>>k>>t>>s;

	if(k%2==0) kill(-1);

	cout<<(1<<n)<<endl;
	vector<int> ans = dfs(0, n);
	for(auto it : ans) {
		for(int i=n-1; i>=0; i--) {
			cout<<((it>>i)%2);
		}
		cout<<endl;
	}

	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB First number in answer is not x 1 0
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Fail, not exactly k bits are different: line = 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Ok
2 Correct 1 ms 840 KB Ok
3 Correct 0 ms 348 KB Ok
4 Correct 0 ms 348 KB Ok
5 Correct 0 ms 344 KB Ok
6 Correct 0 ms 344 KB Ok
7 Correct 0 ms 348 KB Ok
8 Correct 0 ms 348 KB Ok
# Verdict Execution time Memory Grader output
1 Correct 178 ms 6544 KB Ok
2 Correct 83 ms 3264 KB Ok
3 Correct 1 ms 432 KB Ok
4 Correct 0 ms 344 KB Ok
5 Correct 0 ms 344 KB Ok
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Fail, not exactly k bits are different: line = 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 190 ms 6592 KB First number in answer is not x 44202 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 178 ms 6544 KB Ok
2 Correct 83 ms 3264 KB Ok
3 Correct 1 ms 432 KB Ok
4 Correct 0 ms 344 KB Ok
5 Correct 0 ms 344 KB Ok
6 Incorrect 0 ms 344 KB Fail, not exactly k bits are different: line = 0
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 88 ms 3204 KB First number in answer is not x 92826 0
2 Halted 0 ms 0 KB -