結果

問題 No.179 塗り分け
ユーザー FromBooskaFromBooska
提出日時 2024-02-23 18:47:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 910 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 90,280 KB
最終ジャッジ日時 2024-02-23 18:47:34
合計ジャッジ時間 24,318 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 38 ms
53,460 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 49 ms
62,256 KB
testcase_05 AC 147 ms
75,696 KB
testcase_06 AC 122 ms
75,744 KB
testcase_07 WA -
testcase_08 AC 47 ms
64,340 KB
testcase_09 AC 47 ms
64,340 KB
testcase_10 AC 2,183 ms
90,280 KB
testcase_11 AC 1,888 ms
86,824 KB
testcase_12 AC 1,836 ms
86,568 KB
testcase_13 AC 36 ms
53,460 KB
testcase_14 AC 36 ms
53,460 KB
testcase_15 AC 35 ms
53,460 KB
testcase_16 AC 35 ms
53,460 KB
testcase_17 AC 35 ms
53,460 KB
testcase_18 AC 1,022 ms
79,792 KB
testcase_19 AC 972 ms
79,532 KB
testcase_20 AC 954 ms
79,280 KB
testcase_21 AC 224 ms
75,804 KB
testcase_22 AC 231 ms
75,944 KB
testcase_23 AC 633 ms
77,288 KB
testcase_24 AC 193 ms
75,816 KB
testcase_25 AC 208 ms
75,892 KB
testcase_26 AC 423 ms
76,500 KB
testcase_27 AC 710 ms
77,156 KB
testcase_28 AC 928 ms
78,884 KB
testcase_29 AC 970 ms
79,396 KB
testcase_30 AC 1,119 ms
80,560 KB
testcase_31 AC 1,220 ms
81,436 KB
testcase_32 AC 1,219 ms
81,828 KB
testcase_33 AC 1,209 ms
81,456 KB
testcase_34 AC 1,449 ms
82,972 KB
testcase_35 AC 1,452 ms
82,844 KB
testcase_36 AC 36 ms
53,460 KB
testcase_37 AC 35 ms
53,460 KB
testcase_38 AC 35 ms
53,460 KB
testcase_39 AC 35 ms
53,460 KB
testcase_40 AC 35 ms
53,460 KB
testcase_41 AC 35 ms
53,460 KB
testcase_42 AC 36 ms
53,460 KB
testcase_43 AC 82 ms
75,568 KB
testcase_44 AC 172 ms
75,676 KB
testcase_45 AC 57 ms
68,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# WA出た、たとえばS['.#', '#.']のときに変化幅はマイナスになるな

H, W = map(int, input().split())
S = []
dots = []
for i in range(H):
    temp = list(input())
    S.append(temp)
    for j in range(W):
        if temp[j] == '#':
            dots.append((i, j))

#print(S)
#print(dots)

dots_set = set(dots)
ans = 'NO'

for di in range(0, H):
    for dj in range(-W+1, W):
        if di==0 and dj==0:
            continue
        covered = set()
        test = True
        for i, j in dots:
            if (i, j) in covered:
                continue
            #print('i', i, 'j', j, (i+di, j+dj) in dots_set, test)
            if (i+di, j+dj) in dots_set:
                covered.add((i+di, j+dj))
            else:
                test = False
            covered.add((i, j))
        #print('di', di, 'dj', dj, covered, test)
        if test == True:
            ans = 'YES'
print(ans)
0