結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー yuuDot
提出日時 2025-09-06 13:17:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 517 bytes
コンパイル時間 314 ms
コンパイル使用メモリ 82,876 KB
実行使用メモリ 66,720 KB
最終ジャッジ日時 2025-09-06 13:18:30
合計ジャッジ時間 2,799 ms
ジャッジサーバーID
(参考情報)
judge / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

for i in range(h):
    j = 0
    while j < len(s[i]) - 1:
        if s[i][j] == "9" and s[i][j + 1] == "y":
            s[i][j] = "0"
            s[i][j + 1] = "Y"
        elif s[i][j] == "y" and s[i][j + 1] == "9":
            s[i][j] = "Y"
            s[i][j + 1] = "0"

        j += 1

for line in s:
    ans = line
    j = 0
    while j < len(ans):
        if ans[j] == "0":
            ans[j] = "9"

        j += 1

    print("".join(ans))
0