結果

問題 No.490 yukiソート
ユーザー aaaaaaiuaaaaaaiu
提出日時 2019-07-30 23:17:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 363 bytes
コンパイル時間 2,090 ms
コンパイル使用メモリ 197,632 KB
実行使用メモリ 8,768 KB
最終ジャッジ日時 2023-09-18 15:44:40
合計ジャッジ時間 6,222 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 16 ms
4,380 KB
testcase_05 AC 17 ms
4,376 KB
testcase_06 AC 16 ms
4,380 KB
testcase_07 AC 17 ms
4,376 KB
testcase_08 AC 16 ms
4,376 KB
testcase_09 AC 16 ms
4,376 KB
testcase_10 AC 17 ms
4,376 KB
testcase_11 AC 16 ms
4,376 KB
testcase_12 AC 17 ms
4,376 KB
testcase_13 AC 17 ms
4,376 KB
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 <bits/stdc++.h>
using namespace std;
typedef long long ll;

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<n;p++)
            for (int q=p+1;q<n;q++)
                if(p+q==i&&a[p]>a[q])swap(a[p],a[q]);
    for(int x:a)cout<<x<<' ';
    cout<<endl;
    return 0;
}
0