| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 205528 | ****** | 全排列问题 | C++ | 解答错误 | 0 | 0 MS | 240 KB | 501 | 2026-03-01 20:17:07 |
#include <bits/stdc++.h> using namespace std; int n; vector<int> a; bool u[10]; void dfs() { if (a.size() == n) { for (int i = 0; i < n; ++i) cout << a[i] << ' '; cout << '\n'; return; } for (int i = 1; i <= n; ++i) { if (!u[i]) { a.push_back(i); u[i] = true; dfs(); u[i] = false; a.pop_back(); } } } int main() { cin >> n; dfs(); return 0; }