結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2020-03-01 01:00:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 407 bytes |
コンパイル時間 | 1,492 ms |
コンパイル使用メモリ | 168,136 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 20:23:33 |
合計ジャッジ時間 | 2,629 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#include<bits/stdc++.h>int main(){int n;std::cin>>n;std::vector<int>a(n);for(int i=0;i<n;i++)std::cin>>a.at(i);for(int i=0;i<2*n-3;i++){for(int j=std::max(0,i-n+1);j<=std::min((i+1)/2-1,n-1);j++){if(a.at(j)>a.at(i-j))std::swap(a.at(j),a.at(i-j));}}for(int i=0;i<n;i++){std::cout<<(i?" ":"")<<a.at(i);}std::cout<<std::endl;}