#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,i,j,ii,jj,zx,xc,n,k,T,p[1000009],pi,q[1000009],qi,z,x,y;
string totwo(int q){
//cout<<q<<" l"<<endl;
string s;
for(int h=n-1; h>=0; h--){
if(((1<<h)&q)!=0) s.push_back('1'); else s.push_back('0');
}
return s;
}
int main(){
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>n>>k>>T;
if(k%2==0){
cout<<-1;
return 0;
}
if(k>=n){
cout<<-1;
return 0;
}
pi=4;
p[1]=0;p[2]=1;p[3]=3;p[4]=2;
for(i=4; i<=k+1; i+=2){
qi=0;
y=(1<<(i-2))-1;z=(1<<(i-1));x=(1<<(i-2));
for(j=1; j<=pi; j++){
qi++;q[qi]=p[j];
if(j%2==1){
q[qi]^=z;q[qi]^=x;
}
}
c=(p[pi]^y);
for(j=1; j<=pi; j++){
qi++;q[qi]=p[j];q[qi]^=c;
if(j%2==0){
q[qi]^=x;
}else{
q[qi]^=z;
}
}
for(j=1; j<=pi; j++){
qi++;q[qi]=p[j];
if(j%2==0){
q[qi]^=z;q[qi]^=x;
}
}
for(j=1; j<=pi; j++){
qi++;q[qi]=p[j];q[qi]^=c;
if(j%2==0){
q[qi]^=z;
}else{
q[qi]^=x;
}
}
pi=qi;
for(j=1; j<=pi; j++) p[j]=q[j];
}
for(i=k+2; i<=n; i++){
qi=0;y=(1<<(k-1))-1;z=(1<<(i-1));
for(j=1; j<=pi; j++){
qi++;q[qi]=p[j];
}
y^=q[qi];
for(j=1; j<=pi; j++){
qi++;q[qi]=p[j];q[qi]^=y;q[qi]^=z;
}
pi=qi;
for(j=1; j<=pi; j++) p[j]=q[j];
}
cout<<pi<<endl;
for(i=1; i<=pi; i++){
cout<<totwo(p[i])<<endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
First number in answer is not x 1 0 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
First number in answer is not x 0 3 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Ok |
2 |
Correct |
1 ms |
364 KB |
Ok |
3 |
Correct |
1 ms |
364 KB |
Ok |
4 |
Correct |
1 ms |
364 KB |
Ok |
5 |
Correct |
1 ms |
364 KB |
Ok |
6 |
Correct |
1 ms |
364 KB |
Ok |
7 |
Correct |
1 ms |
364 KB |
Ok |
8 |
Correct |
1 ms |
364 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
617 ms |
7440 KB |
Ok |
2 |
Correct |
303 ms |
3820 KB |
Ok |
3 |
Correct |
3 ms |
364 KB |
Ok |
4 |
Correct |
1 ms |
364 KB |
Ok |
5 |
Correct |
1 ms |
364 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
First number in answer is not x 0 24 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
628 ms |
7480 KB |
First number in answer is not x 44202 64512 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
617 ms |
7440 KB |
Ok |
2 |
Correct |
303 ms |
3820 KB |
Ok |
3 |
Correct |
3 ms |
364 KB |
Ok |
4 |
Correct |
1 ms |
364 KB |
Ok |
5 |
Correct |
1 ms |
364 KB |
Ok |
6 |
Incorrect |
1 ms |
364 KB |
First number in answer is not x 0 24 |
7 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
309 ms |
3820 KB |
First number in answer is not x 92826 32766 |
2 |
Halted |
0 ms |
0 KB |
- |