結果
問題 |
No.2226 Hello, Forgotten World!
|
ユーザー |
![]() |
提出日時 | 2025-05-08 00:01:42 |
言語 | Go (1.23.4) |
結果 |
WA
|
実行時間 | - |
コード長 | 612 bytes |
コンパイル時間 | 11,950 ms |
コンパイル使用メモリ | 236,340 KB |
実行使用メモリ | 7,848 KB |
最終ジャッジ日時 | 2025-05-08 00:01:55 |
合計ジャッジ時間 | 12,740 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 9 |
ソースコード
package main import . "fmt" import . "strings" func main() { var t int Scan(&t) const H = "helloworld" bh := []byte(H) for ; t > 0; t-- { var n int var s string Scan(&n,&s) if Contains(s, H) { s = ReplaceAll(s, "?", "a") Println(s) continue } b := []byte(s) for i := len(b)-len(bh); i >= 0; i-- { ok := true for j, ch := range bh { if b[i+j] != '?' && b[i+j] != ch { ok = false break } } if ok { _ = append(b[i:i], bh...) } } s = string(b) if Contains(s, H) { s = ReplaceAll(s, "?", "a") Println(s) continue } Println(-1) } }