結果

問題 No.179 塗り分け
ユーザー kg_curry57kg_curry57
提出日時 2018-06-19 15:44:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 959 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 10,792 KB
実行使用メモリ 8,488 KB
最終ジャッジ日時 2023-09-13 07:08:58
合計ジャッジ時間 3,310 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,144 KB
testcase_01 AC 16 ms
7,852 KB
testcase_02 AC 16 ms
7,972 KB
testcase_03 AC 15 ms
8,012 KB
testcase_04 AC 15 ms
8,024 KB
testcase_05 AC 26 ms
8,032 KB
testcase_06 AC 15 ms
8,052 KB
testcase_07 RE -
testcase_08 AC 15 ms
8,220 KB
testcase_09 AC 15 ms
8,280 KB
testcase_10 AC 16 ms
8,452 KB
testcase_11 AC 16 ms
8,432 KB
testcase_12 AC 217 ms
8,404 KB
testcase_13 AC 16 ms
8,028 KB
testcase_14 AC 15 ms
7,820 KB
testcase_15 AC 15 ms
8,112 KB
testcase_16 AC 15 ms
8,084 KB
testcase_17 RE -
testcase_18 AC 18 ms
8,324 KB
testcase_19 AC 18 ms
8,336 KB
testcase_20 AC 113 ms
8,340 KB
testcase_21 AC 33 ms
8,260 KB
testcase_22 AC 35 ms
8,344 KB
testcase_23 AC 15 ms
8,268 KB
testcase_24 AC 29 ms
8,308 KB
testcase_25 AC 16 ms
8,240 KB
testcase_26 AC 17 ms
8,328 KB
testcase_27 AC 74 ms
8,288 KB
testcase_28 AC 18 ms
8,332 KB
testcase_29 AC 107 ms
8,340 KB
testcase_30 AC 52 ms
8,348 KB
testcase_31 AC 127 ms
8,356 KB
testcase_32 AC 41 ms
8,476 KB
testcase_33 AC 131 ms
8,288 KB
testcase_34 AC 32 ms
8,488 KB
testcase_35 AC 149 ms
8,432 KB
testcase_36 AC 15 ms
8,068 KB
testcase_37 AC 15 ms
8,020 KB
testcase_38 AC 15 ms
8,032 KB
testcase_39 AC 16 ms
7,992 KB
testcase_40 AC 16 ms
7,944 KB
testcase_41 AC 15 ms
8,068 KB
testcase_42 AC 15 ms
8,004 KB
testcase_43 AC 18 ms
7,988 KB
testcase_44 AC 28 ms
7,940 KB
testcase_45 AC 16 ms
8,020 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    h, w = map(int, input().split())
    s = [input() for i in range(h)]

    black = []
    for i in range(h):
        for j in range(w):
            if s[i][j] == "#":
                black.append((i, j))

    cor = black[0]
    for i in range(1, len(black)):
        cor2 = black[i]
        d1, d2 = cor2[0] - cor[0], cor2[1] - cor[1]
        check = [[0 for k in range(w)] for i in range(h)]

        for j in range(1, len(black)):
            if i != j and check[black[j][0]][black[j][1]] == 0:
                if 0 <= black[j][0]+d1 < h and 0 <= black[j][1]+d2 < w:
                    if s[black[j][0]+d1][black[j][1]+d2] == "#":
                        check[black[j][0]][black[j][1]] = 1
                        check[black[j][0]+d1][black[j][1]+d2] = 1
                        continue
                break

        else:
            print("YES")
            break

    else:
        print("NO")


if __name__ == '__main__':
    main()
0