結果

問題 No.32 貯金箱の憂鬱
ユーザー hhgfhn1hhgfhn1
提出日時 2018-08-21 17:17:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 5,000 ms
コード長 928 bytes
コンパイル時間 1,978 ms
コンパイル使用メモリ 71,840 KB
実行使用メモリ 56,100 KB
最終ジャッジ日時 2023-09-30 13:14:13
合計ジャッジ時間 4,410 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,736 KB
testcase_01 AC 126 ms
55,864 KB
testcase_02 AC 127 ms
55,696 KB
testcase_03 AC 129 ms
55,780 KB
testcase_04 AC 124 ms
56,004 KB
testcase_05 AC 124 ms
56,100 KB
testcase_06 AC 128 ms
55,576 KB
testcase_07 AC 125 ms
56,080 KB
testcase_08 AC 125 ms
55,988 KB
testcase_09 AC 124 ms
55,884 KB
testcase_10 AC 126 ms
56,008 KB
testcase_11 AC 123 ms
54,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class sampleA {
	private static int n;
	private static int m;
	private static int l;

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		l = scan.nextInt();
		m = scan.nextInt();
		n = scan.nextInt();

		m += change25();
		l += change100();
		change1000();

		System.out.println(l + m + n);
	}

	private static int change25() {
		// TODO 自動生成されたメソッド・スタブ
		int m = 0;
		for (int i = n; i >= 25; i -= 25) {
			m++;
			n -= 25;
		}
		return m;
	}

	private static int change100() {
		// TODO 自動生成されたメソッド・スタブ
		int l = 0;
		for (int i = m; i >= 4; i -= 4) {
			l++;
			m -= 4;
		}
		return l;
	}

	private static int change1000() {
		// TODO 自動生成されたメソッド・スタブ
		int k = 0;
		for (int i = l; i >= 10; i -= 10) {
			k++;
			l -= 10;
		}
		return k;
	}

}
0