5 条题解
题解与来源题共享。已有题解默认通过;新增或编辑后需由来源域管理员审核。待审核、驳回题解仅作者和审核管理员可见。来源域:system
-
2
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' const double EPS = 1e-8; const int N = 2e5 + 5; int a[N]; signed main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); int n; cin >> n; vector<int> vec; for (int i = 1; i <= n; i++) { vec.push_back(i); } do { for (int i = 0; i < n; i++) cout << vec[i] << " "; cout << endl; } while (next_permutation(vec.begin(), vec.end())); return 0; }
信息
- ID
- 64
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 入门
- 标签
- 递交数
- 388
- 已通过
- 213
- 上传者