結果
問題 | No.3021 Maximize eval |
ユーザー |
![]() |
提出日時 | 2025-02-14 22:15:19 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 591 bytes |
コンパイル時間 | 3,385 ms |
コンパイル使用メモリ | 82,520 KB |
実行使用メモリ | 338,604 KB |
最終ジャッジ日時 | 2025-02-14 22:16:33 |
合計ジャッジ時間 | 26,513 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 7 TLE * 8 |
ソースコード
def make():S = input()Ans = ""pre = "+"for i in range(len(S)):if S[i] != "?":Ans += S[i]if S[i] == "+":pre = S[i]elif S[i] == "-":pre = S[i]else:if pre == "+":Ans += "9"else:if Ans[-1] not in ("+", "-") and i+1 < len(S) and S[i+1] not in ("+", "-"):Ans += "+"pre = "+"else:Ans += "1"print(Ans)for _ in range(int(input())):make()