結果

問題 No.5 数字のブロック
ユーザー mazrean
提出日時 2019-09-16 00:54:07
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 245 bytes
コンパイル時間 7,255 ms
コンパイル使用メモリ 185,904 KB
実行使用メモリ 30,976 KB
最終ジャッジ日時 2024-07-06 22:54:59
合計ジャッジ時間 10,193 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (236 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 then n 
    elif sum>l then (i-1)
    else f (i+1) (sum+w.[i])
f 0 0 |> stdout.WriteLine
0