結果
問題 |
No.2226 Hello, Forgotten World!
|
ユーザー |
👑 ![]() |
提出日時 | 2023-02-24 21:32:25 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 462 bytes |
コンパイル時間 | 308 ms |
コンパイル使用メモリ | 82,368 KB |
実行使用メモリ | 64,840 KB |
最終ジャッジ日時 | 2024-09-13 05:07:30 |
合計ジャッジ時間 | 1,162 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 9 |
ソースコード
def substitutable(S,T): return all(S[i]==T[i] or S[i]=="?" or T[i]=="?" for i in range(len(S))) def solve(): N=int(input()) S=input() H="helloworld" for i in range(N-len(H),-1,-1): if substitutable(S[i:i+len(H)],H): return S[:i].replace("?","a")+H+S[i+len(H):].replace("?","a") else: return -1 #================================================== T=int(input()) print(*[solve() for t in range(T)], sep="\n")