結果

問題 No.5 数字のブロック
ユーザー mazreanmazrean
提出日時 2019-09-16 00:54:07
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 245 bytes
コンパイル時間 3,334 ms
コンパイル使用メモリ 154,872 KB
実行使用メモリ 25,088 KB
最終ジャッジ日時 2023-09-21 04:18:13
合計ジャッジ時間 6,899 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 64 ms
24,340 KB
testcase_02 AC 59 ms
22,416 KB
testcase_03 AC 75 ms
22,604 KB
testcase_04 AC 74 ms
22,676 KB
testcase_05 AC 77 ms
25,004 KB
testcase_06 AC 76 ms
22,920 KB
testcase_07 AC 75 ms
22,716 KB
testcase_08 AC 77 ms
22,912 KB
testcase_09 AC 74 ms
22,756 KB
testcase_10 AC 77 ms
23,148 KB
testcase_11 AC 73 ms
22,792 KB
testcase_12 AC 75 ms
22,876 KB
testcase_13 AC 77 ms
25,028 KB
testcase_14 AC 64 ms
24,340 KB
testcase_15 AC 71 ms
24,524 KB
testcase_16 AC 76 ms
22,972 KB
testcase_17 AC 79 ms
23,328 KB
testcase_18 AC 78 ms
25,088 KB
testcase_19 AC 78 ms
23,220 KB
testcase_20 AC 64 ms
22,164 KB
testcase_21 AC 64 ms
22,272 KB
testcase_22 AC 64 ms
24,296 KB
testcase_23 AC 63 ms
22,416 KB
testcase_24 AC 72 ms
22,500 KB
testcase_25 AC 73 ms
24,520 KB
testcase_26 AC 64 ms
22,356 KB
testcase_27 AC 65 ms
22,268 KB
testcase_28 AC 60 ms
24,352 KB
testcase_29 AC 75 ms
22,812 KB
testcase_30 AC 73 ms
22,544 KB
testcase_31 AC 60 ms
22,316 KB
testcase_32 AC 59 ms
22,348 KB
testcase_33 AC 59 ms
22,316 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 
    elif sum>l then (i-1)
    else f (i+1) (sum+w.[i])
f 0 0 |> stdout.WriteLine
0