結果
問題 |
No.49 算数の宿題
|
ユーザー |
|
提出日時 | 2016-09-08 15:00:03 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 662 bytes |
コンパイル時間 | 105 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-12-23 01:53:35 |
合計ジャッジ時間 | 983 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 10 |
ソースコード
s = input() stc = [] stc2 = [] ope = [] for i in s: if i.isdigit() == True: stc.append(i) else: ope.append("".join(stc)) stc = [] stc2.append(i) else: ope.append("".join(stc)) stc = [] for j in range(len(stc2)): ope.append(stc2.pop(0)) print(ope) for k in ope: x = 0 if k.isdigit() == True: stc.append(k) print(stc) elif k == "+": x = int(stc.pop(0)) * int(stc.pop(0)) stc.append(str(x)) print(stc) elif k == "*": x = int(stc.pop(0)) + int(stc.pop(0)) stc.append(str(x)) print(stc) else: print(stc.pop())