結果

問題 No.32 貯金箱の憂鬱
ユーザー kuramukuramu
提出日時 2016-01-19 16:45:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 46 ms / 5,000 ms
コード長 811 bytes
コンパイル時間 1,959 ms
コンパイル使用メモリ 71,724 KB
実行使用メモリ 49,728 KB
最終ジャッジ日時 2023-09-30 08:01:55
合計ジャッジ時間 3,287 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,728 KB
testcase_01 AC 44 ms
47,540 KB
testcase_02 AC 43 ms
49,468 KB
testcase_03 AC 45 ms
49,552 KB
testcase_04 AC 44 ms
49,528 KB
testcase_05 AC 44 ms
49,300 KB
testcase_06 AC 44 ms
49,308 KB
testcase_07 AC 44 ms
49,440 KB
testcase_08 AC 46 ms
49,444 KB
testcase_09 AC 45 ms
49,352 KB
testcase_10 AC 44 ms
49,244 KB
testcase_11 AC 44 ms
49,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);

			int l = Integer.parseInt(stdReader.readLine());
			int m = Integer.parseInt(stdReader.readLine());
			int n = Integer.parseInt(stdReader.readLine());
			if(n==1000){
				n = 0;
			}
			if(n>=100){
				l += n/100;
				n -= (n/100)*100;
			}
			if(n>=25){
				m += n/25;
				n -= (n/25)*25;
			}
			if(m>=40){
				m -= (m/40)*40;
			}
			if(m>=4){
				l += m/4;
				m -= (m/4)*4;
			}
			if(l>=10){
				l -= (l/10)*10;
			}
			out.println((l+m+n));
			out.flush();
			
			}
}
0