結果

問題 No.32 貯金箱の憂鬱
ユーザー kurobei72kurobei72
提出日時 2018-01-19 14:45:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 916 bytes
コンパイル時間 2,940 ms
コンパイル使用メモリ 72,396 KB
実行使用メモリ 56,276 KB
最終ジャッジ日時 2023-09-30 13:03:00
合計ジャッジ時間 5,404 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,732 KB
testcase_01 AC 128 ms
56,276 KB
testcase_02 AC 130 ms
55,904 KB
testcase_03 AC 129 ms
55,708 KB
testcase_04 AC 134 ms
55,820 KB
testcase_05 AC 134 ms
55,536 KB
testcase_06 AC 132 ms
55,992 KB
testcase_07 AC 127 ms
55,808 KB
testcase_08 AC 128 ms
56,048 KB
testcase_09 AC 131 ms
55,848 KB
testcase_10 AC 126 ms
55,576 KB
testcase_11 AC 131 ms
55,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.ArrayList;
import java.lang.String;
import java.lang.Integer;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Integer _1000 = 0;
        Integer _100 = sc.nextInt();
        Integer _25 = sc.nextInt();
        Integer _1 = sc.nextInt();
        int bSum = _1 + _25*25 + _100*100;
        int count = 0;
        
        if (_1/25 > 0){
            _25 += _1/25;
            _1 = _1%25;
        }
        if (_25/4 > 0 ){
            _100 += _25/4;
            _25 = _25%4;
        }
        if (_100/10 > 0){
            _1000 += _100/10;
            _100 = _100%10;
        }
        int aSum = _1 + _25*25 + _100*100 + _1000 * 1000;
        if (aSum != bSum) {
            System.out.println("!");
        }
        count = _1 + _25 + _100;
        System.out.println(count);
    }
}
0