結果
問題 |
No.2226 Hello, Forgotten World!
|
ユーザー |
|
提出日時 | 2023-02-24 21:35:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 820 bytes |
コンパイル時間 | 1,669 ms |
コンパイル使用メモリ | 170,528 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 05:10:26 |
合計ジャッジ時間 | 2,190 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; string x = "helloworld"; void solve() { int n; string s; cin >> n >> s; vector<string> can; for (int i = n - (int) x.size(); i >= 0; i--) { string t = s; bool ok = true; for (int j = 0; j < (int) x.size(); j++) { if (t[i + j] != '?' && t[i + j] != x[j]) { ok = false; break; } else { t[i + j] = x[j]; } } if (ok) { for (auto&& c : t) { if (c == '?') { c = 'a'; } } cout << t << endl; return; } } cout << -1 << endl; return; } int main() { int t; cin >> t; while (t--) { solve(); } }