結果

問題 No.2226 Hello, Forgotten World!
ユーザー sepa38sepa38
提出日時 2023-02-24 22:01:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 537 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 76,888 KB
最終ジャッジ日時 2023-10-11 06:15:23
合計ジャッジ時間 1,920 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

for _ in range(int(input())):
  n = int(input())
  s = list(map(str, input()))
  t = list(map(str, "helloworld"))
  if not "".join(t) in "".join(s):
    for i in reversed(range(n-9)):
      flg = 1
      for j in range(10):
        if s[i+j] != t[j] and s[i+j] != "?":
          flg = 0
          break
      if flg:
        s = s[:i] + t + s[i+j+1:]
        ng = 0
        break
    if not "".join(t) in "".join(s):
      print(-1)
      continue
  for i in reversed(range(n)):
    if s[i] == "?":
      s[i] = "a"
  print(*s, sep = "")
0