結果
| 問題 |
No.2226 Hello, Forgotten World!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-02-25 16:52:45 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 792 bytes |
| コンパイル時間 | 267 ms |
| コンパイル使用メモリ | 81,664 KB |
| 実行使用メモリ | 63,360 KB |
| 最終ジャッジ日時 | 2024-09-13 13:09:02 |
| 合計ジャッジ時間 | 1,538 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
T = int(input())
U = "helloworld"
for _ in range(T):
N = int(input())
S = input()
ans = list(S)
flag = False
for i in range(N-1,9-1,-1):
if flag:
if ans[i] == "?":
ans[i] = "a"
continue
for j in range(10):
f = True
if S[i-j] == "?" or S[i-j] == U[9-j]:
pass
else:
f = False
break
if f:
flag = True
for j in range(10):
ans[i-j] = U[9-j]
else:
if ans[i] == "?":
ans[i] = "a"
if flag:
for i in range(min(9,len(ans))):
if ans[i] == "?":
ans[i] = "a"
print("".join(ans))
else:
print(-1)