結果

問題 No.32 貯金箱の憂鬱
ユーザー koukonkokoukonko
提出日時 2015-12-07 14:02:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 617 bytes
コンパイル時間 2,441 ms
コンパイル使用メモリ 72,436 KB
実行使用メモリ 49,576 KB
最終ジャッジ日時 2023-09-30 07:59:53
合計ジャッジ時間 3,164 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
49,524 KB
testcase_01 AC 42 ms
49,260 KB
testcase_02 AC 43 ms
49,432 KB
testcase_03 AC 43 ms
49,300 KB
testcase_04 AC 43 ms
49,364 KB
testcase_05 AC 42 ms
49,420 KB
testcase_06 AC 42 ms
49,456 KB
testcase_07 AC 43 ms
49,344 KB
testcase_08 AC 43 ms
49,576 KB
testcase_09 AC 43 ms
49,392 KB
testcase_10 AC 44 ms
49,336 KB
testcase_11 AC 43 ms
49,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) {
		BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));

		try {
			final int[] MONEY = { 100, 25, 1 };
			int sum = 0;
			for (int i = 0; i < 3; ++i) {
				sum += MONEY[i] * Integer.parseInt(buff.readLine());
			}

			int ans = 0;
			sum %= 1000;
			for(int i = 0; i < 3; ++i){
				ans += sum / MONEY[i];
				sum %= MONEY[i];
			}

			System.out.println(ans);

		} catch (NumberFormatException e) {

		} catch (IOException e) {

		}
	}
}
0