結果

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

ソースコード

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