結果
| 問題 |
No.2226 Hello, Forgotten World!
|
| コンテスト | |
| ユーザー |
sakasu1
|
| 提出日時 | 2023-03-26 21:36:35 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 701 bytes |
| コンパイル時間 | 2,045 ms |
| コンパイル使用メモリ | 193,860 KB |
| 最終ジャッジ日時 | 2025-02-11 18:16:39 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int main(){
int i,j,t;
cin >> t;
while(t--){
bool flag1=false;
int n;
string s,t="helloworld";
cin >> n >> s;
for(i=n-10;i>=0;i--){
bool flag=true;
for(j=i;j<i+10;j++){
if(!(s[j]==t[j-i] || s[j]=='?')) flag=false;
}
if(flag==false) continue;
for(j=i;j<i+10;j++){
if(s[j]=='?') s[j]=t[j-i];
}
for(j=0;j<i;j++){
if(s[j]=='?') s[j]='a';
}
for(j=i+10;j<n;j++){
if(s[j]=='?') s[j]='a';
}
cout << s << endl;
flag1=true;
break;
}
if(flag1==false) cout << -1 << endl;
}
}
sakasu1