結果
問題 | No.490 yukiソート |
ユーザー |
|
提出日時 | 2024-03-31 11:42:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 517 bytes |
コンパイル時間 | 3,934 ms |
コンパイル使用メモリ | 250,628 KB |
最終ジャッジ日時 | 2025-02-20 16:12:13 |
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 14 TLE * 1 -- * 19 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/all>using namespace std;using namespace atcoder;using ll = long long;using ld = long double;int n, a[2020];int main() {cin >> n;for (int i = 0; i < n; i++) cin >> a[i];for (int i = 1; i < 2 * n - 3; i++) {for (int p = 0; p < n; p++) {for (int q = p + 1; q < n; q++) {if (p + q == i) {if (a[p] > a[q]) swap(a[p], a[q]);}}}}for (int i = 0; i < n; i++) cout << a[i] << " \n"[i == n - 1];return 0;}