結果
| 問題 |
No.5 数字のブロック
|
| ユーザー |
mlpj56d
|
| 提出日時 | 2017-06-23 12:12:33 |
| 言語 | JavaScript (node v23.5.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 522 bytes |
| コンパイル時間 | 89 ms |
| コンパイル使用メモリ | 5,120 KB |
| 実行使用メモリ | 40,576 KB |
| 最終ジャッジ日時 | 2024-10-13 00:12:00 |
| 合計ジャッジ時間 | 3,063 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 34 |
ソースコード
function Main(input) {
var line = input.split("\n");
var L = +line[0];
var N = +line[1];
var W = line[2].split(" ").map(Number);
rapt(L, N, M);
}
function rapt(L, M, N) {
var widthSum = 0;
var countBox = 0;
W.sort(function (a, b) {
if (a < b) return -1;
if (a > b) return 1;
});
for (var i = 0; widthSum < L; i++) {
widthSum += W[i];
countBox += 1;
}
console.log(countBox);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
mlpj56d