結果
問題 |
No.193 筒の数式
|
ユーザー |
![]() |
提出日時 | 2024-02-04 20:15:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 553 bytes |
コンパイル時間 | 147 ms |
コンパイル使用メモリ | 82,516 KB |
実行使用メモリ | 53,692 KB |
最終ジャッジ日時 | 2024-09-28 11:20:11 |
合計ジャッジ時間 | 1,649 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 11 WA * 5 |
ソースコード
S = input() N = len(S) operator = {"+","-"} ans = 0 for i in range(N): S = S[1:] + S[:1] if S[0] in operator: continue if S[-1] in operator: continue T = S[:] + "+" i = 0 now = 0 tmp = 0 op = "+" while i <= N: if T[i] not in operator: tmp *= 10 tmp += int(S[i]) else: if op == "+": now += tmp else: now -= tmp tmp = 0 op = T[i] i += 1 ans = max(ans,now) print(ans)