結果

問題 No.2226 Hello, Forgotten World!
ユーザー ああいいああいい
提出日時 2023-02-25 16:52:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 792 bytes
コンパイル時間 720 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 76,540 KB
最終ジャッジ日時 2023-10-11 14:27:15
合計ジャッジ時間 2,344 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,100 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
U = "helloworld"

for _ in range(T):
    N = int(input())
    S = input()
    ans = list(S)
    flag = False
    for i in range(N-1,9-1,-1):
        if flag:
            if ans[i] == "?":
                ans[i] = "a"
            continue
        for j in range(10):
            f = True
            if S[i-j] == "?" or S[i-j] == U[9-j]:
                pass
            else:
                f = False
                break
        if f:
            flag = True
            for j in range(10):
                ans[i-j] = U[9-j]
        else:
            if ans[i] == "?":
                ans[i] = "a"
    if flag:
        for i in range(min(9,len(ans))):
            if ans[i] == "?":
                ans[i] = "a"
        print("".join(ans))
    else:
        print(-1)
    
0