結果
| 問題 |
No.481 1から10
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-16 09:50:39 |
| 言語 | TypeScript (5.7.2) |
| 結果 |
AC
|
| 実行時間 | 69 ms / 2,000 ms |
| コード長 | 488 bytes |
| コンパイル時間 | 8,856 ms |
| コンパイル使用メモリ | 228,936 KB |
| 実行使用メモリ | 41,328 KB |
| 最終ジャッジ日時 | 2024-12-31 16:19:41 |
| 合計ジャッジ時間 | 9,727 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 |
ソースコード
import { readFileSync } from 'fs';
function reducer(accumulator: number, currentValue: number) {
return accumulator + currentValue;
}
function Main(input: string) {
const data = input.split('\n');
const expectedNumbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const numbers = data[0].split(' ').map(Number);
const expectedSum = expectedNumbers.reduce(reducer);
const sum = numbers.reduce(reducer);
console.log(expectedSum - sum);
}
Main(readFileSync('/dev/stdin', 'utf8'));