Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- vector<int>a,b;
- int i,k,j,n,m,t,p1,p2,p3,cnt;
- scanf("%d",&t);
- while(t--){
- scanf("%d %d",&m,&n);
- cnt=0;
- for(i=0;i<m-n;i++)
- a.push_back(cnt);
- cnt=1;
- for(i=0;i<n;i++)
- a.push_back(cnt);
- do{
- for(j=0;j<m;j++)
- cout<<a[j];
- cout<<endl;
- }
- while(next_permutation(a.begin(),a.end()));
- if(t)
- cout<<endl;
- a.clear();
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement