結果

問題 No.179 塗り分け
ユーザー 👑 rin204rin204
提出日時 2022-01-20 09:05:28
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 807 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 82,216 KB
実行使用メモリ 145,536 KB
最終ジャッジ日時 2024-11-23 14:23:54
合計ジャッジ時間 25,195 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
59,288 KB
testcase_01 AC 36 ms
137,656 KB
testcase_02 AC 35 ms
59,088 KB
testcase_03 AC 36 ms
134,456 KB
testcase_04 AC 36 ms
58,444 KB
testcase_05 AC 39 ms
136,552 KB
testcase_06 AC 38 ms
58,196 KB
testcase_07 AC 40 ms
139,948 KB
testcase_08 AC 41 ms
63,628 KB
testcase_09 AC 40 ms
59,580 KB
testcase_10 AC 44 ms
61,296 KB
testcase_11 AC 44 ms
61,220 KB
testcase_12 TLE -
testcase_13 AC 37 ms
52,352 KB
testcase_14 AC 36 ms
52,352 KB
testcase_15 AC 35 ms
52,096 KB
testcase_16 AC 36 ms
52,096 KB
testcase_17 AC 37 ms
51,968 KB
testcase_18 AC 45 ms
61,312 KB
testcase_19 AC 49 ms
61,440 KB
testcase_20 AC 42 ms
59,136 KB
testcase_21 AC 40 ms
57,984 KB
testcase_22 AC 99 ms
76,160 KB
testcase_23 AC 44 ms
59,648 KB
testcase_24 AC 70 ms
76,044 KB
testcase_25 AC 41 ms
58,496 KB
testcase_26 AC 41 ms
59,500 KB
testcase_27 AC 1,184 ms
77,056 KB
testcase_28 AC 45 ms
60,800 KB
testcase_29 TLE -
testcase_30 AC 54 ms
68,352 KB
testcase_31 TLE -
testcase_32 AC 52 ms
65,664 KB
testcase_33 TLE -
testcase_34 AC 49 ms
64,384 KB
testcase_35 TLE -
testcase_36 AC 39 ms
52,096 KB
testcase_37 AC 40 ms
51,712 KB
testcase_38 AC 37 ms
52,096 KB
testcase_39 AC 36 ms
52,224 KB
testcase_40 AC 37 ms
52,224 KB
testcase_41 AC 36 ms
51,712 KB
testcase_42 AC 36 ms
52,096 KB
testcase_43 AC 72 ms
75,984 KB
testcase_44 AC 231 ms
75,904 KB
testcase_45 AC 48 ms
145,536 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 * 100 + 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 * 100 + nj not in dic:
                break
            x = dic[ni * 100 + nj]
            used[x] = True
        else:
            print("YES")
            exit()
print("NO")
0