結果
| 問題 |
No.2226 Hello, Forgotten World!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-02-24 21:47:00 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 597 bytes |
| コンパイル時間 | 285 ms |
| コンパイル使用メモリ | 81,920 KB |
| 実行使用メモリ | 68,128 KB |
| 最終ジャッジ日時 | 2024-09-13 05:18:59 |
| 合計ジャッジ時間 | 1,278 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
hw = list("helloworld")
def solve():
n = int(input())
s = input()
for i in range(0,n-10+1)[::-1]:
flg = 1
for j in range(10):
if s[i+j] == hw[j] or s[i+j] == "?": continue
flg = 0
if flg:
ans = []
for j in range(i):
if s[j] == "?":
ans.append("a")
else:
ans.append(s[j])
ans += hw
for j in range(i+10,n):
if s[j] == "?":
ans.append("a")
else:
ans.append(s[j])
print("".join(ans))
break
else:
print(-1)
t = int(input())
for i in range(t):
solve()