結果
| 問題 | No.2226 Hello, Forgotten World! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-06-18 15:29:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 523 bytes |
| 記録 | |
| コンパイル時間 | 422 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 53,504 KB |
| 最終ジャッジ日時 | 2026-06-18 15:29:02 |
| 合計ジャッジ時間 | 1,426 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 9 |
ソースコード
T = int(input())
word = "helloworld"
num = len(word)
for _ in range(T):
N = int(input())
S = list(input())
idx = -1
for s in range(N-num+1):
if S[s] != "h" and S[s] != "?":
continue
if all(S[s+i] == word[i] or S[s+i] == "?" for i in range(num)):
idx = s
break
if idx == -1:
print(-1)
continue
for i in range(num):
if S[idx+i] == "?":
S[idx+i] = word[i]
print("".join(S))