結果

問題 No.480 合計
ユーザー yu0912yu0912
提出日時 2020-07-23 01:32:24
言語 JavaScript
(node v21.7.1)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 42,352 KB
最終ジャッジ日時 2023-09-05 08:27:37
合計ジャッジ時間 3,093 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
42,212 KB
testcase_01 AC 80 ms
42,244 KB
testcase_02 AC 88 ms
42,276 KB
testcase_03 AC 80 ms
42,336 KB
testcase_04 AC 78 ms
42,244 KB
testcase_05 AC 79 ms
42,144 KB
testcase_06 AC 80 ms
42,088 KB
testcase_07 AC 80 ms
42,060 KB
testcase_08 AC 80 ms
42,268 KB
testcase_09 AC 79 ms
42,240 KB
testcase_10 AC 78 ms
42,088 KB
testcase_11 AC 79 ms
42,320 KB
testcase_12 AC 80 ms
42,244 KB
testcase_13 AC 79 ms
42,240 KB
testcase_14 AC 79 ms
42,080 KB
testcase_15 AC 79 ms
42,088 KB
testcase_16 AC 78 ms
42,084 KB
testcase_17 AC 78 ms
42,180 KB
testcase_18 AC 79 ms
42,172 KB
testcase_19 AC 77 ms
42,236 KB
testcase_20 AC 78 ms
42,352 KB
testcase_21 AC 78 ms
42,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

  let sum = 0;

  for (let i = 1; i <= parseInt(input); i++) {
    sum += i;
  }

  return sum;
}

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