Submission #870543

# Submission time Handle Problem Language Result Execution time Memory
870543 2023-11-08T09:04:47 Z KiaRez "The Lyuboyn" code (IZhO19_lyuboyn) C++17
3 / 100
184 ms 6508 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);
	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 348 KB Expected integer, but "00" found
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Expected integer, but "0000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Ok
2 Correct 0 ms 348 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 348 KB Ok
7 Correct 0 ms 348 KB Ok
8 Correct 0 ms 348 KB Ok
# Verdict Execution time Memory Grader output
1 Incorrect 184 ms 6508 KB Expected integer, but "000000000000000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB Expected integer, but "0000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 180 ms 6384 KB Expected integer, but "000000000000000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 184 ms 6508 KB Expected integer, but "000000000000000000" found
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 83 ms 3276 KB Expected integer, but "00000000000000000" found
2 Halted 0 ms 0 KB -