結果

問題 No.32 貯金箱の憂鬱
ユーザー DevbotBotDevbotBot
提出日時 2015-06-19 11:06:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 5,000 ms
コード長 425 bytes
コンパイル時間 1,895 ms
コンパイル使用メモリ 71,984 KB
実行使用メモリ 56,024 KB
最終ジャッジ日時 2023-09-30 07:51:36
合計ジャッジ時間 4,149 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,960 KB
testcase_01 AC 118 ms
55,728 KB
testcase_02 AC 118 ms
56,024 KB
testcase_03 AC 120 ms
55,960 KB
testcase_04 AC 119 ms
55,708 KB
testcase_05 AC 125 ms
55,880 KB
testcase_06 AC 120 ms
55,860 KB
testcase_07 AC 119 ms
55,612 KB
testcase_08 AC 118 ms
55,912 KB
testcase_09 AC 119 ms
55,800 KB
testcase_10 AC 119 ms
55,500 KB
testcase_11 AC 119 ms
55,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class No32{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int m[] = {1000, 100, 25, 1};
		int L = m[1]*(sc.nextInt());
		int M = m[2]*(sc.nextInt());
		int N = m[3]*(sc.nextInt());
		int sum = L + M + N;
		int coin = 0;
		for (int i=0; i<=3; i++){
			if (i > 0 ){
				coin = coin + (sum/m[i]);
			}
			sum = (sum - m[i]*(sum/m[i]));
		}
		System.out.println(coin);
	}
}
0