結果
| 問題 |
No.49 算数の宿題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-20 16:05:04 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 5,000 ms |
| コード長 | 251 bytes |
| コンパイル時間 | 162 ms |
| コンパイル使用メモリ | 6,912 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2024-12-23 01:47:08 |
| 合計ジャッジ時間 | 875 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
import re
S = raw_input()
operands = map(int, re.split(r"[+*]", S))
operators = filter(lambda x: not x.isdigit(), S)
ans = operands.pop(0)
for x, y in zip(operands, operators):
if y == '+':
ans *= x
else:
ans += x
print ans