結果
| 問題 | No.49 算数の宿題 |
| コンテスト | |
| ユーザー |
cherrypi59
|
| 提出日時 | 2018-10-02 22:44:33 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 24 ms / 5,000 ms |
| + 812µs | |
| コード長 | 479 bytes |
| 記録 | |
| コンパイル時間 | 54 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 11,520 KB |
| 最終ジャッジ日時 | 2026-10-15 14:11:35 |
| 合計ジャッジ時間 | 1,676 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 |
ソースコード
def main():
s = input()
idx = 0
while idx < len(s) and s[idx].isdigit():
idx += 1
res = int(s[:idx])
for i in range(len(s)):
if not s[i].isdigit():
idx = i+1
while idx < len(s) and s[idx].isdigit():
idx += 1
if s[i] == "+":
res *= int(s[i+1:idx])
elif s[i] == "*":
res += int(s[i+1:idx])
print(res)
if __name__ == '__main__':
main()
cherrypi59