結果

問題 No.179 塗り分け
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-11-15 16:56:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,026 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 78,180 KB
最終ジャッジ日時 2023-11-15 16:56:47
合計ジャッジ時間 9,732 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
55,736 KB
testcase_01 AC 45 ms
55,736 KB
testcase_02 AC 43 ms
55,736 KB
testcase_03 AC 44 ms
55,736 KB
testcase_04 AC 43 ms
55,736 KB
testcase_05 AC 107 ms
76,524 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 213 ms
77,468 KB
testcase_09 WA -
testcase_10 AC 59 ms
70,692 KB
testcase_11 AC 58 ms
68,636 KB
testcase_12 AC 344 ms
77,744 KB
testcase_13 AC 54 ms
65,796 KB
testcase_14 AC 54 ms
66,416 KB
testcase_15 AC 46 ms
55,736 KB
testcase_16 AC 44 ms
55,736 KB
testcase_17 AC 46 ms
55,736 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 272 ms
77,780 KB
testcase_21 AC 265 ms
77,620 KB
testcase_22 AC 299 ms
77,908 KB
testcase_23 AC 167 ms
77,016 KB
testcase_24 AC 231 ms
77,636 KB
testcase_25 AC 63 ms
70,704 KB
testcase_26 WA -
testcase_27 AC 294 ms
77,904 KB
testcase_28 WA -
testcase_29 AC 361 ms
77,664 KB
testcase_30 WA -
testcase_31 AC 411 ms
78,168 KB
testcase_32 AC 167 ms
77,028 KB
testcase_33 AC 399 ms
78,180 KB
testcase_34 WA -
testcase_35 AC 390 ms
78,172 KB
testcase_36 AC 44 ms
55,736 KB
testcase_37 AC 43 ms
55,736 KB
testcase_38 AC 43 ms
55,736 KB
testcase_39 AC 44 ms
55,736 KB
testcase_40 AC 44 ms
55,736 KB
testcase_41 AC 43 ms
55,736 KB
testcase_42 AC 46 ms
55,736 KB
testcase_43 AC 86 ms
76,528 KB
testcase_44 AC 112 ms
76,668 KB
testcase_45 AC 68 ms
73,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

H,W = map(int,input().split())
S = [list(input())[:-1] for _ in range(H)]

for i in range(H):
    for j in range(W):
        S[i][j]=int(S[i][j]=='#')
        
        

def check(x,y):
    
    T = [[0]*(2*W) for _ in range(2*H)]
    for i in range(H):
        for j in range(W):
            T[i][j] += S[i][j]
            T[i+x][j+y] += S[i][j]
            
            
    flg = True
    a = 0
    b = 0
    for i in range(H):
        for j in range(W):
            if (S[i][j]==1):
                if T[i][j]==1:
                    a += 1
                    if T[i+x][j+y]!=2:
                        flg = False
                if (T[i][j]==2):
                    b += 1
                    
    return flg&(a==b)
    
for x in range(H):
    for y in range(W):
        if x+y==0:
            continue
        if check(x,y):
            print('YES')
            exit()
print('NO')
0