8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d350385 commit c54cce7Copy full SHA for c54cce7
Source/ch01/100.cpp
Source/ch01/15649.cpp
@@ -0,0 +1,38 @@
1
+#include <iostream>
2
+#include <vector>
3
+
4
+using namespace std;
5
6
+int N, M;
7
+vector<int> vec;
8
9
+void f() {
10
+ if(vec.size() == M) {
11
+ for(int i : vec) cout << i << " ";
12
+ cout << "\n";
13
+ return;
14
+ }
15
+ for(int i = 0; i < N; i++) {
16
+ bool isOK = true;
17
+ for(int j : vec) {
18
+ if(j == i) {
19
+ isOK = false;
20
+ break;
21
22
23
+ if(isOK) {
24
+ vec.push_back(i);
25
+ f();
26
+ vec.pop_back();
27
28
29
+}
30
31
+int main() {
32
+ ios_base::sync_with_stdio(false);
33
+ cin.tie(NULL); cout.tie(NULL);
34
35
+ cin >> N >> M;
36
37
+ return 0;
38
0 commit comments