# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
959338 | Darren0724 | "The Lyuboyn" code (IZhO19_lyuboyn) | C++17 | 162 ms | 5460 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define LCBorz ios_base::sync_with_stdio(false); cin.tie(0);
#define int long long
#define all(x) x.begin(), x.end()
#define endl '\n'
const int N=200005;
const int INF=1e18;
int32_t main() {
LCBorz;
int n,k,t;cin>>n>>k>>t;
if(k%2==0){
cout<<-1<<endl;
return 0;
}
string str;cin>>str;
int s=0;
for(char c:str){
s=s<<1|(c&1);
}
vector<int> v(n+2);
for(int i=0;i<=k;i++){
v[i]=(1<<k+1)-(1<<i)-1;
//01110
//01101
//01011
//00111
//10011
}
for(int i=k+1;i<n;i++){
v[i]=(1<<i)+(1<<k-1)-1;
}
cout<<(1<<n)<<endl;
for(int i=1;i<=(1<<n);i++){
for(int j=n-1;j>=0;j--){
cout<<((s>>j)&1);
}
cout<<endl;
int p=__lg(i&(-i));
s^=v[p];
}
return 0;
}
Compilation message (stderr)
# | 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... |