結果

問題 No.179 塗り分け
ユーザー brthyyjpbrthyyjp
提出日時 2021-06-29 02:33:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 845 bytes
コンパイル時間 632 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 77,744 KB
最終ジャッジ日時 2023-09-08 00:08:43
合計ジャッジ時間 7,285 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,112 KB
testcase_01 AC 71 ms
71,448 KB
testcase_02 AC 67 ms
70,956 KB
testcase_03 AC 69 ms
71,048 KB
testcase_04 AC 67 ms
71,124 KB
testcase_05 AC 106 ms
77,016 KB
testcase_06 AC 69 ms
71,352 KB
testcase_07 WA -
testcase_08 AC 141 ms
77,088 KB
testcase_09 WA -
testcase_10 AC 76 ms
75,980 KB
testcase_11 AC 75 ms
75,712 KB
testcase_12 AC 147 ms
77,436 KB
testcase_13 AC 68 ms
70,924 KB
testcase_14 AC 71 ms
76,080 KB
testcase_15 AC 66 ms
71,132 KB
testcase_16 AC 66 ms
71,160 KB
testcase_17 AC 66 ms
71,376 KB
testcase_18 AC 88 ms
76,840 KB
testcase_19 AC 87 ms
76,632 KB
testcase_20 AC 129 ms
77,176 KB
testcase_21 AC 133 ms
77,444 KB
testcase_22 AC 178 ms
77,400 KB
testcase_23 AC 71 ms
75,656 KB
testcase_24 AC 136 ms
77,592 KB
testcase_25 AC 79 ms
76,384 KB
testcase_26 WA -
testcase_27 AC 127 ms
77,112 KB
testcase_28 WA -
testcase_29 AC 124 ms
77,088 KB
testcase_30 WA -
testcase_31 AC 138 ms
77,460 KB
testcase_32 AC 111 ms
77,244 KB
testcase_33 AC 133 ms
77,156 KB
testcase_34 WA -
testcase_35 AC 130 ms
77,344 KB
testcase_36 AC 67 ms
71,148 KB
testcase_37 AC 69 ms
71,136 KB
testcase_38 AC 67 ms
71,124 KB
testcase_39 AC 69 ms
70,964 KB
testcase_40 AC 73 ms
70,960 KB
testcase_41 AC 68 ms
71,140 KB
testcase_42 AC 68 ms
71,048 KB
testcase_43 AC 90 ms
76,420 KB
testcase_44 AC 107 ms
77,344 KB
testcase_45 AC 76 ms
76,024 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):
        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