結果

問題 No.32 貯金箱の憂鬱
ユーザー veroomveroom
提出日時 2016-10-15 13:23:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 5,000 ms
コード長 718 bytes
コンパイル時間 3,594 ms
コンパイル使用メモリ 71,744 KB
実行使用メモリ 55,816 KB
最終ジャッジ日時 2023-09-30 08:16:18
合計ジャッジ時間 5,573 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,652 KB
testcase_01 AC 126 ms
55,656 KB
testcase_02 AC 125 ms
55,784 KB
testcase_03 AC 128 ms
55,816 KB
testcase_04 AC 127 ms
55,576 KB
testcase_05 AC 127 ms
55,544 KB
testcase_06 AC 128 ms
55,396 KB
testcase_07 AC 126 ms
55,464 KB
testcase_08 AC 130 ms
55,484 KB
testcase_09 AC 132 ms
55,636 KB
testcase_10 AC 127 ms
55,740 KB
testcase_11 AC 127 ms
55,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Yukicoder {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int one = sc.nextInt();// 1円硬貨枚数
		int twentyFive = sc.nextInt();// 25円硬貨枚数
		int hundred = sc.nextInt();// 100円硬貨枚数
		sc.close();
		int totalCoin = 0;// 硬貨の合計枚数

		// 両替処理開始
		totalCoin = hundred / 25;
		hundred -= totalCoin * 25;
		twentyFive += totalCoin;

		totalCoin = 0;
		totalCoin = twentyFive / 4;
		twentyFive -= totalCoin * 4;
		one += totalCoin;

		totalCoin = 0;
		totalCoin = one / 10;
		one -= totalCoin * 10;

		totalCoin = one + twentyFive + hundred;

		System.out.println(totalCoin);
	}
}
0