#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;
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 |
1 ms |
344 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Ok |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1055 ms |
348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1014 ms |
3024 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1039 ms |
348 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 |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1014 ms |
3024 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 |
- |