結果

問題 No.365 ジェンガソート
ユーザー ototonariototonari
提出日時 2017-03-21 23:35:25
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 927 bytes
コンパイル時間 2,014 ms
コンパイル使用メモリ 99,884 KB
実行使用メモリ 30,544 KB
最終ジャッジ日時 2023-09-18 15:38:22
合計ジャッジ時間 7,598 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
27,120 KB
testcase_01 AC 58 ms
20,764 KB
testcase_02 AC 58 ms
20,652 KB
testcase_03 AC 58 ms
20,784 KB
testcase_04 AC 58 ms
22,796 KB
testcase_05 AC 58 ms
18,636 KB
testcase_06 AC 58 ms
20,804 KB
testcase_07 AC 58 ms
20,776 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 58 ms
18,632 KB
testcase_15 AC 57 ms
20,584 KB
testcase_16 WA -
testcase_17 TLE -
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;

namespace yukicoder
{
    class _090
    {
        
        static void Main()
        {
            int[] num = new int[int.Parse(Console.ReadLine())];
            string[] s = Console.ReadLine().Split(' ');
            int min = 0;
            for(int i = 0;i < num.Length; i++)
            {
                num[i] = int.Parse(s[i]);
            }
            for(int i = 1;i < num.Length; i++)
            {
                if(num[0] - 1 == num[i])
                {
                    chr(num, i);
                    min++;
                    i = 1;
                }
            }
            

            Console.WriteLine(min);

        }
        static void chr(int[] num,int k)
        {
            int t = num[k];
            for(int i = k; i > 0; i--)
            {
                num[i] = num[i - 1];
            }
            num[0] = t;
        }

    }

}
0