結果

問題 No.179 塗り分け
ユーザー brthyyjpbrthyyjp
提出日時 2021-06-29 02:39:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 853 bytes
コンパイル時間 385 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 78,260 KB
最終ジャッジ日時 2023-09-08 00:08:50
合計ジャッジ時間 6,753 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,336 KB
testcase_01 AC 70 ms
71,228 KB
testcase_02 AC 69 ms
71,272 KB
testcase_03 AC 67 ms
71,300 KB
testcase_04 AC 67 ms
71,092 KB
testcase_05 AC 110 ms
77,324 KB
testcase_06 AC 73 ms
76,080 KB
testcase_07 WA -
testcase_08 AC 186 ms
77,760 KB
testcase_09 AC 189 ms
77,532 KB
testcase_10 AC 80 ms
76,692 KB
testcase_11 AC 82 ms
76,872 KB
testcase_12 AC 170 ms
77,972 KB
testcase_13 AC 70 ms
71,432 KB
testcase_14 AC 74 ms
76,764 KB
testcase_15 AC 68 ms
71,536 KB
testcase_16 AC 66 ms
71,460 KB
testcase_17 AC 69 ms
71,604 KB
testcase_18 AC 106 ms
77,728 KB
testcase_19 AC 107 ms
77,856 KB
testcase_20 AC 167 ms
77,728 KB
testcase_21 AC 178 ms
77,408 KB
testcase_22 AC 189 ms
77,724 KB
testcase_23 AC 82 ms
76,560 KB
testcase_24 AC 189 ms
77,440 KB
testcase_25 AC 81 ms
76,564 KB
testcase_26 AC 111 ms
77,860 KB
testcase_27 AC 149 ms
77,912 KB
testcase_28 AC 106 ms
77,692 KB
testcase_29 AC 147 ms
77,872 KB
testcase_30 AC 122 ms
77,680 KB
testcase_31 AC 147 ms
77,776 KB
testcase_32 AC 121 ms
78,008 KB
testcase_33 AC 150 ms
77,680 KB
testcase_34 AC 139 ms
78,260 KB
testcase_35 AC 146 ms
77,704 KB
testcase_36 AC 73 ms
71,096 KB
testcase_37 AC 70 ms
71,448 KB
testcase_38 AC 69 ms
71,244 KB
testcase_39 AC 70 ms
71,480 KB
testcase_40 AC 70 ms
71,272 KB
testcase_41 AC 68 ms
71,608 KB
testcase_42 AC 68 ms
71,300 KB
testcase_43 AC 104 ms
77,284 KB
testcase_44 AC 109 ms
77,324 KB
testcase_45 AC 78 ms
76,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
S = [input() for i in range(h)]

for di in range(h):
    for dj in range(-(w-1), w):
        if di == 0 and dj == 0:
            continue
        C = [[-1]*w for i in range(h)]
        flag = True
        for i in range(h):
            for j in range(w):
                if S[i][j] == '#' and C[i][j] == -1:
                    C[i][j] = 0
                    ni, nj = i+di, j+dj
                    if 0 <= ni < h and 0 <= nj < w:
                        if S[ni][nj] == '#' and C[ni][nj] == -1:
                            C[ni][nj] = 1
                        else:
                            flag = False
                            break
                    else:
                        flag = False
                        break
        if flag:
            print('YES')
            exit()
else:
    print('NO')
0