結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー ts5208
提出日時 2025-09-06 13:09:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,104 bytes
コンパイル時間 387 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 77,768 KB
最終ジャッジ日時 2025-09-06 13:11:01
合計ジャッジ時間 3,053 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import heappop, heappush, heapify
from bisect import bisect
#from sortedcontainers import SortedList
from collections import deque, defaultdict
from math import floor, ceil, isqrt, comb
from sys import stdin, setrecursionlimit
#setrecursionlimit(10**7)
intin = lambda: int(stdin.readline())
strin = lambda: stdin.readline().rstrip()
listin = lambda: list(map(int, stdin.readline().split()))
tuplein = lambda m: [tuple(map(lambda x: int(x) if x.isdigit() or (len(x) > 1 and x[0] == "-" and x[1:].isdigit()) else x, stdin.readline().split())) for _ in range(m)]
gridin = lambda m: [list(map(int, stdin.readline().split())) for _ in range(m)]
strgridin = lambda h: [stdin.readline().rstrip() for _ in range(h)]
mapin = lambda: map(int, stdin.readline().split())
H, W = mapin()
S = [list(strin()) for _ in range(H)]
right = list("yiwiy9")
left = list("9yiwiy")
nr = list("yiwiY9")
nl = list("9Yiwiy")
for i in range(H):
    for j in range(W - 5):
        if S[i][j:j+6] == right:
            S[i][j:j+6] = nr
        elif S[i][j:j+6] == left:
            S[i][j:j+6] = nl
    print("".join(S[i]))
0