結果
| 問題 |
No.2226 Hello, Forgotten World!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-02-24 22:31:38 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 720 bytes |
| コンパイル時間 | 4,630 ms |
| コンパイル使用メモリ | 192,804 KB |
| 最終ジャッジ日時 | 2025-02-10 21:40:30 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<int(n);i++)
const int MOD = 998244353;
int main(){
string he="helloworld";
int t;
cin>>t;
rep(Ti,t){
int n;
cin>>n;
string s;
cin>>s;
string ans="-1";
for(int i=n-he.size();i>=0;i--){
int flg=0;
for(int j=0;j<he.size();j++){
if(s.at(i+j)=='?') continue;
if(s.at(i+j)!=he.at(j)){
flg=1;
break;
}
}
if(flg) continue;
for(int j=0;j<he.size();j++){
s.at(i+j)=he.at(j);
}
for(int j=0;j<n;j++){
if(s.at(j)=='?') s.at(j)='a';
}
ans=s;
break;
}
cout<<ans<<endl;
}
}