結果

問題 No.490 yukiソート
ユーザー zenito9970zenito9970
提出日時 2017-03-10 22:40:37
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 918 bytes
コンパイル時間 1,130 ms
コンパイル使用メモリ 144,772 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 15:43:48
合計ジャッジ時間 2,676 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 14 ms
4,380 KB
testcase_15 AC 14 ms
4,380 KB
testcase_16 AC 14 ms
4,380 KB
testcase_17 AC 14 ms
4,376 KB
testcase_18 AC 14 ms
4,380 KB
testcase_19 AC 14 ms
4,376 KB
testcase_20 AC 14 ms
4,380 KB
testcase_21 AC 14 ms
4,380 KB
testcase_22 AC 14 ms
4,376 KB
testcase_23 AC 14 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 AC 1 ms
4,376 KB
testcase_28 AC 1 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 1 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 2 ms
4,380 KB
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) for(int i=(n)-1;0<=i;--i)
#define each(e,v) for(auto&& e:(v))
#define DUMP(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<": "<<(x)<<" (L"<<__LINE__<<")"<<endl
using namespace std;
using vint = vector<int>;
using vdouble = vector<double>;
using vstring = vector<string>;
using ll = long long;
template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }

int main() {
    int n; cin >> n;
    vint a(n);
    rep(i, n) cin >> a[i];
    FOR(i, 1, 2 * n - 3) {
        rep(p, n) {
            int q = i - p;
            if(q < 0 || n <= q) continue;
            if(a[p] < a[q]) swap(a[q], a[p]);
        }
    }
    rep(i, n) {
        cout << a[i];
        if(i != n-1) cout << " ";
    }
    cout << endl;
    return 0;
}
0