#include<bits/stdc++.h>
using namespace std;
bool used[265000];
int n,k,t,s;
bool dif[20];
void afis01(int x)
{
for(int i=n-1;i>=0;i--)
{
if(((1<<i)&x))
cout<<1;
else
cout<<0;
}
cout<<"\n";
}
signed main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>n>>k>>t>>s;
if(k%2==0)
{
cout<<-1;
return 0;
}
used[s]=1;
for(int i=0;i<k;i++)
dif[i]=1;
for(int i=k;i<n;i++)
dif[i]=0;
cout<<(1<<n)<<"\n";
afis01(s);
for(int i=1;i<(1<<n);i++)
{
while(1)
{
random_shuffle(dif,dif+n);
int aux=s;
for(int j=0;j<n;j++)
{
if(dif[j])
aux = aux ^ (1<<j);
}
if(!used[aux])
{
s=aux;
used[s]=1;
afis01(s);
break;
}
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Ok |
2 |
Correct |
0 ms |
348 KB |
Ok |
3 |
Correct |
0 ms |
348 KB |
Ok |
4 |
Correct |
0 ms |
348 KB |
Ok |
5 |
Correct |
0 ms |
348 KB |
Ok |
6 |
Correct |
0 ms |
348 KB |
Ok |
7 |
Correct |
0 ms |
504 KB |
Ok |
8 |
Correct |
0 ms |
344 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1067 ms |
2996 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1068 ms |
344 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1067 ms |
2996 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
600 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |