結果

問題 No.5 数字のブロック
ユーザー mazrean
提出日時 2019-09-16 00:51:34
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 231 bytes
コンパイル時間 16,870 ms
コンパイル使用メモリ 185,712 KB
実行使用メモリ 31,104 KB
最終ジャッジ日時 2024-07-06 22:54:48
合計ジャッジ時間 13,300 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (788 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 #

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