結果
| 問題 | No.32 貯金箱の憂鬱 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-09-05 08:50:10 | 
| 言語 | F# (F# 4.0) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 488 bytes | 
| コンパイル時間 | 9,338 ms | 
| コンパイル使用メモリ | 184,856 KB | 
| 実行使用メモリ | 37,760 KB | 
| 最終ジャッジ日時 | 2024-07-19 03:45:36 | 
| 合計ジャッジ時間 | 14,727 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 9 RE * 3 | 
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (272 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/
ソースコード
    let L = int <| stdin.ReadLine()
    let M = int <| stdin.ReadLine()
    let N = int <| stdin.ReadLine()
    let money =
        Seq.zip [100;25;1;] [L;M;N]
        |> Seq.map (fun (a,b) -> a*b)
        |> Seq.reduce ((+))
    let coins = [1000;100;25;1;]
    let rec f l m p =
        let a,b = m/coins.[p],m%coins.[p]
        if m - a*coins.[p] = 0 then l@[a]
        else f (l@[a]) (m-a*coins.[p]) (p+1)
    f [] money 0
    |> Seq.skip 1
    |> Seq.reduce((+))
    |> printfn "%d"
            
            
            
        