結果

問題 No.49 算数の宿題
ユーザー zimphazimpha
提出日時 2017-12-12 22:46:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 218 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 71,492 KB
最終ジャッジ日時 2023-08-24 17:38:45
合計ジャッジ時間 1,648 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,320 KB
testcase_01 AC 73 ms
71,224 KB
testcase_02 AC 72 ms
71,212 KB
testcase_03 AC 75 ms
71,312 KB
testcase_04 AC 73 ms
71,492 KB
testcase_05 AC 73 ms
71,316 KB
testcase_06 AC 71 ms
71,244 KB
testcase_07 AC 73 ms
71,456 KB
testcase_08 AC 71 ms
71,156 KB
testcase_09 AC 74 ms
71,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input()
r, o, l = 0, 0, 0
for c in s:
  if c == '*' or c == '+':
    if l == 0: r += o
    else: r *= o
    l = 0 if c == '*' else 1
    o = 0
  else:
    o = o * 10 + int(c)
if l == 0: r += o
else: r *= o
print(r)
0