結果

問題 No.289 数字を全て足そう
ユーザー TatsuyaObaTatsuyaOba
提出日時 2015-11-25 11:08:55
言語 Scala(Beta)
(3.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 233 bytes
コンパイル時間 9,168 ms
コンパイル使用メモリ 251,948 KB
実行使用メモリ 64,152 KB
最終ジャッジ日時 2023-09-11 21:54:23
合計ジャッジ時間 34,560 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 965 ms
62,652 KB
testcase_01 AC 938 ms
62,796 KB
testcase_02 AC 913 ms
62,644 KB
testcase_03 AC 935 ms
62,584 KB
testcase_04 AC 949 ms
63,072 KB
testcase_05 AC 957 ms
64,152 KB
testcase_06 AC 953 ms
62,820 KB
testcase_07 AC 963 ms
62,872 KB
testcase_08 AC 976 ms
63,308 KB
testcase_09 AC 952 ms
62,980 KB
testcase_10 AC 964 ms
62,800 KB
testcase_11 AC 968 ms
62,964 KB
testcase_12 AC 973 ms
62,760 KB
testcase_13 AC 981 ms
63,164 KB
testcase_14 AC 965 ms
62,696 KB
testcase_15 AC 955 ms
63,976 KB
testcase_16 AC 945 ms
62,948 KB
testcase_17 AC 951 ms
62,696 KB
testcase_18 AC 963 ms
63,924 KB
testcase_19 AC 970 ms
63,324 KB
testcase_20 TLE -
testcase_21 AC 942 ms
62,636 KB
testcase_22 AC 949 ms
63,024 KB
testcase_23 AC 955 ms
63,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder

import java.util.Scanner

object q289 {
  def main(args: Array[String]) = {
    val sc = new Scanner(System.in)
    var str = sc.next()
    println(str.filter(ch => ch >= '1' && ch <= '9').map(_ - '0').sum)
  }
}

0