4 条题解
-
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
- 难度
- 入门
- 标签
- 递交数
- 378
- 已通过
- 210
- 上传者