結果

問題 No.156 キャンディー・ボックス
ユーザー Nobita GomuNobita Gomu
提出日時 2017-09-26 12:41:38
言語 F#
(.NET 7)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 5,287 ms
コンパイル使用メモリ 157,104 KB
実行使用メモリ 25,360 KB
最終ジャッジ日時 2023-09-19 03:27:38
合計ジャッジ時間 9,770 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
25,236 KB
testcase_01 AC 96 ms
23,172 KB
testcase_02 AC 95 ms
23,244 KB
testcase_03 AC 96 ms
23,288 KB
testcase_04 AC 95 ms
25,312 KB
testcase_05 AC 95 ms
25,208 KB
testcase_06 AC 95 ms
23,264 KB
testcase_07 AC 96 ms
25,312 KB
testcase_08 AC 96 ms
23,116 KB
testcase_09 AC 96 ms
25,360 KB
testcase_10 AC 96 ms
23,196 KB
testcase_11 AC 95 ms
23,228 KB
testcase_12 AC 95 ms
23,304 KB
testcase_13 AC 96 ms
23,252 KB
testcase_14 AC 95 ms
23,228 KB
testcase_15 AC 95 ms
23,244 KB
testcase_16 AC 96 ms
23,320 KB
testcase_17 AC 96 ms
23,260 KB
testcase_18 AC 96 ms
25,232 KB
testcase_19 AC 96 ms
21,276 KB
testcase_20 AC 96 ms
23,136 KB
testcase_21 AC 96 ms
25,336 KB
testcase_22 AC 98 ms
25,324 KB
testcase_23 AC 96 ms
23,188 KB
testcase_24 AC 91 ms
23,120 KB
testcase_25 AC 92 ms
25,100 KB
testcase_26 AC 96 ms
23,252 KB
testcase_27 AC 95 ms
23,176 KB
testcase_28 AC 96 ms
23,168 KB
testcase_29 AC 95 ms
23,188 KB
testcase_30 AC 97 ms
23,196 KB
testcase_31 AC 96 ms
23,344 KB
testcase_32 AC 96 ms
23,364 KB
testcase_33 AC 95 ms
23,264 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(14,28): warning FS0044: This construct is deprecated. please use Seq.item

ソースコード

diff #

let split (s:string) = s.Split ' '

let f = split >> Seq.map int >> Seq.last
let g = split >> Seq.map int >> Seq.sort

let count =
    let m = stdin.ReadLine () |> f
    let sq = stdin.ReadLine () |> g

    let rec iter acc c =
        match (m - acc) with
        | i when i < 0 -> c - 1
        | i when i = 0 -> c
        | _ -> iter (acc + Seq.nth c sq) (c + 1)

    iter 0 0

count |> printfn "%d"
0