結果

問題 No.365 ジェンガソート
ユーザー mbanmban
提出日時 2016-12-23 14:34:40
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 607 bytes
コンパイル時間 2,295 ms
コンパイル使用メモリ 103,000 KB
実行使用メモリ 29,920 KB
最終ジャッジ日時 2023-08-21 07:33:54
合計ジャッジ時間 7,373 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
19,668 KB
testcase_01 AC 60 ms
19,516 KB
testcase_02 AC 63 ms
21,796 KB
testcase_03 AC 61 ms
21,772 KB
testcase_04 AC 60 ms
21,652 KB
testcase_05 AC 61 ms
21,764 KB
testcase_06 AC 62 ms
21,592 KB
testcase_07 AC 60 ms
21,660 KB
testcase_08 AC 60 ms
21,612 KB
testcase_09 AC 60 ms
21,616 KB
testcase_10 AC 61 ms
23,660 KB
testcase_11 AC 61 ms
21,636 KB
testcase_12 AC 61 ms
21,732 KB
testcase_13 AC 62 ms
23,748 KB
testcase_14 AC 61 ms
21,572 KB
testcase_15 AC 63 ms
23,804 KB
testcase_16 AC 91 ms
25,120 KB
testcase_17 AC 94 ms
27,580 KB
testcase_18 AC 71 ms
20,184 KB
testcase_19 AC 95 ms
27,616 KB
testcase_20 AC 77 ms
22,800 KB
testcase_21 AC 76 ms
22,640 KB
testcase_22 AC 91 ms
26,876 KB
testcase_23 AC 82 ms
23,656 KB
testcase_24 AC 89 ms
26,820 KB
testcase_25 AC 75 ms
22,716 KB
testcase_26 AC 85 ms
23,744 KB
testcase_27 AC 95 ms
27,776 KB
testcase_28 AC 85 ms
23,752 KB
testcase_29 AC 93 ms
27,416 KB
testcase_30 AC 85 ms
23,920 KB
testcase_31 AC 75 ms
24,616 KB
testcase_32 AC 74 ms
22,816 KB
testcase_33 AC 95 ms
27,736 KB
testcase_34 AC 74 ms
22,512 KB
testcase_35 AC 89 ms
26,932 KB
testcase_36 AC 96 ms
27,816 KB
testcase_37 AC 97 ms
27,768 KB
testcase_38 AC 96 ms
29,920 KB
testcase_39 AC 97 ms
27,824 KB
testcase_40 AC 97 ms
29,840 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.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;

class Magatro
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        int max = N;
        int cnt = 0;
        for(int i = N - 1; i >= 0; i--)
        {
            if (a[i] == max)
            {
                max--;
                cnt++;
            }
        }
        Console.WriteLine(N-cnt);
    }

}

0