結果

問題 No.2226 Hello, Forgotten World!
ユーザー ntudantuda
提出日時 2023-02-25 21:33:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 518 bytes
コンパイル時間 2,059 ms
コンパイル使用メモリ 86,064 KB
実行使用メモリ 76,676 KB
最終ジャッジ日時 2023-10-11 17:33:21
合計ジャッジ時間 2,186 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
70,928 KB
testcase_01 AC 137 ms
76,444 KB
testcase_02 AC 103 ms
76,676 KB
testcase_03 AC 98 ms
76,608 KB
testcase_04 AC 84 ms
75,788 KB
testcase_05 AC 97 ms
76,580 KB
testcase_06 AC 89 ms
75,948 KB
testcase_07 AC 96 ms
76,520 KB
testcase_08 AC 80 ms
75,744 KB
testcase_09 AC 96 ms
76,504 KB
権限があれば一括ダウンロードができます

ソースコード

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