結果
| 問題 |
No.2226 Hello, Forgotten World!
|
| コンテスト | |
| ユーザー |
Kude
|
| 提出日時 | 2023-02-24 22:00:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 2,000 ms |
| コード長 | 406 bytes |
| コンパイル時間 | 273 ms |
| コンパイル使用メモリ | 82,456 KB |
| 実行使用メモリ | 75,732 KB |
| 最終ジャッジ日時 | 2024-09-13 05:28:41 |
| 合計ジャッジ時間 | 1,291 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 9 |
ソースコード
HW = 'helloworld'
for _ in range(int(input())):
n = int(input())
s = input()
ans = '{'
for i in range(n - 10, -1, -1):
for k in range(10):
if s[i + k] != '?' and s[i + k] != HW[k]:
break
else:
ans = min(ans, s[:i].replace('?', 'a') + HW + s[i + 10:].replace('?', 'a'))
if ans == '{':
print(-1)
else:
print(ans)
Kude