結果
問題 |
No.32 貯金箱の憂鬱
|
ユーザー |
|
提出日時 | 2021-11-19 22:17:35 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 54 ms / 5,000 ms |
コード長 | 1,165 bytes |
コンパイル時間 | 2,294 ms |
コンパイル使用メモリ | 77,748 KB |
実行使用メモリ | 51,168 KB |
最終ジャッジ日時 | 2025-01-01 18:25:37 |
合計ジャッジ時間 | 3,237 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.UncheckedIOException; import java.util.Arrays; import java.util.stream.Stream; class Main { public static void main(String[] args) { no32(); } // No.32 貯金箱の憂鬱 private static void no32() { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); // 100円硬貨 int $100; // 25円硬貨 int $25; // 1円硬貨 int $1; try { String L = reader.readLine(); $100 = Integer.parseInt(L); String M = reader.readLine(); $25 = Integer.parseInt(M); String N = reader.readLine(); $1 = Integer.parseInt(N); reader.close(); } catch (IOException e) { throw new UncheckedIOException(e); } int total = 0; total += $1 - 25 * ($1 / 25); $25 += $1 / 25; total += $25 - 4 * ($25 / 4); $100 += $25 / 4; total += $100 - 10 * ($100 / 10); System.out.println(total); } }