結果

問題 No.5 数字のブロック
ユーザー hum_ophum_op
提出日時 2016-04-16 11:49:46
言語 F#
(F# 4.0)
結果
AC  
実行時間 353 ms / 5,000 ms
コード長 399 bytes
コンパイル時間 14,783 ms
コンパイル使用メモリ 185,828 KB
実行使用メモリ 37,600 KB
最終ジャッジ日時 2024-04-29 07:10:47
合計ジャッジ時間 19,138 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 332 ms
35,920 KB
testcase_01 AC 338 ms
36,168 KB
testcase_02 AC 334 ms
35,920 KB
testcase_03 AC 336 ms
36,624 KB
testcase_04 AC 331 ms
36,376 KB
testcase_05 AC 343 ms
36,512 KB
testcase_06 AC 345 ms
36,348 KB
testcase_07 AC 342 ms
36,312 KB
testcase_08 AC 342 ms
36,832 KB
testcase_09 AC 342 ms
35,816 KB
testcase_10 AC 340 ms
36,708 KB
testcase_11 AC 337 ms
35,996 KB
testcase_12 AC 338 ms
36,184 KB
testcase_13 AC 337 ms
36,196 KB
testcase_14 AC 334 ms
35,628 KB
testcase_15 AC 338 ms
36,368 KB
testcase_16 AC 338 ms
36,788 KB
testcase_17 AC 341 ms
36,780 KB
testcase_18 AC 341 ms
36,348 KB
testcase_19 AC 353 ms
37,600 KB
testcase_20 AC 337 ms
35,756 KB
testcase_21 AC 337 ms
35,752 KB
testcase_22 AC 339 ms
35,916 KB
testcase_23 AC 337 ms
35,764 KB
testcase_24 AC 332 ms
36,392 KB
testcase_25 AC 329 ms
36,420 KB
testcase_26 AC 335 ms
35,620 KB
testcase_27 AC 336 ms
35,860 KB
testcase_28 AC 329 ms
35,764 KB
testcase_29 AC 338 ms
36,460 KB
testcase_30 AC 338 ms
36,132 KB
testcase_31 AC 336 ms
35,388 KB
testcase_32 AC 334 ms
36,152 KB
testcase_33 AC 335 ms
35,132 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (294 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

open System

let No5 () =
    let L = int <| Console.ReadLine()
    let N = int <| Console.ReadLine()
    let A = (fun e-> Console.ReadLine().Split(' ') |> Array.map Int32.Parse |> Array.sort ) ()

    let rec last (i:int) (s:int) (c:int) =
        if i < N && s + A.[i] <= L then
            last (i + 1) (s + A.[i]) (c + 1)
        else
            c

    printfn "%d" <| last 0 0 0
    ()

No5 ()
0