結果

問題 No.32 貯金箱の憂鬱
ユーザー ontama_12ontama_12
提出日時 2016-09-29 17:44:51
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 976 bytes
コンパイル時間 52 ms
コンパイル使用メモリ 5,332 KB
実行使用メモリ 42,364 KB
最終ジャッジ日時 2023-09-30 08:14:43
合計ジャッジ時間 3,036 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
41,960 KB
testcase_01 AC 78 ms
41,832 KB
testcase_02 AC 79 ms
41,928 KB
testcase_03 AC 78 ms
42,004 KB
testcase_04 AC 77 ms
42,060 KB
testcase_05 AC 78 ms
42,164 KB
testcase_06 AC 77 ms
41,860 KB
testcase_07 AC 80 ms
42,276 KB
testcase_08 AC 80 ms
41,796 KB
testcase_09 AC 78 ms
42,364 KB
testcase_10 AC 78 ms
41,820 KB
testcase_11 AC 78 ms
42,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

  /////////////////////////////////No.32 貯金箱の憂鬱
    //入力文字読み取り
    var inputall = require('fs').readFileSync('/dev/stdin', 'utf8');

    //すべて受け取り空白で区切って格納
    var input = inputall.split("\n");

    var input_hundred = Number(input[0]);
    var input_quotor = Number(input[1]);
    var input_one = Number(input[2]);

    //所持金を出す
    var possession = input_hundred * 100 + input_quotor * 25 + input_one;

    //所持金から硬貨分のお金を引きつつ硬貨のカウントを行う
    var count=0
    while (true) {
        if(possession < 1000){
            break;
        }
        possession-=1000
    }
    while (true) {
        if (possession < 100) {
            break;
        }
        possession -= 100
        count++
    }
    while (true) {
        if (possession < 25) {
            break;
        }
        possession -= 25
        count++
    }
    console.log(count +possession)
0