結果

問題 No.2226 Hello, Forgotten World!
ユーザー lloyzlloyz
提出日時 2023-02-24 22:18:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 199 ms / 2,000 ms
コード長 729 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 87,188 KB
実行使用メモリ 78,612 KB
最終ジャッジ日時 2023-10-11 06:24:47
合計ジャッジ時間 2,329 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,344 KB
testcase_01 AC 199 ms
78,612 KB
testcase_02 AC 148 ms
78,028 KB
testcase_03 AC 128 ms
77,560 KB
testcase_04 AC 97 ms
77,136 KB
testcase_05 AC 128 ms
77,844 KB
testcase_06 AC 111 ms
77,512 KB
testcase_07 AC 114 ms
77,228 KB
testcase_08 AC 90 ms
76,684 KB
testcase_09 AC 117 ms
77,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

helloworld = "helloworld"
for _ in range(int(input())):
    n = int(input())
    S = list(input())
    ANS = []
    for i in range(n - 9):
        SC = S[:]
        flag = True
        for j in range(10):
            if SC[i + j] == '?':
                continue
            if SC[i + j] == helloworld[j]:
                continue
            flag = False
            break
        if flag:
            for j in range(10):
                if SC[i + j] == '?':
                    SC[i + j] = helloworld[j]
            for j in range(n):
                if SC[j] == '?':
                    SC[j] = 'a'
            ANS.append(''.join(SC))
    if len(ANS) == 0:
        print(-1)
    else:
        ANS.sort()
        print(ANS[0])
0