結果

問題 No.32 貯金箱の憂鬱
ユーザー Tsukasa_Type
提出日時 2018-02-08 22:13:05
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 628 bytes
コンパイル時間 1,999 ms
コンパイル使用メモリ 79,260 KB
実行使用メモリ 54,216 KB
最終ジャッジ日時 2024-10-01 06:50:02
合計ジャッジ時間 4,343 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9 WA * 3
権限があれば一括ダウンロードができます

ソースコード

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