結果
問題 | No.2226 Hello, Forgotten World! |
ユーザー | sakasu1 |
提出日時 | 2023-03-26 21:36:35 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 701 bytes |
コンパイル時間 | 2,962 ms |
コンパイル使用メモリ | 200,888 KB |
実行使用メモリ | 4,348 KB |
最終ジャッジ日時 | 2023-10-19 13:53:12 |
合計ジャッジ時間 | 3,806 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,348 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 | - |
ソースコード
#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; } }