結果
問題 |
No.2226 Hello, Forgotten World!
|
ユーザー |
![]() |
提出日時 | 2025-09-24 00:34:04 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 715 bytes |
コンパイル時間 | 2,787 ms |
コンパイル使用メモリ | 276,404 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-09-24 00:34:08 |
合計ジャッジ時間 | 3,701 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; inline void solve() { int n; string s; cin >> n >> s; for (int i = n - 10; i >= 0; --i) { string t = s.substr(i, 10); bool match = true; rep(j, 10) { if (t[j] == '?' || t[j] == "helloworld"[j]) continue; match = false; break; } if (match) { rep(j, 10) s[i + j] = "helloworld"[j]; rep(j, n) if (s[j] == '?') s[j] = 'a'; cout << s << '\n'; return; } } cout << -1 << '\n'; } int main() { cin.tie(nullptr)->sync_with_stdio(false); int t; cin >> t; while (t--) solve(); return 0; }