結果

問題 No.179 塗り分け
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-10 22:33:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,131 bytes
コンパイル時間 434 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 133,560 KB
最終ジャッジ日時 2023-08-18 00:55:06
合計ジャッジ時間 6,618 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
75,696 KB
testcase_01 AC 73 ms
70,900 KB
testcase_02 WA -
testcase_03 AC 74 ms
71,308 KB
testcase_04 AC 73 ms
71,252 KB
testcase_05 AC 403 ms
78,760 KB
testcase_06 WA -
testcase_07 AC 76 ms
75,608 KB
testcase_08 AC 105 ms
77,172 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w=map(int,input().split())
g=[input() for i in range(h)]
cnt=0
for i in range(h):
    for j in range(w):
        if g[i][j] == '#':
            cnt+=1
if cnt ==0:
    print('NO')
    exit()
    
    
for x in range(h):
    for y in range(w):
        for xx in range(x+1,h):
            for yy in range(y+1,w):
                xz = xx-x
                yz = yy-y
                f=[[0]*w for i in range(h)]
                ff=0
                for i in range(h):
                    for j in range(w):
                        if g[i][j] == '#' and f[i][j] == 0:                        
                            if i+xz >= h or j + yz >=w:
                                ff = 1
                                break
                            if g[i+xz][j+yz] != '#':
                                ff = 1
                                break
                            f[i+xz][j+yz] = 1
                            f[i][j] = 1
                    if ff == 1:
                        break

                if ff == 0:
                    print('YES')
                    exit()

print('NO')
        
            
    
    
0