結果

問題 No.51 やる気の問題
ユーザー noelexnoelex
提出日時 2017-11-03 12:26:05
言語 F#
(F# 4.0)
結果
AC  
実行時間 306 ms / 5,000 ms
コード長 500 bytes
コンパイル時間 7,812 ms
コンパイル使用メモリ 184,320 KB
実行使用メモリ 36,744 KB
最終ジャッジ日時 2024-05-02 04:38:52
合計ジャッジ時間 16,159 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 300 ms
33,764 KB
testcase_01 AC 289 ms
34,360 KB
testcase_02 AC 290 ms
34,520 KB
testcase_03 AC 303 ms
34,620 KB
testcase_04 AC 303 ms
34,812 KB
testcase_05 AC 297 ms
35,628 KB
testcase_06 AC 297 ms
35,636 KB
testcase_07 AC 302 ms
35,220 KB
testcase_08 AC 292 ms
35,296 KB
testcase_09 AC 296 ms
36,600 KB
testcase_10 AC 302 ms
34,984 KB
testcase_11 AC 292 ms
34,624 KB
testcase_12 AC 292 ms
36,160 KB
testcase_13 AC 293 ms
35,528 KB
testcase_14 AC 297 ms
35,096 KB
testcase_15 AC 298 ms
35,976 KB
testcase_16 AC 296 ms
34,760 KB
testcase_17 AC 296 ms
34,688 KB
testcase_18 AC 300 ms
36,340 KB
testcase_19 AC 303 ms
36,296 KB
testcase_20 AC 302 ms
35,816 KB
testcase_21 AC 300 ms
34,512 KB
testcase_22 AC 306 ms
36,744 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (190 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 #

open System

let workOf days = function
    | work when work>0 ->
        let w = float work
        let d = float days
        (w/pown d 2) |> floor |> int |> Some
    | _ ->
        None 

let rec workOfDue day work prev=
    let s=workOf day work
    match s with
    | None -> 
        prev
    | Some w ->
        workOfDue (day-1) (work-w) w

[<EntryPoint>]
let main argv = 
    let w = Console.ReadLine () |> int
    let d = Console.ReadLine () |> int
    workOfDue d w 0 |> printfn "%d"
    0
0