結果

問題 No.2226 Hello, Forgotten World!
ユーザー kohakoha11301kohakoha11301
提出日時 2023-03-01 11:07:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 1,930 ms
コンパイル使用メモリ 86,568 KB
実行使用メモリ 76,976 KB
最終ジャッジ日時 2023-10-14 15:59:47
合計ジャッジ時間 3,673 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

h = 'helloworld'
for _ in range(int(input())):
    n=int(input())
    s = list(input())
    for i in range(len(s) - len(h), -1, -1):
        flag = True
        for j in range(len(h)):
            if s[i + j] == '?' or s[i + j] == h[j]:
                continue
            else:
                flag = False
        if flag:
            for j in range(len(h)):
                s[i + j] = h[j]
            ans = ''.join(s).replace('?', 'a')
            break
    else:
        ans=-1
    print(ans)
0