結果
問題 | No.2226 Hello, Forgotten World! |
ユーザー | buey_t |
提出日時 | 2023-02-24 21:49:19 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,724 bytes |
コンパイル時間 | 258 ms |
コンパイル使用メモリ | 82,456 KB |
実行使用メモリ | 89,324 KB |
最終ジャッジ日時 | 2024-09-13 05:20:36 |
合計ジャッジ時間 | 2,239 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 126 ms
85,220 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] == '?': if S[i+1] == 'e' or S[i+1] == '?' : if S[i+2] == 'l' or S[i+2] == '?' : if S[i+3] == 'l' or S[i+3] == '?' : if S[i+4] == 'o' or S[i+4] == '?' : if S[i+5] == 'w' or S[i+5] == '?' : if S[i+6] == 'o' or S[i+6] == '?' : if S[i+7] == 'r' or S[i+7] == '?' : if S[i+8] == 'l' or S[i+8] == '?' : if S[i+9] == 'd' or S[i+1] == '?' : 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()