結果
問題 |
No.2226 Hello, Forgotten World!
|
ユーザー |
|
提出日時 | 2023-02-24 22:25:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 744 bytes |
コンパイル時間 | 474 ms |
コンパイル使用メモリ | 82,296 KB |
実行使用メモリ | 72,992 KB |
最終ジャッジ日時 | 2024-09-13 05:41:51 |
合計ジャッジ時間 | 1,439 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 9 |
ソースコード
from re import A hello = "helloworld" def solve(): n = int(input()) S = input() if hello in S: ans = [] for s in S: if s == "?": s = "a" ans.append(s) return "".join(ans) for i in range(n-9)[::-1]: ok = 1 for j in range(10): if S[i+j] != "?" and S[i+j] != hello[j]: ok = 0 if ok == 0: continue S = list(S) for j in range(10): S[i+j] = hello[j] ans = [] for s in S: if s == "?": s = "a" ans.append(s) return "".join(ans) return -1 t = int(input()) for _ in range(t): print(solve())