結果
| 問題 | No.490 yukiソート | 
| コンテスト | |
| ユーザー |  btk | 
| 提出日時 | 2017-03-11 01:42:52 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 8 ms / 2,000 ms | 
| コード長 | 976 bytes | 
| コンパイル時間 | 1,516 ms | 
| コンパイル使用メモリ | 168,208 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-06-24 11:54:43 | 
| 合計ジャッジ時間 | 2,577 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 34 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define CIN_ONLY if(1)
struct cww{cww(){
    CIN_ONLY{
        ios::sync_with_stdio(false);cin.tie(0);
    }
}}star;
#define fin "\n"
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define DEBUG if(0)
#define REC(ret, ...) std::function<ret (__VA_ARGS__)>
template <typename T>inline void chmin(T &l,T r){l=min(l,r);}
template <typename T>inline void chmax(T &l,T r){l=max(l,r);}
template <typename T>
istream& operator>>(istream &is,vector<T> &v){
    for(auto &it:v)is>>it;
    return is;
}
    
int main(){
    int n;
    cin>>n;
    vector<int> a(n);
    cin>>a;
    FOR(i,1,2*n-3){
        int p=0,q=i;
        while(p<q){
            if(p<n&&q<n&&a[p]>a[q])swap(a[p],a[q]);
            p++;
            q--;
        }
    }
    REP(i,n)cout<<a[i]<<" ";cout<<endl;
    return 0;
}
            
            
            
        