結果
| 問題 |
No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
|
| ユーザー |
|
| 提出日時 | 2020-07-16 09:55:24 |
| 言語 | TypeScript (5.7.2) |
| 結果 |
AC
|
| 実行時間 | 222 ms / 3,000 ms |
| コード長 | 438 bytes |
| コンパイル時間 | 7,983 ms |
| コンパイル使用メモリ | 230,024 KB |
| 実行使用メモリ | 60,168 KB |
| 最終ジャッジ日時 | 2024-12-31 16:15:26 |
| 合計ジャッジ時間 | 11,361 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 |
ソースコード
import { readFileSync } from 'fs';
function Main(input: string) {
// inputにはすべての入力の文字列が与えられるので必要に応じて input.split("\n") などで分割する。
const data = input.split('\n');
const num = Number(data[0].split(' '));
let res = 0n;
for (let i = 0; i < num; i++) {
res += BigInt(data[i + 1]);
}
console.log(String(res));
}
Main(readFileSync('/dev/stdin', 'utf8'));