結果
問題 |
No.49 算数の宿題
|
ユーザー |
![]() |
提出日時 | 2021-01-08 20:56:13 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 538 bytes |
コンパイル時間 | 262 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 52,096 KB |
最終ジャッジ日時 | 2024-12-23 02:13:56 |
合計ジャッジ時間 | 1,317 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 4 |
ソースコード
s = str(input()) stack = [] for c in s: if not stack: stack.append(c) else: if c != '*' and c != '+': if stack[-1] != '*' and stack[-1] != '+': stack[-1] += c elif stack[-1] == '*': stack.pop() x = stack.pop() stack.append(str(int(x)+int(c))) else: stack.pop() x = stack.pop() stack.append(str(int(x)*int(c))) else: stack.append(c) print(*stack)