結果

問題 No.128 お年玉(1)
ユーザー ontama_12ontama_12
提出日時 2016-09-23 16:41:28
言語 JavaScript
(node v20.8.0)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 755 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 5,356 KB
実行使用メモリ 44,132 KB
最終ジャッジ日時 2023-07-24 15:21:34
合計ジャッジ時間 3,476 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
42,380 KB
testcase_01 AC 83 ms
42,052 KB
testcase_02 AC 82 ms
42,096 KB
testcase_03 AC 84 ms
42,128 KB
testcase_04 AC 81 ms
41,972 KB
testcase_05 AC 83 ms
41,916 KB
testcase_06 AC 82 ms
42,044 KB
testcase_07 AC 82 ms
44,020 KB
testcase_08 AC 82 ms
42,128 KB
testcase_09 AC 86 ms
41,972 KB
testcase_10 AC 84 ms
42,288 KB
testcase_11 AC 83 ms
42,128 KB
testcase_12 AC 82 ms
42,168 KB
testcase_13 AC 84 ms
42,112 KB
testcase_14 AC 83 ms
42,260 KB
testcase_15 AC 82 ms
42,168 KB
testcase_16 AC 81 ms
42,372 KB
testcase_17 AC 85 ms
41,912 KB
testcase_18 AC 82 ms
41,972 KB
testcase_19 AC 82 ms
41,976 KB
testcase_20 AC 83 ms
41,988 KB
testcase_21 AC 83 ms
44,132 KB
testcase_22 AC 82 ms
41,908 KB
testcase_23 AC 83 ms
42,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/////////// 	 No.128 お年玉(1)
    //入力文字読み取り
    process.stdin.resume();
    process.stdin.setEncoding('utf8');
    process.stdin.on('data', function (chunk) {

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

        //予算
        var budget = Number(input[0]);
        //配る人数
        var children = Number(input[1]);

        //1000円単位での小数点以下切り捨て
        var result = Math.floor(budget / children / 1000);

        //配る金額が1000未満なら
        if (result == 0) {
            console.log(0);
            //配る金額が1000以上なら1円単位に戻す
        } else {
            console.log(result * 1000);
        }
    });
0