結果

問題 No.32 貯金箱の憂鬱
コンテスト
ユーザー kurobei72
提出日時 2018-01-19 14:45:52
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 57 ms / 5,000 ms
+ 62µs
コード長 916 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,559 ms
コンパイル使用メモリ 84,724 KB
実行使用メモリ 43,136 KB
最終ジャッジ日時 2026-08-23 20:39:37
合計ジャッジ時間 3,584 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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