結果
問題 | No.32 貯金箱の憂鬱 |
ユーザー |
![]() |
提出日時 | 2016-05-11 11:57:28 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 139 ms / 5,000 ms |
コード長 | 805 bytes |
コンパイル時間 | 3,506 ms |
コンパイル使用メモリ | 77,896 KB |
実行使用メモリ | 54,308 KB |
最終ジャッジ日時 | 2024-07-23 02:20:48 |
合計ジャッジ時間 | 5,858 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
ソースコード
package yukicoder; 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) { total = (total % m_1000yen); } if (total / m_100yen != 0) { count += (total / m_100yen); total = (total % m_100yen); } if (total / m_25yen != 0) { count += (total / m_25yen); total = (total % m_25yen); } count += (total / m_1yen); total = (total % m_1yen); System.out.println(count); } }