結果
| 問題 | No.49 算数の宿題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-13 19:59:00 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 25 ms / 5,000 ms |
| + 186µs | |
| コード長 | 529 bytes |
| 記録 | |
| コンパイル時間 | 52 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 11,520 KB |
| 最終ジャッジ日時 | 2026-10-15 14:09:42 |
| 合計ジャッジ時間 | 1,610 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
S = list(input())
scaned = []
next_int = []
for c in S:
if c == '*':
scaned.append(int("".join(next_int)))
next_int = []
scaned.append(c)
elif c == '+':
scaned.append(int("".join(next_int)))
next_int = []
scaned.append(c)
else:
next_int.append(c)
scaned.append(int("".join(next_int)))
ans = scaned[0]
for i in range(1, len(scaned), 2):
if scaned[i] == '*':
ans += scaned[i+1]
elif scaned[i] == '+':
ans *= scaned[i+1]
print(ans)