結果

問題 No.179 塗り分け
ユーザー 百
提出日時 2023-04-15 19:15:43
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
TLE  
実行時間 -
コード長 693 bytes
コンパイル時間 833 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 12,968 KB
最終ジャッジ日時 2023-08-01 12:39:39
合計ジャッジ時間 6,301 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
12,248 KB
testcase_01 AC 16 ms
7,900 KB
testcase_02 AC 16 ms
7,848 KB
testcase_03 AC 16 ms
7,784 KB
testcase_04 AC 15 ms
7,768 KB
testcase_05 AC 16 ms
7,844 KB
testcase_06 AC 16 ms
7,792 KB
testcase_07 AC 16 ms
7,908 KB
testcase_08 AC 16 ms
7,816 KB
testcase_09 AC 17 ms
7,872 KB
testcase_10 AC 18 ms
8,196 KB
testcase_11 AC 18 ms
8,304 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def res():
    H,W=map(int,input().split())
    S=[[None] for _ in range(H)]

    for i in range(H):
        S[i]=list(input())

    b=[]
    for i in range(H):
        for j in range(W):
            if S[i][j]=='#':
                b.append([i,j])

    if (len(b)>1)and(len(b)%2==0):
        o=b[0]
        for i in b:
            l1=i[0]-o[0]
            l2=i[1]-o[1]
            t=[i for i in b]
            while t:
                j=t.pop(0)
                if [j[0]+l1,j[1]+l2]in t:
                    t.remove([j[0]+l1,j[1]+l2])
                else:
                        break
            if len(t)==0:
                return 'YES'
        return 'NO'
    return 'NO'

print(res())
0