結果

問題 No.5 数字のブロック
ユーザー swyroakswyroak
提出日時 2021-08-08 18:16:18
言語 JavaScript
(node v21.7.1)
結果
WA  
実行時間 -
コード長 615 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 40,368 KB
最終ジャッジ日時 2023-10-19 18:37:57
合計ジャッジ時間 6,093 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 69 ms
37,436 KB
testcase_02 AC 69 ms
37,436 KB
testcase_03 AC 131 ms
40,368 KB
testcase_04 AC 76 ms
38,760 KB
testcase_05 AC 80 ms
39,036 KB
testcase_06 AC 76 ms
38,876 KB
testcase_07 AC 75 ms
38,828 KB
testcase_08 AC 76 ms
38,980 KB
testcase_09 AC 72 ms
38,696 KB
testcase_10 AC 81 ms
39,084 KB
testcase_11 AC 75 ms
38,812 KB
testcase_12 AC 78 ms
38,956 KB
testcase_13 AC 81 ms
39,032 KB
testcase_14 AC 69 ms
37,492 KB
testcase_15 AC 69 ms
37,496 KB
testcase_16 AC 80 ms
39,056 KB
testcase_17 AC 83 ms
39,300 KB
testcase_18 AC 81 ms
39,116 KB
testcase_19 AC 84 ms
39,676 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 69 ms
37,492 KB
testcase_24 AC 70 ms
37,512 KB
testcase_25 AC 69 ms
37,528 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 69 ms
37,492 KB
testcase_29 AC 77 ms
38,772 KB
testcase_30 AC 74 ms
38,720 KB
testcase_31 AC 70 ms
37,492 KB
testcase_32 AC 69 ms
37,492 KB
testcase_33 AC 71 ms
37,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"use strict";
function Main(input) {
    let BoxLength;
    let Blockqty;
    let Blocks;
    let j, k;
    j = 0;
    k = 0;
    BoxLength = Number(input.split("\n")[0]);
    Blockqty = Number(input.split("\n")[1]);
    Blocks = input.split("\n")[2].split(" ").map((i) => Number(i)).sort((a, b) => a - b);
    do {
        j += Blocks[k];
        ++k;
    } while (j <= BoxLength && k != (Blockqty - 1));
    console.log(k - 1);
}
//テストの入力を受け取る
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
//Main("150\n5\n151 151 151 151 10");
//# sourceMappingURL=index.js.map
0