結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー 学ぶマン
提出日時 2025-09-08 22:21:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 326 bytes
コンパイル時間 437 ms
コンパイル使用メモリ 82,372 KB
実行使用メモリ 64,016 KB
最終ジャッジ日時 2025-09-08 22:21:51
合計ジャッジ時間 2,748 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())

for i in range(H):
    s = list(input())
    pos = 0
    while pos < W:
        if s[pos] == '9':
            s[pos + 1] = 'Y'
            pos += 6
        
        elif s[pos] == 'y':
            s[pos + 4] = 'Y'
            pos += 6
        else:
            pos += 1

    print(''.join(s))
0