#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector<ll> vi;
typedef vector<pi> vpi;
#define pb emplace_back
#define mp make_pair
#define f first
#define s second
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(),x.end()
#define lb lower_bound
const int MAXN=1001000;
const ll MOD=998244353;
vi V;
int N,K,T,S;
void tobin(int y){
string x;
while(y){
x+=('0' + y%2);
y/=2;
}
while(SZ(x) <N)x+='0';
reverse(ALL(x));
cout<<x<<'\n';
}
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>N>>K>>T>>S;
if(S!=0||K!=1){
cout<<-1;
return 0;
}
V.pb(0);
for(int i=0;i<N;++i){
stack<int> tm;
for(auto i:V)tm.push(i);
while(SZ(tm)){
V.pb(tm.top() | (1<<i));
tm.pop();
}
}
cout<<(1<<N)<<'\n';
for(auto i:V){
tobin(i);
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output -1 while solution exists |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output -1 while solution exists |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Ok |
2 |
Correct |
0 ms |
384 KB |
Ok |
3 |
Correct |
0 ms |
384 KB |
Ok |
4 |
Correct |
1 ms |
384 KB |
Ok |
5 |
Correct |
0 ms |
384 KB |
Ok |
6 |
Correct |
1 ms |
384 KB |
Ok |
7 |
Correct |
1 ms |
384 KB |
Ok |
8 |
Correct |
0 ms |
384 KB |
Ok |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
73 ms |
7916 KB |
Ok |
2 |
Correct |
36 ms |
3952 KB |
Ok |
3 |
Correct |
1 ms |
384 KB |
Ok |
4 |
Correct |
0 ms |
384 KB |
Ok |
5 |
Correct |
1 ms |
384 KB |
Ok |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output -1 while solution exists |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output -1 while solution exists |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
73 ms |
7916 KB |
Ok |
2 |
Correct |
36 ms |
3952 KB |
Ok |
3 |
Correct |
1 ms |
384 KB |
Ok |
4 |
Correct |
0 ms |
384 KB |
Ok |
5 |
Correct |
1 ms |
384 KB |
Ok |
6 |
Incorrect |
1 ms |
384 KB |
Output -1 while solution exists |
7 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output -1 while solution exists |
2 |
Halted |
0 ms |
0 KB |
- |