結果
| 問題 |
No.2226 Hello, Forgotten World!
|
| コンテスト | |
| ユーザー |
Sarievo
|
| 提出日時 | 2023-02-24 23:26:18 |
| 言語 | cLay (20241019-1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 777 bytes |
| コンパイル時間 | 2,515 ms |
| コンパイル使用メモリ | 177,480 KB |
| 実行使用メモリ | 7,624 KB |
| 最終ジャッジ日時 | 2024-09-13 06:10:12 |
| 合計ジャッジ時間 | 3,032 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
const string t = "helloworld";
bool contain(string& s, ll x) {
ll n = s.size();
rep(i, 9) {
if (s[i + x] != t[i]) {
return false;
}
}
return true;
}
bool imply(string& s, ll x) {
ll n = s.size();
rep(i, 9) {
if (s[i + x] != t[i] && s[i + x] != '?') {
return false;
}
}
rep(i, 9) {
if (s[i + x] == '?') {
s[i + x] = t[i];
}
}
return true;
}
void fill(string& s) {
for (auto&& x : s) {
if (x == '?') {
x = 'a';
}
}
}
void solve() {
ll @N;
string @S;
rep(i, (N - 9)) {
if (contain(S, i)) {
fill(S);
wt(S);
return;
}
}
rrep(i, (N - 9)) {
if (imply(S, i)) {
fill(S);
wt(S);
return;
}
}
wt(-1);
}
{
REP(rd_int()) { solve(); }
}
Sarievo