結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2017-07-07 07:45:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 10 ms / 2,000 ms |
コード長 | 335 bytes |
コンパイル時間 | 1,576 ms |
コンパイル使用メモリ | 165,900 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 05:36:53 |
合計ジャッジ時間 | 2,882 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#include <bits/stdc++.h>#define REP(i,n,N) for(int i=(n);i<(int) N;i++)using namespace std;int a[2017];int main() {int n;cin>>n;REP(i,0,n) cin>>a[i];REP(i,1,2*n-3){REP(p,0,(i+1)/2){if(i-p>=n) continue;if(a[p]>a[i-p]) swap(a[p],a[i-p]);}}cout<<a[0];REP(i,1,n) cout<<" "<<a[i];cout<<endl;return 0;}