結果

問題 No.388 階段 (1)
ユーザー yu0912
提出日時 2020-07-23 11:06:51
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 5,248 KB
実行使用メモリ 39,296 KB
最終ジャッジ日時 2024-06-23 17:25:58
合計ジャッジ時間 1,780 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

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