Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "bits/stdc++.h"
- using namespace std;
- void show(const vector<int> & b)
- {
- for(int i=0; i<b.size(); ++i) cout << b[i];
- cout << endl;
- }
- int main() {
- int n, k, i=0;
- cin >> n >> k;
- vector<int> a(n, 0);
- for(i = n-k; i<n; ++i) a[i] = 1;
- do
- {
- show(a);
- } while(next_permutation(a.begin(), a.end()));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement