結果

問題 No.32 貯金箱の憂鬱
ユーザー oyafusooyafuso
提出日時 2019-03-11 15:13:14
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,064 bytes
コンパイル時間 2,045 ms
コンパイル使用メモリ 73,324 KB
実行使用メモリ 57,832 KB
最終ジャッジ日時 2023-09-05 20:08:05
合計ジャッジ時間 4,277 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 119 ms
54,336 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {

	private static final String SPLIT_STR = " ";
	private static final int AMOUNT_X = 1000;
	private static final int AMOUNT_L = 100;
	private static final int AMOUNT_M = 25;
	private static final int AMOUNT_N = 1;

	public static void main(String[] args) {
		// Scanner生成
		Scanner sc = new Scanner(System.in);
		// 入力設定
		String input = null;
		List<Integer> numList = new ArrayList<>();
		for (int i = 0; i < 3; i++) {
			sc.reset();
			input = sc.nextLine();
			numList.add(Integer.parseInt(input));
		}
		// Scannerクローズ
		sc.close();

		/* メイン処理開始 */
		// 変数初期化
		int result = 0;
		int L = numList.get(0);
		int M = numList.get(1);
		int N = numList.get(2);
		int amount = 0;
		// 結果設定
		amount = AMOUNT_L * L + AMOUNT_M * M + AMOUNT_N * N;
		amount %= AMOUNT_X;
		result += amount / AMOUNT_L;
		amount %= AMOUNT_L;
		result += amount / AMOUNT_M;
		amount %= AMOUNT_M;
		result += AMOUNT_N;
		/* メイン処理終了 */

		// 結果出力
		System.out.println(result);
	}
}
0