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

20
LuoGu/RuMen/P2525.cpp Normal file
View File

@@ -0,0 +1,20 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i;
cin >> n;
int a[n];
//输入数据
for (i = 0; i < n; i++)
cin >> a[i];
//而STL中有两个函数,分别是 prev_permutation 和 next_permutation.
//它们是现成的求上一个和下一个字典序的序列的。
prev_permutation(a, a + n);//求上一个全排列
//输出
for (i = 0; i < n; i++)
cout << a[i] << " ";
return 0;
}