結果
| 問題 |
No.2226 Hello, Forgotten World!
|
| コンテスト | |
| ユーザー |
rieaaddlreiuu
|
| 提出日時 | 2024-05-30 17:59:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 839 bytes |
| コンパイル時間 | 2,128 ms |
| コンパイル使用メモリ | 167,688 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-20 21:33:32 |
| 合計ジャッジ時間 | 2,573 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 9 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int i,N;
int flag = 0;
string S;
string T = "helloworld";
int t;
cin >> t;
for(int p=0;p<t;p++){
cin >> N >> S;
for(i=N-10;i>-1;i--){
for(int j=0;j<10;j++){
if(!(S[i+j] == T[j] || S[i+j] == '?')){
flag = 1;
}
}
if(flag == 0){
break;
}
flag = 0;
}
if(i == -1){
cout << -1 << endl;
continue;
}
for(int k=0;k<i;k++){
if(S[k] == '?'){
cout << "a";
} else {
cout << S[k];
}
}
cout << "helloworld";
for(int k=i+10;k<N;k++){
if(S[k] == '?'){
cout << "a";
} else {
cout << S[k];
}
}
cout << endl;
}
}
rieaaddlreiuu