結果

問題 No.490 yukiソート
ユーザー face4face4
提出日時 2018-04-27 19:30:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 505 bytes
コンパイル時間 497 ms
コンパイル使用メモリ 65,680 KB
実行使用メモリ 8,752 KB
最終ジャッジ日時 2023-09-10 06:16:37
合計ジャッジ時間 6,762 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;
    int A[n];
    for(int i = 0; i < n; i++)  cin >> A[i];

    for(int i = 1; i < 2*n-3; i++){
        for(int p = 0; p <= min(n-1, i); p++){
            for(int q = p+1; q <= i-p; q++){
                if(A[p] > A[q]){
                    swap(A[p], A[q]);
                }
            }
        }
    }

    for(int i = 0; i < n; i++){
        cout << ((i == 0) ? "" : " ") << A[i];
    }

    cout << endl;
    return 0;
}
0