結果

問題 No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー intercept6intercept6
提出日時 2020-07-16 09:47:59
言語 TypeScript
(5.4.3)
結果
AC  
実行時間 353 ms / 2,000 ms
コード長 491 bytes
コンパイル時間 9,107 ms
コンパイル使用メモリ 251,312 KB
実行使用メモリ 58,628 KB
最終ジャッジ日時 2023-08-15 20:59:34
合計ジャッジ時間 13,873 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
42,252 KB
testcase_01 AC 64 ms
42,284 KB
testcase_02 AC 62 ms
42,256 KB
testcase_03 AC 62 ms
42,472 KB
testcase_04 AC 63 ms
42,224 KB
testcase_05 AC 64 ms
42,460 KB
testcase_06 AC 63 ms
42,388 KB
testcase_07 AC 76 ms
45,628 KB
testcase_08 AC 123 ms
53,356 KB
testcase_09 AC 167 ms
58,628 KB
testcase_10 AC 295 ms
52,904 KB
testcase_11 AC 300 ms
52,672 KB
testcase_12 AC 312 ms
57,044 KB
testcase_13 AC 314 ms
57,060 KB
testcase_14 AC 315 ms
57,380 KB
testcase_15 AC 331 ms
57,268 KB
testcase_16 AC 353 ms
57,948 KB
testcase_17 AC 65 ms
42,312 KB
testcase_18 AC 65 ms
42,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import { readFileSync } from 'fs';

function Main(input: string) {
  // inputにはすべての入力の文字列が与えられるので必要に応じて input.split("\n") などで分割する。

  const data = input.split('\n');

  const array = data[1].split(' ');

  const reducer = (accumulator: string, currentValue: string) => {
    return String(BigInt(accumulator) + BigInt(currentValue));
  };

  console.log(array.reduce(reducer));
}

Main(readFileSync('/dev/stdin', 'utf8'));
0