結果
| 問題 | No.32 貯金箱の憂鬱 |
| コンテスト | |
| ユーザー |
oyafuso
|
| 提出日時 | 2019-03-11 15:13:14 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,064 bytes |
| コンパイル時間 | 2,194 ms |
| コンパイル使用メモリ | 76,524 KB |
| 実行使用メモリ | 56,088 KB |
| 最終ジャッジ日時 | 2024-06-23 15:31:54 |
| 合計ジャッジ時間 | 4,327 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 11 |
ソースコード
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);
}
}
oyafuso