結果
問題 | No.3021 Maximize eval |
ユーザー |
![]() |
提出日時 | 2025-02-10 00:45:08 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 110 ms / 2,000 ms |
コード長 | 516 bytes |
コンパイル時間 | 417 ms |
コンパイル使用メモリ | 82,292 KB |
実行使用メモリ | 97,368 KB |
最終ジャッジ日時 | 2025-02-10 00:45:11 |
合計ジャッジ時間 | 3,019 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 15 |
ソースコード
T=int(input())ans=[]for i in range(T):S=list(input())s=Falsefor i in range(len(S)):if S[i].isnumeric():continueelif S[i]=="+":s=Falseelif S[i]=="-":s=Trueelif s and S[i-1]!="-" and i!=len(S)-1 and S[i+1]!="-" and S[i+1]!="+":S[i]="+"s=Falseelif S[i]=="?":if s:S[i]="1"else:S[i]="9"ans.append("".join(S))print(*ans,sep="\n")