結果

問題 No.2226 Hello, Forgotten World!
ユーザー 佐藤篤樹佐藤篤樹
提出日時 2023-04-29 16:29:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,692 bytes
コンパイル時間 3,922 ms
コンパイル使用メモリ 229,004 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-29 09:20:19
合計ジャッジ時間 4,550 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <bits/stdc++.h>
#include <atcoder/all>

using namespace std;

using namespace atcoder;
typedef long long ll;
typedef long double dd;
typedef unsigned long long ull;

typedef vector<ll> vl;
typedef vector<dd> vd;
typedef vector<bool> vb;
typedef vector<pair<ll,ll>> vl_l;

typedef vector<vector<ll>> vvl;
typedef vector<vector<dd>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<pair<ll,ll>>> vvl_l;

typedef vector<vector<vector<ll>>> vvvl;
typedef vector<vector<vector<dd>>> vvvd;
typedef vector<vector<vector<bool>>> vvvb;
typedef vector<vector<vector<pair<ll,ll>>>> vvvl_l;

typedef map<ll,ll> ml;
typedef set<ll> sl;

// #define i_7 (ll)(1E9+7)
#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E18;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
dd EPS=1E-9;
dd PI=acos(-1);
// #define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
template<class T,class S>
inline bool chmax(T &a, S b) {
    if(a < b) {
        a = (T)b;
        return true;
    }
    return false;
}
template<class T,class S>
inline bool chmin(T &a, S b) {
    if(a > b) {
        a = (T)b;
        return true;
    }
    return false;
}
ll hpow(ll x,ll y){
    if(y==0)return 1;
    ll res=hpow(x,y/2);
    res = mod(res*res);
    if(y%2==1){
        res *= x;
        res = mod(res);
    }
    return mod(res);
}
ll hpow_m(ll x,ll y,ll m){
    if(y==0)return 1;
    ll res=hpow_m(x,y/2,m);
    res = (res*res)%m;
    if(y%2==1){
        res *= x;
        res %= m;
    }
    return res%m;
}




void solve(){
    ll n;cin>>n;
    string s;cin>>s;
    string t = "helloworld";
    rep(i,0,s.size()-1){
        bool ok = true;
        rep(j,0,t.size()-1){
            ll k = i + j;
            if(k >= (ll)s.size()){
                ok = false;
                break;
            }
            if(s[k] == t[j] || s[k] == '?'){
                ok = true;
            }else{
                ok = false;
                break;
            }
        }
        if(!ok)continue;
        string ans = s;
        rep(j,0,t.size()-1){
            ll k = i + j;
            ans[k] = t[j];
        }
        rep(j,0,s.size()-1){
            if(ans[j] == '?'){
                ans[j] = 'a';
            }
        }
        cout << ans << endl;
        return;
    }
    
    cout << -1 << endl;
}


signed main(){fastio
    
    ll t;cin>>t;
    rep(i,0,t-1){
        solve();
    }
    
    
    return 0;
}






0