結果

問題 No.207 世界のなんとか
ユーザー yu0912yu0912
提出日時 2020-07-23 12:17:36
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 518 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 5,332 KB
実行使用メモリ 42,600 KB
最終ジャッジ日時 2023-09-05 22:09:13
合計ジャッジ時間 2,799 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
42,308 KB
testcase_01 AC 75 ms
42,384 KB
testcase_02 AC 77 ms
42,328 KB
testcase_03 AC 77 ms
42,060 KB
testcase_04 AC 77 ms
42,096 KB
testcase_05 AC 80 ms
42,500 KB
testcase_06 AC 76 ms
42,088 KB
testcase_07 AC 76 ms
42,088 KB
testcase_08 AC 76 ms
42,316 KB
testcase_09 AC 76 ms
42,248 KB
testcase_10 AC 76 ms
42,500 KB
testcase_11 AC 77 ms
42,388 KB
testcase_12 AC 76 ms
42,600 KB
testcase_13 AC 76 ms
42,144 KB
testcase_14 AC 76 ms
42,360 KB
testcase_15 AC 77 ms
42,440 KB
testcase_16 AC 76 ms
42,316 KB
testcase_17 AC 76 ms
42,132 KB
testcase_18 AC 75 ms
42,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

  let list = [];

  for (let i = begin; i <= end; i++) {
    if (i % 3 === 0 || String(i).includes('3')) list.push(i);
  }

  return list.join('\n');
}

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