結果

問題 No.3261 yiwiy9 → yiwiY9
ユーザー yt142857
提出日時 2025-09-06 13:55:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 567 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 82,352 KB
実行使用メモリ 77,684 KB
最終ジャッジ日時 2025-09-06 13:55:48
合計ジャッジ時間 3,324 ms
ジャッジサーバーID
(参考情報)
judge / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

y,x = map(int,input().split())
al = []
for i in range(y):
  s = [_ for _ in input()]
  al.append(s)
move = [(0,-1),(0,1)]
iwai = ['y','i','w','i','y','9']
iwai.reverse()
for i in range(y):
  for j in range(x):
    for dy,dx in move:
      if 0<=i+dy<y and 0<=j+dx<x:
        one = True
        for l in range(6):
          if 0<=i+dy*l<y and 0<=j+dx*l<x:
            if al[i+dy*l][j+dx*l] == iwai[l]:
              pass
            else:
              one = False
        if one == True:
          al[i+dy][j+dx] = 'Y'
          break
for i in al:
  print(''.join(i))
0