結果

問題 No.5 数字のブロック
ユーザー mazreanmazrean
提出日時 2019-09-16 00:51:34
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 231 bytes
コンパイル時間 5,072 ms
コンパイル使用メモリ 156,156 KB
実行使用メモリ 26,364 KB
最終ジャッジ日時 2023-09-21 04:18:05
合計ジャッジ時間 9,010 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
20,152 KB
testcase_01 AC 64 ms
24,416 KB
testcase_02 WA -
testcase_03 AC 76 ms
22,652 KB
testcase_04 AC 74 ms
22,820 KB
testcase_05 AC 77 ms
23,028 KB
testcase_06 AC 76 ms
24,732 KB
testcase_07 AC 75 ms
22,660 KB
testcase_08 AC 75 ms
20,648 KB
testcase_09 AC 73 ms
22,612 KB
testcase_10 AC 77 ms
23,140 KB
testcase_11 AC 75 ms
24,764 KB
testcase_12 AC 76 ms
22,740 KB
testcase_13 AC 77 ms
22,976 KB
testcase_14 AC 63 ms
22,340 KB
testcase_15 AC 70 ms
22,328 KB
testcase_16 AC 78 ms
23,072 KB
testcase_17 AC 77 ms
23,120 KB
testcase_18 AC 78 ms
25,072 KB
testcase_19 AC 78 ms
25,124 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 63 ms
22,316 KB
testcase_24 AC 71 ms
22,384 KB
testcase_25 AC 71 ms
22,544 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 75 ms
22,544 KB
testcase_30 AC 74 ms
22,640 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 || sum>l then (i-1)
    else f (i+1) (sum+w.[i])
f 0 0 |> stdout.WriteLine
0