結果
問題 |
No.3021 Maximize eval
|
ユーザー |
![]() |
提出日時 | 2025-02-14 23:01:14 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 690 bytes |
コンパイル時間 | 408 ms |
コンパイル使用メモリ | 82,052 KB |
実行使用メモリ | 133,212 KB |
最終ジャッジ日時 | 2025-02-14 23:01:18 |
合計ジャッジ時間 | 3,321 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 WA * 13 |
ソースコード
t = int(input()) for _ in range(t): s = list(input()) n = len(s) stack = list() sign = "+" ans = "" for i in range(n): if s[i]=="+": stack.append("+") sign = "+" elif s[i]=="-": stack.append("-") sign = "-" else: if s[i]=="?" and sign=="+": stack.append("9") elif s[i]=="?" and sign=="-": if 0<i<n-1 and s[i-1]!="-": stack.append("+") sign = "+" else: stack.append("1") else: stack.append(s[i]) ans = "".join(stack) print(ans)