結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2017-03-08 18:54:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 18 ms / 2,000 ms |
コード長 | 405 bytes |
コンパイル時間 | 647 ms |
コンパイル使用メモリ | 64,900 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 08:21:19 |
合計ジャッジ時間 | 1,712 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#include<iostream>using namespace std;int a[5000], n;int main() {cin >> n; for (int i = 0; i < n; i++)cin >> a[i];for (int i = 0; i < 2 * n - 3; i++) {for (int j = 0; j < n; j++) {int T1 = j, T2 = i - j; if (T2 < 0 || T2 >= n)continue;if (a[T1] > a[T2] && T1 < T2)swap(a[T1], a[T2]);}}for (int i = 0; i < n; i++) { if (i != 0)cout << ' '; cout << a[i]; }cout << endl;return 0;}