diff --git a/P10448.cpp b/P10448.cpp new file mode 100644 index 0000000..b75c46c --- /dev/null +++ b/P10448.cpp @@ -0,0 +1,30 @@ +// 93 +#include +using namespace std; +bool ch[50]; +int n, m; +void dfs(int count, int now) +{ + if (now > n) + { + if (count != m) + return; + for (int i = 1; i <= n; ++i) + { + if (ch[i]) + printf("%d ", i); + } + puts(""); + return; + } + ch[now] = 1; + dfs(count + 1, now + 1); + ch[now] = 0; + dfs(count, now + 1); +} +int main() +{ + scanf("%d%d", &n, &m); + dfs(0, 1); + return 0; +} \ No newline at end of file