結果

問題 No.46 はじめのn歩
ユーザー yu0912
提出日時 2020-07-23 10:57:24
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 69 ms / 5,000 ms
コード長 445 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 7,068 KB
実行使用メモリ 39,296 KB
最終ジャッジ日時 2024-06-23 17:25:52
合計ジャッジ時間 1,297 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

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

  let lines = input.split('\n');
  let [unitLength, distance] = lines[0].split(' ');

  let numSteps = Math.ceil(parseInt(distance) / parseInt(unitLength));
  return `${numSteps}`;
}

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