結果
問題 | No.32 貯金箱の憂鬱 |
ユーザー | ちよちゃん |
提出日時 | 2016-05-11 11:46:13 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 858 bytes |
コンパイル時間 | 3,832 ms |
コンパイル使用メモリ | 78,344 KB |
実行使用メモリ | 41,844 KB |
最終ジャッジ日時 | 2024-04-15 15:09:21 |
合計ジャッジ時間 | 6,239 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 141 ms
41,500 KB |
testcase_01 | AC | 138 ms
41,432 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
ソースコード
import java.util.Scanner; public class Yuki8 { public static void main(String[] args) { final int m_1000yen = 1000; final int m_100yen = 100; final int m_25yen = 25; final int m_1yen = 1; Scanner scan = new Scanner(System.in); int l = scan.nextInt(); int m = scan.nextInt(); int n = scan.nextInt(); scan.close(); int total = (m_100yen * l) + (m_25yen * m ) + (m_1yen * n); int count = 0; if (total % m_1000yen != 0) { //千円はカウントに含めない //count += (total / m_1000yen); total = (total % m_1000yen); } if (total % m_100yen != 0) { count += (total / m_100yen); total = (total % m_100yen); } if (total % m_1yen != 0) { count += (total / m_25yen); total = (total % m_25yen); } count += (total / m_1yen); total = (total % m_1yen); System.out.println(count); } }