結果
問題 |
No.1537 私の代わりに仕事やっといてください。
|
ユーザー |
![]() |
提出日時 | 2021-06-06 19:18:37 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 703 bytes |
コンパイル時間 | 2,235 ms |
コンパイル使用メモリ | 201,560 KB |
最終ジャッジ日時 | 2025-01-22 04:13:53 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | WA * 9 |
ソースコード
#include "bits/stdc++.h" #define int long long using namespace std; using ll = long long; using P = pair<ll, ll>; const ll INF = (1LL << 61); ll mod = 998244353; signed main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; N--; if (N == 1) { cout << 1 << " " << 2 << " " << 1 << endl; return 0; } vector<int>B(N); int x; cin >> x; for (int i = 0; i < N; i++)cin >> B[i]; vector<P>A(N); for (int i = 0; i < N; i++)A[i] = { B[i], i + 2 }; sort(A.begin(), A.end()); cout << 1 << " " << A[N - 1].second << " "; int now = A[N - 1].second; for (int i = N - 3; i >= 0; i--) { cout << A[i].second << " "; } cout << A[N - 2].second << " "; cout << 1 << endl; return 0; }