結果

問題 No.2226 Hello, Forgotten World!
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-02-24 21:40:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 780 bytes
コンパイル時間 1,346 ms
コンパイル使用メモリ 86,504 KB
実行使用メモリ 76,388 KB
最終ジャッジ日時 2023-10-11 05:59:33
合計ジャッジ時間 1,737 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
70,720 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 #

import sys
from sys import stdin

TT = int(stdin.readline())
hw = "helloworld"

for loop in range(TT):

    N = int(stdin.readline())

    S = list(stdin.readline()[:-1])

    #if hw in S:
    #    for i in range(N):
    #        if S[i] == "?":
    #            S[i] = "a"

    #    print ("".join(S))
    #    continue
    

    for i in range(N-10,-1,-1):

        flag = True
        for j in range(10):

            if S[i+j] != "?" and S[i+j] != hw[j]:
                flag = False
                break

        if flag:
            for j in range(10):
                S[i+j] = hw[j]

            for j in range(N):
                if S[j] == "?":
                    S[j] = "a"

            print ("".join(S))
            break

    else:
        print (-1)
            
0