結果

問題 No.289 数字を全て足そう
ユーザー uemauema
提出日時 2018-02-19 19:08:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 41 ms / 1,000 ms
コード長 226 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 10,268 KB
最終ジャッジ日時 2023-09-22 20:36:40
合計ジャッジ時間 1,955 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
9,052 KB
testcase_01 AC 26 ms
9,184 KB
testcase_02 AC 26 ms
9,188 KB
testcase_03 AC 26 ms
8,968 KB
testcase_04 AC 25 ms
9,056 KB
testcase_05 AC 27 ms
9,196 KB
testcase_06 AC 27 ms
9,040 KB
testcase_07 AC 33 ms
9,328 KB
testcase_08 AC 33 ms
9,180 KB
testcase_09 AC 27 ms
9,064 KB
testcase_10 AC 30 ms
9,124 KB
testcase_11 AC 31 ms
9,300 KB
testcase_12 AC 33 ms
9,380 KB
testcase_13 AC 31 ms
9,144 KB
testcase_14 AC 34 ms
9,268 KB
testcase_15 AC 31 ms
9,156 KB
testcase_16 AC 29 ms
9,108 KB
testcase_17 AC 31 ms
9,312 KB
testcase_18 AC 34 ms
9,288 KB
testcase_19 AC 31 ms
9,164 KB
testcase_20 AC 33 ms
9,284 KB
testcase_21 AC 25 ms
9,164 KB
testcase_22 AC 33 ms
9,280 KB
testcase_23 AC 41 ms
10,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#cording: utf-8
import re

s = list(input())
pattern = r'([+-]?[0-9]+\.?[0-9]*)'
num = []
for i in s:
    a = re.findall(pattern, i)
    if len(a) != 0:
        num.append(a)
s = 0
for i in num:
    s = s + int(i[0])
print(s)
0