結果

問題 No.3021 Maximize eval
ユーザー nikoro256
提出日時 2025-02-10 00:39:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 441 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 82,708 KB
実行使用メモリ 96,640 KB
最終ジャッジ日時 2025-02-10 00:39:42
合計ジャッジ時間 3,218 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
s=False
for i in range(T):
    S=list(input())
    for i in range(len(S)):
        if S[i]=="?" and s and S[i-1]!="-" and i!=len(S)-1 and S[i+1]!="-" and S[i+1]!="+":
            S[i]="+"
            s=False
        elif S[i]=="+":
            s=False
        elif S[i]=="-":
            s=True
        elif S[i]=="?":
            if s:
                S[i]="1"
            else:
                S[i]="9"
    print(''.join(S))
0