new file: P10448.cpp

This commit is contained in:
hanyixuanten
2026-08-14 19:41:34 +08:00
parent b76c4bf8f1
commit dbfe943d32
+30
View File
@@ -0,0 +1,30 @@
// 93
#include <cstdio>
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;
}