結果

問題 No.5 数字のブロック
ユーザー hum_ophum_op
提出日時 2016-04-02 10:22:29
言語 F#
(F# 4.0)
結果
AC  
実行時間 338 ms / 5,000 ms
コード長 476 bytes
コンパイル時間 14,769 ms
コンパイル使用メモリ 186,184 KB
実行使用メモリ 38,184 KB
最終ジャッジ日時 2024-04-29 07:07:35
合計ジャッジ時間 20,851 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 328 ms
35,356 KB
testcase_01 AC 324 ms
36,320 KB
testcase_02 AC 320 ms
35,936 KB
testcase_03 AC 336 ms
36,500 KB
testcase_04 AC 307 ms
36,436 KB
testcase_05 AC 302 ms
36,808 KB
testcase_06 AC 306 ms
36,788 KB
testcase_07 AC 338 ms
36,628 KB
testcase_08 AC 337 ms
36,344 KB
testcase_09 AC 335 ms
36,484 KB
testcase_10 AC 326 ms
37,008 KB
testcase_11 AC 323 ms
35,636 KB
testcase_12 AC 328 ms
36,604 KB
testcase_13 AC 336 ms
36,088 KB
testcase_14 AC 327 ms
36,148 KB
testcase_15 AC 326 ms
35,568 KB
testcase_16 AC 315 ms
36,976 KB
testcase_17 AC 321 ms
37,372 KB
testcase_18 AC 323 ms
37,296 KB
testcase_19 AC 309 ms
38,184 KB
testcase_20 AC 308 ms
35,472 KB
testcase_21 AC 311 ms
36,008 KB
testcase_22 AC 329 ms
36,064 KB
testcase_23 AC 328 ms
36,056 KB
testcase_24 AC 332 ms
36,404 KB
testcase_25 AC 322 ms
36,512 KB
testcase_26 AC 320 ms
36,036 KB
testcase_27 AC 313 ms
35,256 KB
testcase_28 AC 332 ms
35,636 KB
testcase_29 AC 333 ms
36,588 KB
testcase_30 AC 321 ms
36,380 KB
testcase_31 AC 311 ms
35,792 KB
testcase_32 AC 310 ms
35,252 KB
testcase_33 AC 318 ms
35,624 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (536 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

[<EntryPoint>]
let main argv =
    let L = int <| Console.ReadLine()
    let N = int <| Console.ReadLine()
    let Win = Console.ReadLine().Split(' ')
    let W = Array.create N 0

    for x in 0 .. N-1 do
        W.[x] <- (Int32.Parse Win.[x])
    done
    let W = Array.sort W

    let mutable c = 0
    let mutable size = 0
    for x in 0 .. N-1 do
        size <- size + W.[x]
        if size <= L then
            c <- c + 1
    done
    printfn "%d" c
    0
0