結果
問題 | No.2226 Hello, Forgotten World! |
ユーザー | gr1msl3y |
提出日時 | 2023-03-18 15:45:42 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 293 ms / 2,000 ms |
コード長 | 630 bytes |
コンパイル時間 | 146 ms |
コンパイル使用メモリ | 81,816 KB |
実行使用メモリ | 81,916 KB |
最終ジャッジ日時 | 2023-10-18 17:20:37 |
合計ジャッジ時間 | 1,825 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
53,556 KB |
testcase_01 | AC | 293 ms
81,916 KB |
testcase_02 | AC | 106 ms
75,924 KB |
testcase_03 | AC | 101 ms
75,764 KB |
testcase_04 | AC | 68 ms
75,472 KB |
testcase_05 | AC | 106 ms
75,932 KB |
testcase_06 | AC | 77 ms
75,504 KB |
testcase_07 | AC | 87 ms
75,608 KB |
testcase_08 | AC | 60 ms
73,328 KB |
testcase_09 | AC | 86 ms
75,560 KB |
ソースコード
T='helloworld' def solve(N,S): ans=[] for i in range(N-10,-1,-1): for j in range(10): if S[i+j]!='?' and S[i+j]!=T[j]: break else: res=[] for j in range(N): if i<=j<i+10: res.append(T[j-i]) elif S[j]=='?': res.append('a') else: res.append(S[j]) ans.append(''.join(res)) if not ans: return '-1' return sorted(ans)[0] t=int(input()) ans=[] for _ in range(t): N=int(input()) S=input() ans.append(solve(N,S)) print(*ans,sep='\n')