結果
| 問題 | No.2226 Hello, Forgotten World! |
| コンテスト | |
| ユーザー |
Sarievo
|
| 提出日時 | 2023-02-24 22:23:20 |
| 言語 | cLay (20250308-1 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 738 bytes |
| 記録 | |
| コンパイル時間 | 3,384 ms |
| コンパイル使用メモリ | 193,320 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-04 03:38:36 |
| 合計ジャッジ時間 | 2,357 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
const string t = "helloworld";
const ll sz_t = t.size();
bool contain(string&s, ll x){
ll n = s.size();
rep(i, sz_t){
if (s[i+x]!=t[i]) {return false;}
}
return true;
}
bool imply(string&s, ll x){
ll n = s.size();
rep(i, sz_t){
if (s[i+x] != t[i] && s[i+x] != '?') {return false;}
}
rep(i, sz_t){
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 - sz_t) + 1) {
if (contain(s, i)) {
fill(s);
wt(s);
return;
}
}
rrep(i, (n - sz_t) + 1) {
if (imply(s, i)) {
fill(s);
wt(s);
return;
}
}
wt(-1);
}
{
REP(rd_int()) {solve();}
}
Sarievo