結果
問題 | No.490 yukiソート |
ユーザー |
![]() |
提出日時 | 2020-01-20 16:17:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 595 bytes |
コンパイル時間 | 1,946 ms |
コンパイル使用メモリ | 169,992 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-02 22:36:26 |
合計ジャッジ時間 | 5,910 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 RE * 1 |
other | AC * 2 WA * 10 RE * 22 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define rep(i, n) for (int i = 0; i < (n); i++)using ll = long long;using vll = vector<ll>;using vi = vector<int>;using vvi = vector<vector<int>>;using vvll = vector<vector<ll>>;const ll inf = 1e16;const ll md = 1000000007;int main() {int n;cin >> n;vi a(n);rep(i,n) cin>>a[i];for(int i=1;i<2*n-3;i++){for(int p=0;;p++){int q=i-p;if(p>=q) break;if(a[p]>a[q]) swap(a[p],a[q]);}}rep(i,n){cout<<a[i];if(i==n-1){cout<<endl;break;}cout<<" ";}return 0;}