結果

問題 No.481 1から10
ユーザー yu0912yu0912
提出日時 2020-07-23 17:27:10
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 52 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 42,240 KB
最終ジャッジ日時 2023-09-05 22:26:40
合計ジャッジ時間 1,649 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
42,040 KB
testcase_01 AC 78 ms
42,080 KB
testcase_02 AC 77 ms
42,204 KB
testcase_03 AC 78 ms
42,112 KB
testcase_04 AC 78 ms
42,116 KB
testcase_05 AC 77 ms
42,216 KB
testcase_06 AC 77 ms
42,112 KB
testcase_07 AC 78 ms
42,240 KB
testcase_08 AC 77 ms
42,184 KB
testcase_09 AC 77 ms
42,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

function main(input = ``) {
  let lines = input.split('\n');

  let nums = lines[0].split(' ').map((val) => parseInt(val));

  return (
    55 -
    nums.reduce((sum, i) => {
      return sum + i;
    }, 0)
  );
}

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