結果
問題 |
No.2226 Hello, Forgotten World!
|
ユーザー |
|
提出日時 | 2024-04-10 09:31:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 823 bytes |
コンパイル時間 | 4,386 ms |
コンパイル使用メモリ | 251,636 KB |
最終ジャッジ日時 | 2025-02-20 23:40:33 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 9 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll = long long; using ld = long double; using mint = modint998244353; void solve() { int N; string S, T, C = "helloworld"; cin >> N >> S; int pos = -1, j = 0; for (int i = 0; i < S.size(); i++) { if (S[i] == C[j] || S[i] == '?') { if (j == 0) pos = i; j++; if (j == 10) break; } else { j = 0; pos = -1; } } if (pos != -1 && j < 10) pos = -1; if (pos == -1) { cout << -1 << endl; return; } for (int i = 0; i < S.size(); i++) { if (i == pos) { T += C; i += 9; } else if (S[i] == '?') { T += 'a'; } else { T += S[i]; } } cout << T << endl; } int main() { int T; cin >> T; while (T--) solve(); return 0; }