結果

問題 No.490 yukiソート
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-08-29 00:47:51
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 811 bytes
コンパイル時間 4,959 ms
コンパイル使用メモリ 107,428 KB
実行使用メモリ 23,916 KB
最終ジャッジ日時 2023-09-25 16:38:19
合計ジャッジ時間 9,230 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
23,720 KB
testcase_01 AC 61 ms
21,588 KB
testcase_02 AC 62 ms
21,576 KB
testcase_03 AC 62 ms
21,752 KB
testcase_04 AC 71 ms
21,692 KB
testcase_05 AC 72 ms
21,848 KB
testcase_06 AC 72 ms
21,700 KB
testcase_07 AC 71 ms
23,704 KB
testcase_08 AC 71 ms
21,656 KB
testcase_09 AC 72 ms
23,796 KB
testcase_10 AC 70 ms
21,816 KB
testcase_11 AC 70 ms
21,688 KB
testcase_12 AC 70 ms
21,800 KB
testcase_13 AC 70 ms
23,728 KB
testcase_14 AC 92 ms
23,856 KB
testcase_15 AC 92 ms
21,788 KB
testcase_16 AC 92 ms
23,764 KB
testcase_17 AC 92 ms
23,848 KB
testcase_18 AC 92 ms
23,892 KB
testcase_19 AC 91 ms
23,916 KB
testcase_20 AC 92 ms
21,944 KB
testcase_21 AC 92 ms
21,752 KB
testcase_22 AC 91 ms
21,936 KB
testcase_23 AC 91 ms
21,892 KB
testcase_24 AC 62 ms
21,736 KB
testcase_25 AC 62 ms
21,572 KB
testcase_26 AC 61 ms
21,716 KB
testcase_27 AC 60 ms
21,740 KB
testcase_28 AC 61 ms
23,748 KB
testcase_29 AC 61 ms
21,564 KB
testcase_30 AC 62 ms
21,652 KB
testcase_31 AC 60 ms
19,684 KB
testcase_32 AC 61 ms
23,640 KB
testcase_33 AC 60 ms
21,764 KB
testcase_34 AC 61 ms
23,568 KB
testcase_35 AC 61 ms
21,652 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

class No490
{
    static void Main()
    {
        var n = Int32.Parse(Console.ReadLine());
        var num = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();
        var length = num.Length;
        for (int i = 0; i < 2*n-3; ++i){
            for (int p = 0; p < n - 1; ++p)
            {
                var q = i - p;
                if (p >= q) break;
                if (q >= length) continue;
                if (num[p] > num[q])
                {
                    var temp = num[p];
                    num[p] = num[q];
                    num[q] = temp;
                }
            }
        }
        foreach (var a in num)
        {
            Console.Write(" ");
            Console.Write(a);
        }
        Console.WriteLine();
    }
}
0