結果
問題 | No.49 算数の宿題 |
ユーザー |
![]() |
提出日時 | 2022-02-20 17:39:25 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 36 ms / 5,000 ms |
コード長 | 334 bytes |
コンパイル時間 | 119 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-23 02:16:28 |
合計ジャッジ時間 | 1,035 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
S = input()A = []B = []K = ''for c in S:if c != '*' and c != '+':K += celse:A.append(int(K))if c == '*':B.append('+')else:B.append('*')K = ''A.append(int(K))N = len(B)ans = A[0]for i in range(N):ans = eval(f'{ans}{B[i]}{A[i+1]}')print(ans)