結果

問題 No.49 算数の宿題
ユーザー とりゐとりゐ
提出日時 2023-06-06 14:30:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 5,000 ms
コード長 255 bytes
コンパイル時間 1,088 ms
コンパイル使用メモリ 86,292 KB
実行使用メモリ 71,208 KB
最終ジャッジ日時 2023-08-28 10:41:39
合計ジャッジ時間 2,651 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,024 KB
testcase_01 AC 71 ms
71,108 KB
testcase_02 AC 71 ms
71,140 KB
testcase_03 AC 72 ms
71,148 KB
testcase_04 AC 70 ms
70,968 KB
testcase_05 AC 70 ms
71,208 KB
testcase_06 AC 71 ms
71,112 KB
testcase_07 AC 70 ms
70,932 KB
testcase_08 AC 69 ms
71,124 KB
testcase_09 AC 70 ms
70,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()

def number():
  global i
  tmp=0
  while i<len(s) and '0'<=s[i]<='9':
    tmp=10*tmp+int(s[i])
    i+=1
  return tmp

i=0
res=number()
while i!=len(s):
  c=s[i]
  i+=1
  res2=number()
  if c=='+':
    res*=res2
  else:
    res+=res2

print(res)
0