結果

問題 No.32 貯金箱の憂鬱
ユーザー phsplsphspls
提出日時 2020-03-25 23:32:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 55 ms / 5,000 ms
コード長 628 bytes
コンパイル時間 1,824 ms
コンパイル使用メモリ 102,640 KB
実行使用メモリ 22,672 KB
最終ジャッジ日時 2023-09-30 13:52:12
合計ジャッジ時間 3,161 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,644 KB
testcase_01 AC 55 ms
20,624 KB
testcase_02 AC 54 ms
20,856 KB
testcase_03 AC 54 ms
20,628 KB
testcase_04 AC 55 ms
20,664 KB
testcase_05 AC 55 ms
20,832 KB
testcase_06 AC 55 ms
22,672 KB
testcase_07 AC 55 ms
20,772 KB
testcase_08 AC 54 ms
20,884 KB
testcase_09 AC 54 ms
20,816 KB
testcase_10 AC 55 ms
20,776 KB
testcase_11 AC 55 ms
18,640 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;

public class P0032 {
    public static void Main() {
        var l = int.Parse(Console.ReadLine().Trim());
        var m = int.Parse(Console.ReadLine().Trim());
        var n = int.Parse(Console.ReadLine().Trim());
        var total = 100*l + 25*m + n;
        var limit1000 = total / 1000;
        var limit100 = Math.Min(limit1000*10, (25*m + n) / 100);
        var limit25  = Math.Min(limit100*4, n / 25);
        var nUsed = limit25 * 25;
        var mUsed = limit100 * 4 - limit25;
        var lUsed = limit1000 * 10 - limit100;
        Console.WriteLine(l+m+n -lUsed-mUsed-nUsed);
    }
}
0