結果

問題 No.49 算数の宿題
ユーザー nohakai3nohakai3
提出日時 2022-10-22 20:56:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 146 ms / 5,000 ms
コード長 239 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 87,052 KB
実行使用メモリ 79,972 KB
最終ジャッジ日時 2023-08-24 17:52:21
合計ジャッジ時間 2,727 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 146 ms
79,900 KB
testcase_01 AC 142 ms
79,752 KB
testcase_02 AC 142 ms
79,896 KB
testcase_03 AC 141 ms
79,644 KB
testcase_04 AC 143 ms
79,732 KB
testcase_05 AC 144 ms
79,644 KB
testcase_06 AC 142 ms
79,632 KB
testcase_07 AC 143 ms
79,572 KB
testcase_08 AC 146 ms
79,972 KB
testcase_09 AC 144 ms
79,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import re
S = input()
s = re.split('[*+]', S)
res = int(s[0])
cnt = 0
for i in range(len(S)):
    if S[i] == '+':
        res *= int(s[cnt+1])
        cnt += 1
    elif S[i] == '*':
        res += int(s[cnt+1])
        cnt += 1
print(res)
0