結果

問題 No.365 ジェンガソート
ユーザー iwotiwot
提出日時 2020-06-23 10:07:07
言語 F#
(F# 4.0)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 4,148 ms
コンパイル使用メモリ 158,024 KB
実行使用メモリ 34,136 KB
最終ジャッジ日時 2023-09-16 19:48:43
合計ジャッジ時間 10,875 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
22,668 KB
testcase_01 AC 85 ms
22,832 KB
testcase_02 AC 83 ms
22,840 KB
testcase_03 AC 82 ms
22,736 KB
testcase_04 AC 83 ms
22,856 KB
testcase_05 AC 84 ms
24,948 KB
testcase_06 AC 84 ms
24,784 KB
testcase_07 AC 83 ms
22,856 KB
testcase_08 AC 82 ms
20,680 KB
testcase_09 AC 83 ms
22,700 KB
testcase_10 AC 83 ms
22,968 KB
testcase_11 AC 84 ms
22,816 KB
testcase_12 AC 83 ms
24,700 KB
testcase_13 AC 83 ms
24,860 KB
testcase_14 AC 83 ms
22,800 KB
testcase_15 AC 82 ms
22,972 KB
testcase_16 AC 128 ms
30,656 KB
testcase_17 AC 133 ms
31,912 KB
testcase_18 AC 99 ms
21,540 KB
testcase_19 AC 133 ms
32,040 KB
testcase_20 AC 104 ms
25,416 KB
testcase_21 AC 101 ms
22,724 KB
testcase_22 AC 124 ms
28,904 KB
testcase_23 AC 111 ms
26,512 KB
testcase_24 AC 123 ms
30,972 KB
testcase_25 AC 101 ms
26,732 KB
testcase_26 AC 114 ms
29,144 KB
testcase_27 AC 134 ms
34,136 KB
testcase_28 AC 117 ms
27,196 KB
testcase_29 AC 131 ms
31,368 KB
testcase_30 AC 118 ms
29,656 KB
testcase_31 AC 104 ms
24,908 KB
testcase_32 AC 104 ms
24,712 KB
testcase_33 AC 135 ms
32,068 KB
testcase_34 AC 98 ms
24,300 KB
testcase_35 AC 122 ms
30,844 KB
testcase_36 AC 135 ms
30,276 KB
testcase_37 AC 134 ms
32,044 KB
testcase_38 AC 136 ms
32,144 KB
testcase_39 AC 135 ms
32,208 KB
testcase_40 AC 133 ms
32,200 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let N = stdin.ReadLine() |> int
let A = stdin.ReadLine().Split(' ') |> Array.map int

let mutable count = 0
for i in N-1 .. -1 .. 0 do
    if A.[i] = N then
        let mutable find = N - 1
        let mutable tmpcount = 1
        for j in i-1 .. -1 .. 0 do
            if A.[j] = find then
                find <- A.[j] - 1
                tmpcount <- tmpcount + 1
        if tmpcount > count then count <- tmpcount

printfn "%d" <| N - count
0