結果
| 問題 |
No.32 貯金箱の憂鬱
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-10-15 13:23:20 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 133 ms / 5,000 ms |
| コード長 | 718 bytes |
| コンパイル時間 | 3,182 ms |
| コンパイル使用メモリ | 74,712 KB |
| 実行使用メモリ | 54,388 KB |
| 最終ジャッジ日時 | 2024-07-23 02:26:11 |
| 合計ジャッジ時間 | 5,367 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
package yukicoder;
import java.util.Scanner;
public class Yukicoder {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int one = sc.nextInt();// 1円硬貨枚数
int twentyFive = sc.nextInt();// 25円硬貨枚数
int hundred = sc.nextInt();// 100円硬貨枚数
sc.close();
int totalCoin = 0;// 硬貨の合計枚数
// 両替処理開始
totalCoin = hundred / 25;
hundred -= totalCoin * 25;
twentyFive += totalCoin;
totalCoin = 0;
totalCoin = twentyFive / 4;
twentyFive -= totalCoin * 4;
one += totalCoin;
totalCoin = 0;
totalCoin = one / 10;
one -= totalCoin * 10;
totalCoin = one + twentyFive + hundred;
System.out.println(totalCoin);
}
}