結果

問題 No.32 貯金箱の憂鬱
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-05 00:05:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 122 ms / 5,000 ms
コード長 463 bytes
コンパイル時間 3,463 ms
コンパイル使用メモリ 71,992 KB
実行使用メモリ 56,164 KB
最終ジャッジ日時 2023-09-30 13:03:51
合計ジャッジ時間 5,373 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,632 KB
testcase_01 AC 121 ms
55,772 KB
testcase_02 AC 118 ms
55,764 KB
testcase_03 AC 119 ms
55,780 KB
testcase_04 AC 122 ms
55,852 KB
testcase_05 AC 118 ms
55,856 KB
testcase_06 AC 119 ms
55,732 KB
testcase_07 AC 118 ms
56,104 KB
testcase_08 AC 118 ms
56,076 KB
testcase_09 AC 119 ms
55,960 KB
testcase_10 AC 121 ms
56,164 KB
testcase_11 AC 119 ms
55,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No32 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt(); //100円硬貨
		int m = sc.nextInt(); //25円硬貨
		int n = sc.nextInt(); //1円硬貨
		int sum = l * 100 + m * 25 + n;
		int k = sum / 1000; //1000円札
		l = (sum - k * 1000) / 100;
		m = (sum - k * 1000 - l * 100) / 25;
		n = (sum - k * 1000 - l * 100 - m * 25);
		
		System.out.println(l + m + n);
	}
}
0