結果

問題 No.32 貯金箱の憂鬱
ユーザー yonaka_gggyonaka_ggg
提出日時 2020-09-06 14:39:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 586 bytes
コンパイル時間 3,527 ms
コンパイル使用メモリ 71,660 KB
実行使用メモリ 55,936 KB
最終ジャッジ日時 2023-09-30 14:00:34
合計ジャッジ時間 4,023 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,700 KB
testcase_01 AC 116 ms
55,936 KB
testcase_02 AC 118 ms
55,716 KB
testcase_03 AC 117 ms
55,444 KB
testcase_04 AC 117 ms
55,936 KB
testcase_05 AC 117 ms
55,464 KB
testcase_06 AC 118 ms
55,752 KB
testcase_07 AC 119 ms
55,396 KB
testcase_08 AC 117 ms
55,676 KB
testcase_09 AC 118 ms
55,744 KB
testcase_10 AC 115 ms
55,768 KB
testcase_11 AC 118 ms
55,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt();
        int m = sc.nextInt();
        int n = sc.nextInt();

        int ans = 0;
        if(n < 25)  ans += n;
        else {
            m += n / 25;
            ans += n % 25;
        }
        if(m < 4)  ans += m;
        else {
            l += m / 4;
            ans += m % 4;
        }
        if(l < 10)  ans += l;
        else {
            ans += l % 10;
        }

        System.out.println(ans);
    }

}
0