結果

問題 No.46 はじめのn歩
ユーザー yu0912yu0912
提出日時 2020-07-23 10:57:24
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 445 bytes
コンパイル時間 37 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 42,596 KB
最終ジャッジ日時 2023-09-05 22:06:15
合計ジャッジ時間 1,630 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
42,252 KB
testcase_01 AC 76 ms
42,120 KB
testcase_02 AC 76 ms
42,124 KB
testcase_03 AC 77 ms
42,128 KB
testcase_04 AC 78 ms
42,344 KB
testcase_05 AC 75 ms
42,124 KB
testcase_06 AC 78 ms
42,240 KB
testcase_07 AC 74 ms
42,172 KB
testcase_08 AC 76 ms
42,596 KB
testcase_09 AC 75 ms
42,304 KB
権限があれば一括ダウンロードができます

ソースコード

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