結果

問題 No.1071 ベホマラー
ユーザー ikdikd
提出日時 2020-06-06 18:55:02
言語 F#
(F# 4.0)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 519 bytes
コンパイル時間 3,923 ms
コンパイル使用メモリ 165,012 KB
実行使用メモリ 42,444 KB
最終ジャッジ日時 2023-08-25 01:44:55
合計ジャッジ時間 8,844 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
23,084 KB
testcase_01 AC 89 ms
21,136 KB
testcase_02 AC 89 ms
23,236 KB
testcase_03 AC 89 ms
25,036 KB
testcase_04 AC 89 ms
23,080 KB
testcase_05 AC 88 ms
23,252 KB
testcase_06 AC 90 ms
25,092 KB
testcase_07 AC 89 ms
23,124 KB
testcase_08 AC 89 ms
23,008 KB
testcase_09 AC 90 ms
23,096 KB
testcase_10 AC 167 ms
35,068 KB
testcase_11 AC 165 ms
40,992 KB
testcase_12 AC 142 ms
33,336 KB
testcase_13 AC 156 ms
37,896 KB
testcase_14 AC 170 ms
37,776 KB
testcase_15 AC 180 ms
37,124 KB
testcase_16 AC 180 ms
41,176 KB
testcase_17 AC 177 ms
37,224 KB
testcase_18 AC 180 ms
41,104 KB
testcase_19 AC 180 ms
39,092 KB
testcase_20 AC 171 ms
42,288 KB
testcase_21 AC 171 ms
42,312 KB
testcase_22 AC 170 ms
42,444 KB
testcase_23 AC 170 ms
40,300 KB
testcase_24 AC 179 ms
37,052 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

/home/judge/data/code/Main.fs(5,9): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _; _; _|]' may indicate a case not covered by the pattern(s).

ソースコード

diff #

open System

[<EntryPoint>]
let main _ =
    let [| n; k; x; y |] = stdin.ReadLine().Split(' ') |> Array.map int64
    let a = stdin.ReadLine().Split(' ') |> Array.map int64

    let b =
        a
        |> Array.map (fun e -> (e - 1L + k - 1L) / k)
        |> Array.sort

    let (_, imi, maraa) =
        b
        |> Array.fold
            (fun (i, imi, maraa) e -> if y <= x * i then (i - 1L, imi, e) else (i - 1L, imi + e - maraa, maraa))
               (n, 0L, 0L)

    imi * x + maraa * y |> printfn "%d"
    0
0