結果

問題 No.289 数字を全て足そう
ユーザー Subaru314Subaru314
提出日時 2021-02-11 15:29:21
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 167 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 9,340 KB
最終ジャッジ日時 2023-09-25 04:54:42
合計ジャッジ時間 1,900 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
9,252 KB
testcase_01 AC 27 ms
9,160 KB
testcase_02 AC 27 ms
9,168 KB
testcase_03 AC 26 ms
8,920 KB
testcase_04 AC 26 ms
9,072 KB
testcase_05 AC 25 ms
9,196 KB
testcase_06 AC 26 ms
9,116 KB
testcase_07 AC 27 ms
9,152 KB
testcase_08 AC 27 ms
9,340 KB
testcase_09 AC 26 ms
9,056 KB
testcase_10 AC 25 ms
9,084 KB
testcase_11 AC 28 ms
9,324 KB
testcase_12 AC 28 ms
9,280 KB
testcase_13 AC 27 ms
9,304 KB
testcase_14 AC 27 ms
9,132 KB
testcase_15 AC 27 ms
9,096 KB
testcase_16 AC 26 ms
9,068 KB
testcase_17 AC 28 ms
9,244 KB
testcase_18 AC 27 ms
9,260 KB
testcase_19 AC 27 ms
9,272 KB
testcase_20 AC 29 ms
9,184 KB
testcase_21 AC 27 ms
9,148 KB
testcase_22 AC 29 ms
9,252 KB
testcase_23 AC 31 ms
9,124 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

w = input()

import re

num = re.sub("\\D", "", w)

n = len(num)

if n == 0:
  print(0)
else:
  ans = 0

  for i in range(n):
    ans = ans + int(num[i])

  print(ans)
0