結果

問題 No.179 塗り分け
ユーザー tomiyancetomiyance
提出日時 2019-11-26 08:59:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 592 bytes
コンパイル時間 341 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-04-24 01:07:46
合計ジャッジ時間 3,096 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,880 KB
testcase_01 AC 25 ms
10,752 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 WA -
testcase_08 AC 26 ms
10,752 KB
testcase_09 AC 27 ms
10,880 KB
testcase_10 AC 26 ms
10,752 KB
testcase_11 AC 26 ms
10,752 KB
testcase_12 WA -
testcase_13 RE -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 26 ms
10,752 KB
testcase_17 WA -
testcase_18 AC 26 ms
10,880 KB
testcase_19 AC 26 ms
10,752 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 WA -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

S = []
for i in range(H):
  S.append(input())
def translation(px,py):
  C = [[0 for j in range(H)] for i in range(W)]
  for y in range(H):
    for x in range(W):
      if C[y][x] == 0:
        C[y][x] = 1
        if x + px < W and y + py < H:
          if S[y][x] != S[x + py][y + px]:
            return False
          C[x + py][y + px] = 1
        else:
          if S[y][x] != '.':
            return False
    return True
def check():
  for y in range(H):
    for x in range(W):
      if translation(y,x):
        return 'YES'
  return 'NO'
print(check())
0