結果

問題 No.32 貯金箱の憂鬱
ユーザー Navi092ittNavi092itt
提出日時 2017-10-17 15:42:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 559 bytes
コンパイル時間 3,542 ms
コンパイル使用メモリ 72,008 KB
実行使用メモリ 56,104 KB
最終ジャッジ日時 2023-09-30 12:43:16
合計ジャッジ時間 5,657 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,840 KB
testcase_01 AC 126 ms
55,928 KB
testcase_02 AC 129 ms
55,780 KB
testcase_03 AC 128 ms
55,784 KB
testcase_04 AC 127 ms
55,976 KB
testcase_05 AC 126 ms
55,780 KB
testcase_06 AC 127 ms
55,672 KB
testcase_07 AC 126 ms
55,660 KB
testcase_08 AC 126 ms
56,076 KB
testcase_09 AC 127 ms
55,760 KB
testcase_10 AC 128 ms
55,636 KB
testcase_11 AC 128 ms
56,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class testC {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        //ここから処理開始

        int L = sc.nextInt();  //100yen
        int M = sc.nextInt();  //25yen
        int N = sc.nextInt();  //1yen

        while (N >= 25) {
            M++; N -= 25;
        }

        while (M >= 4) {
            L++; M -= 4;
        }

        while (L >= 10) {
            L-=10;
        }

        System.out.println(L + M + N);

        //ここまで
        sc.close();
    }
}
0