結果

問題 No.5 数字のブロック
ユーザー mazreanmazrean
提出日時 2019-09-16 00:56:33
言語 F#
(F# 4.0)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 277 bytes
コンパイル時間 3,228 ms
コンパイル使用メモリ 150,872 KB
実行使用メモリ 25,264 KB
最終ジャッジ日時 2023-09-21 04:18:21
合計ジャッジ時間 7,000 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
22,296 KB
testcase_01 AC 63 ms
22,292 KB
testcase_02 AC 58 ms
22,264 KB
testcase_03 AC 76 ms
24,736 KB
testcase_04 AC 74 ms
24,780 KB
testcase_05 AC 76 ms
23,024 KB
testcase_06 AC 74 ms
22,856 KB
testcase_07 AC 74 ms
24,676 KB
testcase_08 AC 75 ms
22,640 KB
testcase_09 AC 72 ms
22,496 KB
testcase_10 AC 78 ms
23,076 KB
testcase_11 AC 74 ms
24,568 KB
testcase_12 AC 76 ms
22,912 KB
testcase_13 AC 77 ms
23,004 KB
testcase_14 AC 64 ms
24,292 KB
testcase_15 AC 71 ms
22,416 KB
testcase_16 AC 76 ms
23,036 KB
testcase_17 AC 77 ms
23,056 KB
testcase_18 AC 76 ms
21,212 KB
testcase_19 AC 78 ms
25,264 KB
testcase_20 AC 63 ms
22,300 KB
testcase_21 AC 64 ms
22,220 KB
testcase_22 AC 64 ms
20,240 KB
testcase_23 AC 63 ms
22,372 KB
testcase_24 AC 71 ms
20,344 KB
testcase_25 AC 72 ms
22,396 KB
testcase_26 AC 64 ms
24,368 KB
testcase_27 AC 63 ms
22,252 KB
testcase_28 AC 58 ms
22,296 KB
testcase_29 AC 73 ms
22,768 KB
testcase_30 AC 73 ms
22,624 KB
testcase_31 AC 61 ms
24,312 KB
testcase_32 AC 60 ms
22,220 KB
testcase_33 AC 60 ms
24,308 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let l = stdin.ReadLine() |> int
let n = stdin.ReadLine() |> int
let w = stdin.ReadLine().Split() |> Array.map int |> Array.sort
let rec f i sum =
    if i=n then n
    else
        let s=sum+w.[i]
        if s>l then i
        else f (i+1) (sum+w.[i])
f 0 0 |> stdout.WriteLine
0