結果

問題 No.365 ジェンガソート
ユーザー mori_chibimori_chibi
提出日時 2017-08-21 15:07:31
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 1,078 bytes
コンパイル時間 862 ms
コンパイル使用メモリ 109,636 KB
実行使用メモリ 45,616 KB
最終ジャッジ日時 2024-04-23 01:36:09
合計ジャッジ時間 5,099 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
31,572 KB
testcase_01 AC 29 ms
28,808 KB
testcase_02 AC 28 ms
28,404 KB
testcase_03 AC 26 ms
26,388 KB
testcase_04 AC 27 ms
26,648 KB
testcase_05 AC 27 ms
28,288 KB
testcase_06 AC 27 ms
26,260 KB
testcase_07 AC 26 ms
26,388 KB
testcase_08 AC 26 ms
26,504 KB
testcase_09 AC 27 ms
28,652 KB
testcase_10 AC 27 ms
28,684 KB
testcase_11 AC 28 ms
26,772 KB
testcase_12 AC 26 ms
24,760 KB
testcase_13 AC 32 ms
24,752 KB
testcase_14 AC 32 ms
26,540 KB
testcase_15 AC 30 ms
26,644 KB
testcase_16 TLE -
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 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Collections.Generic;

namespace GengaSort
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            LinkedList<int> An = new LinkedList<int>(Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray());
            if (N > An.Count) N = An.Count;
            int count = 0, max;
            LinkedListNode<int> Ax, Xx;
            do
            {
                Xx = null;
                max = 0;
                Ax = An.First;
                while (Ax != null)
                {
                    if (Ax.Value > max) max = Ax.Value;
                    if (max > Ax.Value && (Xx == null || Xx.Value < Ax.Value)) Xx = Ax;
                    Ax = Ax.Next;
                }
                if (Xx != null)
                {
                    count++;
                    An.AddFirst(Xx.Value);
                    An.Remove(Xx);
                }
            } while (Xx != null);
            Console.WriteLine(count);
        }
    }
}
0