結果

問題 No.365 ジェンガソート
ユーザー ototonariototonari
提出日時 2017-03-22 01:16:10
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 937 bytes
コンパイル時間 2,264 ms
コンパイル使用メモリ 100,812 KB
実行使用メモリ 28,716 KB
最終ジャッジ日時 2023-09-18 18:45:48
合計ジャッジ時間 6,794 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,648 KB
testcase_01 AC 56 ms
22,840 KB
testcase_02 AC 55 ms
20,564 KB
testcase_03 AC 54 ms
20,600 KB
testcase_04 AC 54 ms
18,716 KB
testcase_05 AC 55 ms
20,700 KB
testcase_06 AC 55 ms
20,844 KB
testcase_07 AC 54 ms
18,804 KB
testcase_08 AC 55 ms
20,756 KB
testcase_09 AC 56 ms
20,776 KB
testcase_10 AC 55 ms
20,732 KB
testcase_11 AC 55 ms
20,580 KB
testcase_12 AC 55 ms
20,788 KB
testcase_13 AC 55 ms
20,636 KB
testcase_14 AC 55 ms
20,736 KB
testcase_15 AC 55 ms
20,872 KB
testcase_16 AC 84 ms
26,128 KB
testcase_17 AC 88 ms
28,716 KB
testcase_18 AC 65 ms
23,388 KB
testcase_19 AC 87 ms
26,636 KB
testcase_20 AC 71 ms
24,232 KB
testcase_21 AC 68 ms
21,612 KB
testcase_22 AC 83 ms
25,940 KB
testcase_23 AC 74 ms
20,424 KB
testcase_24 AC 82 ms
25,828 KB
testcase_25 AC 69 ms
21,864 KB
testcase_26 AC 78 ms
22,724 KB
testcase_27 AC 88 ms
26,772 KB
testcase_28 AC 81 ms
25,412 KB
testcase_29 AC 87 ms
26,492 KB
testcase_30 AC 78 ms
23,376 KB
testcase_31 AC 69 ms
21,800 KB
testcase_32 AC 69 ms
23,784 KB
testcase_33 AC 88 ms
26,756 KB
testcase_34 AC 67 ms
21,732 KB
testcase_35 AC 83 ms
25,888 KB
testcase_36 AC 90 ms
26,884 KB
testcase_37 AC 89 ms
26,780 KB
testcase_38 AC 94 ms
26,932 KB
testcase_39 AC 89 ms
26,936 KB
testcase_40 AC 90 ms
26,992 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 m = 1;
            for(int i = 0;i < num.Length; i++)
            {
                num[i] = int.Parse(s[i]);
            }

            int max = num.Length;
            for(int k = 0;k < num.Length; k++)
            {
                if(num[k] == max)

                {
                    for(int i = 1;0 <= (k - i); i++)
                    {
                        if(num[k - i] == max - 1)
                        {
                            max--;
                            m++;
                        }
                    }
                    break;
                }
            }
            Console.WriteLine(num.Length - m);

        }
    }

}
0