This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |