結果
問題 | No.49 算数の宿題 |
ユーザー |
|
提出日時 | 2022-01-01 11:55:12 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 42 ms / 5,000 ms |
コード長 | 327 bytes |
コンパイル時間 | 853 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 51,968 KB |
最終ジャッジ日時 | 2024-12-23 02:16:11 |
合計ジャッジ時間 | 1,868 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
S = input()l1 = []l2 = []num = 0for s in S:if s == "+" or s == "*":l1.append(num)num = 0l2.append(s)else:num *= 10num += int(s)l1.append(num)ans = l1[0]for i in range(len(l2)):if l2[i] == "*":ans += l1[i+1]else:ans *= l1[i+1]print(ans)