結果
問題 | No.656 ゴルフ |
ユーザー |
![]() |
提出日時 | 2021-03-10 11:32:29 |
言語 | TypeScript (5.7.2) |
結果 |
AC
|
実行時間 | 66 ms / 2,000 ms |
コード長 | 365 bytes |
コンパイル時間 | 7,994 ms |
コンパイル使用メモリ | 228,392 KB |
実行使用メモリ | 39,424 KB |
最終ジャッジ日時 | 2024-12-31 16:33:31 |
合計ジャッジ時間 | 9,220 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 6 |
ソースコード
import * as fs from 'fs'; const input = fs.readFileSync('/dev/stdin', 'utf8'); const nlarray = input.split('\n'); const array = nlarray[0].split(''); const narray = array.map(Number); let score = 0; for (let i = 0;i < narray.length; i++) { if (narray[i] === 0) { score += 10; } else { score = score + narray[i]; } } console.log(score);