# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
393003 | patrikpavic2 | "The Lyuboyn" code (IZhO19_lyuboyn) | C++17 | 391 ms | 6328 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 <cstdio>
#include <cstdlib>
using namespace std;
const int N = 20;
const int MSK = (1 << N);
int n, k, bla, bs[N], bio[MSK];
int main(){
scanf("%d%d%d", &n, &k, &bla);
int poc = 0;
for(int i = 0;i < n;i++){
char c; scanf(" %c", &c);
poc += (c & 1) << i;
}
if(!(k & 1)){
printf("-1\n");
return 0;
}
int sz = 0;
bio[0] = 1;
for(int x = 0;x < (1 << n);x++){
if(bio[x] || __builtin_popcount(x) != k) continue;
bs[sz++] = x;
for(int y = 0;y < (1 << n);y++)
bio[x ^ y] |= bio[y];
}
printf("%d\n", (1 << n));
for(int i = 0;i < (1 << n);i++){
int cur = poc;
for(int j = 0;j < n;j++)
if((i ^ (i >> 1)) & (1 << j))
cur ^= bs[j];
for(int j = 0;j < n;j++)
printf("%c", 48 + ((cur >> j) & 1));
printf("\n");
}
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... |