結果
問題 | No.2226 Hello, Forgotten World! |
ユーザー | buey_t |
提出日時 | 2023-02-24 23:31:38 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,747 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 82,188 KB |
実行使用メモリ | 89,224 KB |
最終ジャッジ日時 | 2024-09-13 06:11:07 |
合計ジャッジ時間 | 2,360 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 125 ms
85,152 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 | - |
ソースコード
def main(): try: import pypyjit pypyjit.set_param('max_unroll_recursion=-1') except: pass try: import sys sys.setrecursionlimit(10**7) except: pass from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum import heapq from bisect import bisect_left, bisect_right import copy from collections import deque,Counter,defaultdict from itertools import permutations,combinations from decimal import Decimal,ROUND_HALF_UP #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP) from functools import lru_cache, reduce #@lru_cache(maxsize=None) from operator import add,sub,mul,xor,and_,or_ INF = 10**18 mod1 = 10**9+7 mod2 = 998244353 #DecimalならPython for _ in range(int(input())): N = int(input()) S = list(input()) flag = False for i in range(N-9): if (S[i] == 'h' or S[i] == '?') and \ (S[i+1] == 'e' or S[i+1] == '?') and \ (S[i+2] == 'l' or S[i+2] == '?') and\ (S[i+3] == 'l' or S[i+3] == '?') and\ (S[i+4] == 'o' or S[i+4] == '?') and\ (S[i+5] == 'w' or S[i+5] == '?') and\ (S[i+6] == 'o' or S[i+6] == '?') and\ (S[i+7] == 'r' or S[i+7] == '?') and\ (S[i+8] == 'l' or S[i+8] == '?') and\ (S[i+9] == 'd' or S[i+9] == '?') : S[i] = 'h' S[i+1] = 'e' S[i+2] = 'l' S[i+3] = 'l' S[i+4] = 'o' S[i+5] = 'w' S[i+6] = 'o' S[i+7] = 'r' S[i+8] = 'l' S[i+9] = 'd' flag = True break if flag == True: for i in range(N): if S[i] == '?': S[i] = 'a' print(''.join(S)) else: print(-1) if __name__ == '__main__': main()