結果
問題 |
No.490 yukiソート
|
ユーザー |
![]() |
提出日時 | 2018-03-24 23:45:12 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 607 bytes |
コンパイル時間 | 786 ms |
コンパイル使用メモリ | 80,476 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 03:20:13 |
合計ジャッジ時間 | 1,917 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#include<iostream> #include<string> #include<algorithm> #include<cmath> #include<iomanip> #include<cstring> #include<map> #include<vector> #include<queue> #include<climits> using namespace std; typedef long long int ll; int main(){ ll n, a[4000]={0}; cin >> n; for(int i=0; i<n; i++){ cin >> a[i]; } for(int i=1; i<2*n-3; i++){ for(int j=0; j<=i/2; j++){ if(i-j>=n){ continue; } if(a[j]>a[i-j]){ int t=a[j]; a[j]=a[i-j]; a[i-j]=t; } } } for(int i=0; i<n; i++){ if(i==0){ cout << a[i]; } else { cout << " " << a[i]; } } cout << endl; return 0; }