複製代碼
- #include<bits/stdc++.h>
- #define ll long long
- #define INF 0x3f3f3f3f
- #define MOD 1000000007
- #define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
- using namespace std;
- const int MXN = 200005;
- //int ar[MXN];
- void sol(){
- ll ans = 0, n = 0, m = 0, k = 0;
- cin >> n >> m;
- string str = "";
- for(int i = 0; i < n - m; ++i) str += "0";
- for(int i = 0; i < m; ++i) str += "1";
- do{
- cout << str << '\n';
- }while(next_permutation(str.begin(), str.end()));
- }
- int main(){
- //io
- int t = 1;
- cin >> t;
- while(t--){
- sol();
- if(t) cout << '\n';
- }
- }
| 歡迎光臨 冰楓論壇 (https://bingfong.com/) | Powered by 冰楓 |