# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
370419 | daniel920712 | "The Lyuboyn" code (IZhO19_lyuboyn) | C++14 | 248 ms | 6880 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 <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <stack>
using namespace std;
stack < int > t;
vector < int > all;
char tt[100005];
int N,K,T,S;
void F(int here)
{
int i,j;
if(here==0)
{
all.push_back(0);
all.push_back(1);
}
else if(here==N)
{
printf("%d\n",1<<N);
for(auto i:all)
{
for(j=N-1;j>=0;j--)
{
if(i&(1<<j)) printf("1");
else printf("0");
}
printf("\n");
}
return;
}
else
{
for(auto i:all) t.push(i+(1<<here));
while(!t.empty())
{
all.push_back(t.top());
t.pop();
}
}
F(here+1);
}
int main()
{
scanf("%d %d %d",&N,&K,&T);
scanf("%s",tt);
if(K%2==0||K>N||(K==N&&K!=1)) printf("-1\n");
else if(K==1) F(0);
else
{
printf("16\n");
printf("0000\n1110\n0011\n1101\n0110\n1000\n0101\n1011\n1100\n0010\n1111\n0001\n1010\n0100\n1001\n0111\n");
}
return 0;
}
/*
0000
1110
0011
1101
0110
1000
0101
1011
1100
0010
1111
0001
1010
0100
1001
0111*/
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... |