結果

問題 No.365 ジェンガソート
ユーザー taktak
提出日時 2019-06-13 13:40:32
言語 F#
(.NET 7)
結果
WA  
実行時間 -
コード長 568 bytes
コンパイル時間 4,050 ms
コンパイル使用メモリ 167,720 KB
実行使用メモリ 46,808 KB
最終ジャッジ日時 2023-08-03 12:44:30
合計ジャッジ時間 12,870 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 62 ms
22,344 KB
testcase_01 AC 64 ms
22,332 KB
testcase_02 AC 65 ms
24,392 KB
testcase_03 AC 62 ms
22,252 KB
testcase_04 AC 64 ms
24,388 KB
testcase_05 AC 66 ms
20,212 KB
testcase_06 AC 67 ms
24,216 KB
testcase_07 AC 67 ms
22,328 KB
testcase_08 AC 65 ms
22,244 KB
testcase_09 AC 65 ms
22,308 KB
testcase_10 WA -
testcase_11 AC 65 ms
22,304 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 67 ms
22,240 KB
testcase_15 AC 67 ms
22,236 KB
testcase_16 AC 258 ms
40,780 KB
testcase_17 AC 284 ms
40,368 KB
testcase_18 AC 92 ms
29,680 KB
testcase_19 AC 278 ms
42,272 KB
testcase_20 AC 136 ms
31,624 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 278 ms
44,396 KB
testcase_37 AC 287 ms
44,480 KB
testcase_38 WA -
testcase_39 AC 288 ms
44,316 KB
testcase_40 AC 285 ms
42,164 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

module Program

open System

let solve a =
    let len = a |> Array.length
    let a' =
        let comp =
            a
            |> Array.sort
            |> Array.indexed 
            |> Array.map (fun (idx, x) -> (x, idx))
            |> Map.ofArray
        a 
        |> Array.map (fun x -> comp.[x] + 1)
    
    let dp = Array.zeroCreate (len + 1)
    a' |> Array.iter (fun a -> dp.[a] <- dp.[a-1] + 1)
    len - (dp |> Array.max)

let N = Console.ReadLine() |> ignore
let a = 
    Console.ReadLine().Split()
    |> Array.map int

solve a
|> Console.WriteLine
0