結果

問題 No.179 塗り分け
ユーザー lloyzlloyz
提出日時 2023-05-24 00:09:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,160 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 77,824 KB
最終ジャッジ日時 2023-08-24 22:21:55
合計ジャッジ時間 7,126 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,444 KB
testcase_01 AC 70 ms
71,348 KB
testcase_02 AC 71 ms
71,184 KB
testcase_03 AC 72 ms
71,112 KB
testcase_04 AC 71 ms
71,468 KB
testcase_05 AC 96 ms
77,156 KB
testcase_06 AC 71 ms
71,160 KB
testcase_07 WA -
testcase_08 AC 132 ms
77,176 KB
testcase_09 WA -
testcase_10 AC 77 ms
76,308 KB
testcase_11 AC 79 ms
76,108 KB
testcase_12 AC 142 ms
77,420 KB
testcase_13 AC 74 ms
74,984 KB
testcase_14 AC 75 ms
76,184 KB
testcase_15 AC 71 ms
71,228 KB
testcase_16 AC 72 ms
71,232 KB
testcase_17 AC 71 ms
71,420 KB
testcase_18 AC 88 ms
76,640 KB
testcase_19 AC 87 ms
76,396 KB
testcase_20 AC 144 ms
77,328 KB
testcase_21 AC 147 ms
77,288 KB
testcase_22 AC 175 ms
77,492 KB
testcase_23 AC 79 ms
76,124 KB
testcase_24 AC 138 ms
77,188 KB
testcase_25 AC 81 ms
76,420 KB
testcase_26 WA -
testcase_27 AC 144 ms
77,488 KB
testcase_28 WA -
testcase_29 AC 152 ms
77,444 KB
testcase_30 WA -
testcase_31 AC 136 ms
77,312 KB
testcase_32 AC 117 ms
77,344 KB
testcase_33 AC 149 ms
77,360 KB
testcase_34 WA -
testcase_35 AC 146 ms
77,324 KB
testcase_36 AC 73 ms
71,224 KB
testcase_37 AC 73 ms
71,356 KB
testcase_38 AC 74 ms
71,516 KB
testcase_39 AC 72 ms
71,420 KB
testcase_40 AC 70 ms
71,420 KB
testcase_41 AC 74 ms
71,352 KB
testcase_42 AC 72 ms
71,404 KB
testcase_43 AC 85 ms
76,184 KB
testcase_44 AC 93 ms
76,844 KB
testcase_45 AC 79 ms
74,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
F = [list(input()) for _ in range(h)]

for di in range(h):
    for dj in range(w):
        if di == 0 and dj == 0:
            continue
        C = [[None for _ in range(w)] for _ in range(h)]
        flag = True
        for i in range(h):
            for j in range(w):
                if F[i][j] == '#' and C[i][j] == None:
                    C[i][j] = 'R'
                    if i + di < h and j + dj < w:
                        if F[i + di][j + dj] == '#' and C[i + di][j + dj] == None:
                            C[i + di][j + dj] = 'B'
                        else:
                            flag = False
                            break
                    else:
                        flag = False
                        break
            if not flag:
                break
        if flag:
            for i in range(h):
                for j in range(w):
                    if F[i][j] == '#' and C[i][j] == None:
                        flag = False
                        break
                if not flag:
                    break
        if flag:
            print("YES")
            exit()
print("NO")
0