結果

問題 No.32 貯金箱の憂鬱
ユーザー kameyama_skameyama_s
提出日時 2023-04-18 13:07:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 601 bytes
コンパイル時間 2,179 ms
コンパイル使用メモリ 74,092 KB
実行使用メモリ 41,400 KB
最終ジャッジ日時 2024-04-21 13:02:55
合計ジャッジ時間 4,594 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
41,192 KB
testcase_01 AC 129 ms
41,152 KB
testcase_02 AC 127 ms
41,068 KB
testcase_03 AC 128 ms
41,008 KB
testcase_04 AC 131 ms
41,400 KB
testcase_05 AC 128 ms
41,248 KB
testcase_06 AC 134 ms
40,896 KB
testcase_07 AC 127 ms
41,176 KB
testcase_08 AC 127 ms
41,216 KB
testcase_09 AC 116 ms
39,916 KB
testcase_10 AC 133 ms
41,004 KB
testcase_11 AC 132 ms
41,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int x = a * 100;
        int y = b * 25;
        int z = c * 1;
        
        int total = x + y + z;
        
        int total1000 = total / 1000; 
        int total100 = total % 1000 / 100;
        int total25 = total % 1000 % 100 / 25;
        int total1 = total % 1000 % 100 % 25 / 1;
        
        System.out.println(total100 + total25 + total1);
    }
}
0