結果

問題 No.388 階段 (1)
ユーザー yu0912yu0912
提出日時 2020-07-23 11:06:51
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 62 ms
コンパイル使用メモリ 5,332 KB
実行使用メモリ 42,380 KB
最終ジャッジ日時 2023-09-05 22:06:22
合計ジャッジ時間 2,023 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
42,128 KB
testcase_01 AC 77 ms
42,280 KB
testcase_02 AC 78 ms
42,096 KB
testcase_03 AC 78 ms
42,052 KB
testcase_04 AC 78 ms
42,232 KB
testcase_05 AC 79 ms
42,240 KB
testcase_06 AC 81 ms
42,124 KB
testcase_07 AC 78 ms
42,304 KB
testcase_08 AC 78 ms
42,128 KB
testcase_09 AC 77 ms
42,380 KB
testcase_10 AC 78 ms
42,132 KB
testcase_11 AC 79 ms
42,080 KB
testcase_12 AC 77 ms
42,136 KB
testcase_13 AC 76 ms
42,236 KB
testcase_14 AC 77 ms
42,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function main(input = '') {
  if (!input) throw Error;

  let lines = input.split('\n');
  let [currentSteps, stepsPerFloor] = lines[0]
    .split(' ')
    .map((val) => parseInt(val));

  let currentFloor = Math.floor(currentSteps / stepsPerFloor) + 1;
  return `${currentFloor}`;
}

const { readFileSync, existsSync } = require('fs');
const stdin = '/dev/stdin';

if (existsSync(stdin)) {
  const input = readFileSync(stdin, 'utf8');
  console.log(main(input));
}

module.exports = main;
0