結果

問題 No.2226 Hello, Forgotten World!
ユーザー 👑 timitimi
提出日時 2023-02-24 21:53:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 417 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 86,576 KB
実行使用メモリ 83,524 KB
最終ジャッジ日時 2023-10-11 06:10:06
合計ジャッジ時間 2,182 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,920 KB
testcase_01 AC 207 ms
83,524 KB
testcase_02 AC 142 ms
77,340 KB
testcase_03 AC 117 ms
77,376 KB
testcase_04 AC 90 ms
76,992 KB
testcase_05 AC 116 ms
77,248 KB
testcase_06 AC 101 ms
77,136 KB
testcase_07 AC 106 ms
77,080 KB
testcase_08 AC 87 ms
76,288 KB
testcase_09 AC 108 ms
76,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
W='helloworld'
for _ in range(T):
  N=int(input())
  S=list(input())
  A=[]
  for i in range(N-9):
    SS=S.copy()
    f=0
    for j in range(10):
      if SS[i+j]!=W[j] and SS[i+j]!='?':
        f=1
        break 
      if SS[i+j]=='?':
        SS[i+j]=W[j]
    if f==0:
      SS=''.join(SS)
      SS=SS.replace('?','a')
      A.append(SS)
  if len(A)==0:
    print(-1)
  else:
    print(sorted(A)[0])
0