This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int a[N], al, n;
// 标准错误答案
void dfs(int u) {
if (u == n + 1) {
for (int i = 1; i <= al; i++) cout << a[i] << " ";
cout << endl;
return;
}
a[++al] = u;
dfs(u + 1);
al--;
dfs(u + 1);
}
int main() {
cin >> n;
dfs(1);
return 0;
}