結果

問題 No.179 塗り分け
ユーザー aqua_tenhouaqua_tenhou
提出日時 2021-06-20 22:28:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 779 bytes
コンパイル時間 466 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 78,564 KB
最終ジャッジ日時 2023-09-05 01:42:17
合計ジャッジ時間 9,192 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,396 KB
testcase_01 AC 70 ms
71,408 KB
testcase_02 AC 70 ms
71,568 KB
testcase_03 AC 73 ms
71,196 KB
testcase_04 AC 70 ms
71,492 KB
testcase_05 AC 128 ms
77,868 KB
testcase_06 AC 70 ms
71,468 KB
testcase_07 AC 70 ms
71,128 KB
testcase_08 AC 190 ms
77,872 KB
testcase_09 WA -
testcase_10 AC 75 ms
76,292 KB
testcase_11 AC 76 ms
76,264 KB
testcase_12 AC 293 ms
78,148 KB
testcase_13 AC 76 ms
75,820 KB
testcase_14 AC 79 ms
76,832 KB
testcase_15 AC 71 ms
71,536 KB
testcase_16 AC 69 ms
71,256 KB
testcase_17 AC 71 ms
71,468 KB
testcase_18 AC 105 ms
77,416 KB
testcase_19 AC 109 ms
77,708 KB
testcase_20 AC 261 ms
78,564 KB
testcase_21 AC 221 ms
78,080 KB
testcase_22 AC 277 ms
78,340 KB
testcase_23 AC 76 ms
76,060 KB
testcase_24 AC 214 ms
77,752 KB
testcase_25 AC 93 ms
76,780 KB
testcase_26 WA -
testcase_27 AC 282 ms
78,200 KB
testcase_28 WA -
testcase_29 AC 347 ms
78,080 KB
testcase_30 WA -
testcase_31 AC 369 ms
77,956 KB
testcase_32 AC 186 ms
78,076 KB
testcase_33 AC 351 ms
78,128 KB
testcase_34 WA -
testcase_35 AC 367 ms
77,736 KB
testcase_36 AC 70 ms
71,472 KB
testcase_37 AC 70 ms
71,488 KB
testcase_38 AC 71 ms
71,584 KB
testcase_39 AC 69 ms
71,304 KB
testcase_40 AC 69 ms
71,308 KB
testcase_41 AC 68 ms
71,152 KB
testcase_42 AC 73 ms
71,524 KB
testcase_43 AC 109 ms
77,336 KB
testcase_44 AC 136 ms
77,872 KB
testcase_45 AC 89 ms
76,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w = map(int,input().split())
s = [list(input()) for i in range(h)]
c = 0
for x in s: c += x.count("#")
if c == 0:
    print("NO")
    exit()

for i in range(h):
    for j in range(w):
        use = [[0 for _ in range(w)] for __ in range(h)]
        if i == j == 0: continue
        flg = True
        for x in range(h):
             for y in range(w):
                 if s[x][y] == "#" and use[x][y] == 0:
                    if x+i < h and y+j < w and s[x+i][y+j] == "#" and use[x+i][y+j] == 0:
                        use[x][y] = 1
                        use[x+i][y+j] = 1
                    else:
                        flg = False
        cc = 0
        for x in use: cc += x.count(1)
        if flg and c == cc:
            print("YES")
            exit()
print("NO")
0