Submission
Status:
(-SSS)(SSS)(SSS)
Subtask/Task Score:
{0/40}{0/30}{0/30}
Score: 0
User: NANO..
Problemset: Twin, Cousin, and Sexy Prime
Language: cpp
Time: 0.002 second
Submitted On: 2026-11-17 18:36:36
#include <bits/stdc++.h>
using namespace std;
int a,b;
bool sol[21];
void perm(string s,int pos,int len,bool ok){
if(!ok && len+(a-pos)<b) return ;
if(pos==a){
cout << s << '\n';
return ;
}
perm(s+'0',pos+1,0,ok);
perm(s+'1',pos+1,len+1,ok||len+1>=b);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> a >> b;
perm("",0,0,0);
return 0;
}