結果

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

テストケース

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

ソースコード

diff #

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

S = []
for i in range(H):
  S.append(input())
def translation(px,py):
  C = [[0 for x in range(W)] for y in range(H)]
  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[y + py][x + px]:
            return False
          C[y + py][x + 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