結果

問題 No.32 貯金箱の憂鬱
ユーザー ちよちゃんちよちゃん
提出日時 2016-05-11 11:57:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 805 bytes
コンパイル時間 3,252 ms
コンパイル使用メモリ 71,740 KB
実行使用メモリ 56,288 KB
最終ジャッジ日時 2023-09-30 08:08:45
合計ジャッジ時間 5,472 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,680 KB
testcase_01 AC 121 ms
55,588 KB
testcase_02 AC 123 ms
55,792 KB
testcase_03 AC 122 ms
56,288 KB
testcase_04 AC 122 ms
55,896 KB
testcase_05 AC 122 ms
55,628 KB
testcase_06 AC 123 ms
55,704 KB
testcase_07 AC 122 ms
55,728 KB
testcase_08 AC 122 ms
55,912 KB
testcase_09 AC 122 ms
55,596 KB
testcase_10 AC 120 ms
55,636 KB
testcase_11 AC 123 ms
55,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Yuki8 {
	
	public static void main(String[] args) {
		
		final int m_1000yen = 1000;
		final int m_100yen = 100;
		final int m_25yen = 25;
		final int m_1yen = 1;
		
		Scanner scan = new Scanner(System.in);
		int l = scan.nextInt();
		int m = scan.nextInt();
		int n = scan.nextInt();
		scan.close();
		
		int total = (m_100yen * l) + (m_25yen * m ) + (m_1yen * n);
		int count = 0;
		
		if (total / m_1000yen != 0) {
			total = (total % m_1000yen);
					}
		if (total / m_100yen != 0) {
			count += (total / m_100yen);
			total = (total % m_100yen);
		}
		if (total / m_25yen != 0) {
			count += (total / m_25yen);
			total = (total % m_25yen);
		}
		
		count += (total / m_1yen);
		total = (total % m_1yen);
	
		System.out.println(count);
	}
}
0