結果

問題 No.32 貯金箱の憂鬱
ユーザー clamdclamd
提出日時 2016-12-10 14:13:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 489 bytes
コンパイル時間 3,261 ms
コンパイル使用メモリ 72,320 KB
実行使用メモリ 56,276 KB
最終ジャッジ日時 2023-09-30 08:19:38
合計ジャッジ時間 5,277 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,728 KB
testcase_01 AC 119 ms
55,612 KB
testcase_02 AC 121 ms
56,252 KB
testcase_03 AC 119 ms
56,276 KB
testcase_04 AC 120 ms
55,984 KB
testcase_05 AC 120 ms
55,568 KB
testcase_06 AC 120 ms
55,676 KB
testcase_07 AC 120 ms
55,668 KB
testcase_08 AC 123 ms
56,236 KB
testcase_09 AC 122 ms
56,032 KB
testcase_10 AC 121 ms
55,668 KB
testcase_11 AC 120 ms
55,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class changeMoney {

	public static void main(String[] args) {
		Scanner sn = new Scanner(System.in);
		int h = sn.nextInt();
		int t = sn.nextInt();
		int w = sn.nextInt();
		int count;
		sn.close();

		while (h >= 10 || t >= 4 || w >= 25) {
			if (w >= 25) {
				t += w / 25;
				w = w % 25;
			} else if (t >= 4) {
				h += t / 4;
				t = t % 4;
			} else if (h >= 10) {
				h = h % 10;
			}
		}
		count = h + t + w;
		System.out.println(count);
	}
}
0