結果

問題 No.179 塗り分け
ユーザー lllllll88938494lllllll88938494
提出日時 2023-05-10 22:38:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 923 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 86,760 KB
実行使用メモリ 77,516 KB
最終ジャッジ日時 2023-08-18 00:58:31
合計ジャッジ時間 6,210 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,324 KB
testcase_01 AC 74 ms
71,376 KB
testcase_02 AC 78 ms
71,108 KB
testcase_03 AC 73 ms
71,300 KB
testcase_04 AC 75 ms
71,196 KB
testcase_05 AC 93 ms
76,540 KB
testcase_06 AC 75 ms
71,384 KB
testcase_07 AC 77 ms
75,588 KB
testcase_08 AC 104 ms
76,952 KB
testcase_09 WA -
testcase_10 AC 81 ms
75,944 KB
testcase_11 AC 82 ms
76,060 KB
testcase_12 AC 116 ms
77,348 KB
testcase_13 AC 75 ms
71,196 KB
testcase_14 AC 77 ms
75,652 KB
testcase_15 AC 72 ms
71,368 KB
testcase_16 AC 72 ms
71,292 KB
testcase_17 AC 73 ms
71,248 KB
testcase_18 AC 85 ms
76,372 KB
testcase_19 AC 84 ms
76,456 KB
testcase_20 AC 108 ms
77,332 KB
testcase_21 AC 116 ms
77,360 KB
testcase_22 AC 147 ms
77,256 KB
testcase_23 AC 84 ms
75,748 KB
testcase_24 AC 108 ms
77,268 KB
testcase_25 AC 82 ms
75,908 KB
testcase_26 WA -
testcase_27 AC 104 ms
76,964 KB
testcase_28 WA -
testcase_29 AC 110 ms
77,296 KB
testcase_30 WA -
testcase_31 AC 104 ms
77,260 KB
testcase_32 AC 98 ms
77,132 KB
testcase_33 AC 111 ms
77,500 KB
testcase_34 WA -
testcase_35 AC 109 ms
77,516 KB
testcase_36 AC 73 ms
71,292 KB
testcase_37 AC 73 ms
71,056 KB
testcase_38 AC 74 ms
71,268 KB
testcase_39 AC 74 ms
71,052 KB
testcase_40 AC 74 ms
71,328 KB
testcase_41 AC 74 ms
71,384 KB
testcase_42 AC 75 ms
71,244 KB
testcase_43 AC 84 ms
75,660 KB
testcase_44 AC 84 ms
76,152 KB
testcase_45 AC 74 ms
71,372 KB
権限があれば一括ダウンロードができます

ソースコード

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 xz in range(h):
    for yz in range(w):
        if 0 == xz and 0 == yz:
            continue
        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