結果

問題 No.2226 Hello, Forgotten World!
ユーザー ntudantuda
提出日時 2023-02-25 21:33:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 518 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 81,684 KB
実行使用メモリ 75,880 KB
最終ジャッジ日時 2024-09-13 16:32:23
合計ジャッジ時間 1,427 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

def check(s):
    s0 = "helloworld"
    for i in range(10):
        if s[i] == "?" or s[i] == s0[i]:
            continue
        else:
            return False
    return "True"

def solve():
    N = int(input())
    S = input()
    T = "zzzz"
    for i in range(N - 9):
        if check(S[i:i + 10]):
            tmp = (S[:i] + "helloworld" + S[i + 10:]).replace("?", "a")
            T = min(T, tmp)
    if T == "zzzz":
        print(-1)
    else:
        print(T)

for _ in range(T):
    solve()
0