# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
287921 | dantoh000 | "The Lyuboyn" code (IZhO19_lyuboyn) | C++14 | 646 ms | 5304 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;
int n,k,t;
string s;
string bin(int x){
string ret = "";
for (int i = n-1; i >= 0; i--){
if (x>>i&1){
ret+="1";
}
else ret +="0";
}
return ret;
}
int main() {
scanf("%d%d%d",&n,&k,&t);
cin >> s;
if (k == 1){
printf("%d\n",(1<<n));
for (int i = 0; i < (1<<n); i++){
cout << bin(i^(i>>1)) << endl;
}
}
else if (k%2 == 0){
printf("-1\n");
}
else if (k == 3){
printf("%d\n",(1<<n));
for (int i = 0; i < (1<<n); i++){
int ans = i^(i>>1);
if (i&1) ans ^= ((1<<n)-1);
cout << bin(ans) << endl;
}
}
}
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... |