結果
問題 | No.49 算数の宿題 |
ユーザー |
![]() |
提出日時 | 2020-04-13 22:27:00 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 5,000 ms |
コード長 | 303 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-23 02:09:38 |
合計ジャッジ時間 | 1,044 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
import sys input=lambda: sys.stdin.readline().rstrip() S=input() ans=0 cal="*" cur="" for s in S: if s=="*" or s=="+": if cal=="*": ans+=int(cur) else: ans*=int(cur) cal=s cur="" else: cur+=s else: if cal=="*": ans+=int(cur) else: ans*=int(cur) print(ans)