結果
| 問題 |
No.2226 Hello, Forgotten World!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-09-28 01:20:36 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 899 bytes |
| コンパイル時間 | 1,845 ms |
| コンパイル使用メモリ | 193,780 KB |
| 最終ジャッジ日時 | 2025-02-24 13:49:54 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, e) for (int i = (int)s; i < (int)e; i++)
string key = "helloworld";
int main() {
cin.tie(nullptr);
int T;
cin >> T;
rep(testcase, 0, T) {
int N;
string S;
cin >> N >> S;
int t = -1;
rep(s, 0, N - 10 + 1) {
bool res = true;
rep(i, 0, 10) {
if (S[s + i] != '?' && S[s + i] != key[i]) res = false;
}
if (res) t = s;
}
if (t == -1) {
cout << -1 << '\n';
continue;
}
rep(i, 0, 10) {
S[t + i] = key[i];
}
rep(i, 0, N) {
if (S[i] == '?') cout << 'a';
else cout << S[i];
}
cout << '\n';
}
}