結果

問題 No.49 算数の宿題
ユーザー ronpooronpoo
提出日時 2023-08-23 15:27:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 5,000 ms
コード長 256 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 87,320 KB
実行使用メモリ 71,224 KB
最終ジャッジ日時 2023-08-23 15:27:43
合計ジャッジ時間 1,823 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
70,964 KB
testcase_01 AC 71 ms
70,828 KB
testcase_02 AC 70 ms
70,704 KB
testcase_03 AC 71 ms
71,204 KB
testcase_04 AC 70 ms
71,100 KB
testcase_05 AC 71 ms
71,116 KB
testcase_06 AC 71 ms
71,140 KB
testcase_07 AC 74 ms
71,224 KB
testcase_08 AC 70 ms
71,048 KB
testcase_09 AC 70 ms
71,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input() + '*'

ans = 0
v = 0
m = '*'
for i in range(len(S)):
    if S[i] in ['*', '+']:
        if m == '*':
            ans += v
        else:
            ans *= v
        m = S[i]
        v = 0
        continue
    v = v*10 + int(S[i])    
print(ans)
0