結果

問題 No.179 塗り分け
ユーザー 👑 rin204rin204
提出日時 2022-01-20 09:04:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 792 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 22,272 KB
最終ジャッジ日時 2024-11-23 14:23:29
合計ジャッジ時間 22,196 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
16,000 KB
testcase_01 AC 40 ms
22,272 KB
testcase_02 AC 35 ms
16,128 KB
testcase_03 AC 34 ms
21,888 KB
testcase_04 AC 34 ms
16,128 KB
testcase_05 AC 35 ms
22,144 KB
testcase_06 AC 34 ms
16,000 KB
testcase_07 AC 33 ms
10,880 KB
testcase_08 AC 33 ms
10,752 KB
testcase_09 AC 33 ms
10,880 KB
testcase_10 AC 35 ms
11,136 KB
testcase_11 AC 35 ms
11,264 KB
testcase_12 TLE -
testcase_13 AC 32 ms
10,752 KB
testcase_14 AC 31 ms
10,752 KB
testcase_15 AC 32 ms
10,752 KB
testcase_16 AC 31 ms
10,752 KB
testcase_17 AC 31 ms
10,752 KB
testcase_18 AC 33 ms
11,136 KB
testcase_19 AC 34 ms
11,008 KB
testcase_20 AC 35 ms
11,008 KB
testcase_21 AC 32 ms
11,008 KB
testcase_22 AC 203 ms
10,880 KB
testcase_23 AC 33 ms
11,008 KB
testcase_24 AC 61 ms
10,880 KB
testcase_25 AC 32 ms
10,752 KB
testcase_26 AC 33 ms
10,880 KB
testcase_27 AC 796 ms
10,880 KB
testcase_28 AC 34 ms
11,136 KB
testcase_29 AC 2,188 ms
11,008 KB
testcase_30 AC 38 ms
11,008 KB
testcase_31 TLE -
testcase_32 AC 37 ms
11,264 KB
testcase_33 TLE -
testcase_34 AC 35 ms
11,136 KB
testcase_35 TLE -
testcase_36 AC 30 ms
10,624 KB
testcase_37 AC 31 ms
10,880 KB
testcase_38 AC 31 ms
10,752 KB
testcase_39 AC 31 ms
10,752 KB
testcase_40 AC 32 ms
10,752 KB
testcase_41 AC 31 ms
10,880 KB
testcase_42 AC 32 ms
10,880 KB
testcase_43 AC 58 ms
10,624 KB
testcase_44 AC 199 ms
10,880 KB
testcase_45 AC 36 ms
17,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

points = []
dic = {}
for i in range(h):
    for j in range(w):
        if S[i][j] == "#":
            dic[(i, j)] = len(points)
            points.append((i, j))
            
l = len(points)
if l % 2 == 1:
    print("NO")
    exit()
    
for i in range(l):
    for j in range(i + 1, l):
        di = points[j][0] - points[i][0]
        dj = points[j][1] - points[i][1]
        used = [False] * l
        for k in range(l):
            if used[k]:
                continue
            ni = points[k][0] + di
            nj = points[k][1] + dj
            if (ni, nj) not in dic:
                break
            x = dic[(ni, nj)]
            used[x] = True
        else:
            print("YES")
            exit()
print("NO")
0