結果

問題 No.32 貯金箱の憂鬱
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-08 22:13:05
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 5,043 ms
コンパイル使用メモリ 73,740 KB
実行使用メモリ 58,072 KB
最終ジャッジ日時 2024-04-08 13:46:35
合計ジャッジ時間 5,307 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
58,072 KB
testcase_01 AC 135 ms
57,800 KB
testcase_02 AC 137 ms
57,820 KB
testcase_03 AC 137 ms
57,828 KB
testcase_04 AC 136 ms
58,064 KB
testcase_05 AC 136 ms
57,948 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 137 ms
57,984 KB
testcase_10 AC 140 ms
57,936 KB
testcase_11 AC 132 ms
57,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int num_100 = sc.nextInt();
		int num_25 = sc.nextInt();
		int num_1 = sc.nextInt();
		
		if (num_1 >= 100) {
			int temp = num_1/100;
			num_100 += temp;
			num_1 -= temp*100;
		}
		else if (num_1 >= 25) {
			int temp = num_1/25;
			num_25 += temp;
			num_1 -= temp*25;
		}
		
		if (num_25 >= 4) {
			int temp = num_25/4;
			num_100 += temp;
			num_25 -= temp*4;
		}
		
		if (num_100 >= 10) {
			int temp = num_100/10;
			num_100 -= temp*10;
		}
		
		System.out.println(num_100+num_25+num_1);
	}
}
0