提出 #36228224
ソースコード 拡げる
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
typedef long long ll;
using namespace std;
const int maxn = 105;
int n, a[maxn];
int main() {
#ifdef DEBUG
freopen("1.in", "r", stdin);
#endif
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n;
for(int i = 1; i <= n; i++) {
cin >> a[i];
}
prev_permutation(a + 1, a + 1 + n);
for(int i = 1; i <= n; i++) {
cout << a[i] << ' ';
}
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - Previous Permutation |
| ユーザ | yanchengzhi |
| 言語 | C++ (GCC 9.2.1) |
| 得点 | 300 |
| コード長 | 502 Byte |
| 結果 | AC |
| 実行時間 | 6 ms |
| メモリ | 3604 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 300 / 300 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example_00.txt, example_01.txt |
| All | example_00.txt, example_01.txt, test_00.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| example_00.txt | AC | 6 ms | 3456 KiB |
| example_01.txt | AC | 2 ms | 3472 KiB |
| test_00.txt | AC | 2 ms | 3548 KiB |
| test_01.txt | AC | 2 ms | 3604 KiB |
| test_02.txt | AC | 2 ms | 3388 KiB |
| test_03.txt | AC | 2 ms | 3396 KiB |
| test_04.txt | AC | 2 ms | 3400 KiB |
| test_05.txt | AC | 2 ms | 3408 KiB |
| test_06.txt | AC | 2 ms | 3400 KiB |
| test_07.txt | AC | 2 ms | 3448 KiB |
| test_08.txt | AC | 1 ms | 3456 KiB |
| test_09.txt | AC | 3 ms | 3476 KiB |