結果

問題 No.179 塗り分け
ユーザー Mr.FukuMr.Fuku
提出日時 2018-06-26 21:04:27
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 2,215 ms / 3,000 ms
コード長 637 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 10,948 KB
実行使用メモリ 8,360 KB
最終ジャッジ日時 2023-09-30 21:01:42
合計ジャッジ時間 5,679 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,780 KB
testcase_01 AC 16 ms
7,772 KB
testcase_02 AC 16 ms
7,852 KB
testcase_03 AC 16 ms
7,772 KB
testcase_04 AC 17 ms
7,780 KB
testcase_05 AC 17 ms
7,776 KB
testcase_06 AC 17 ms
7,920 KB
testcase_07 AC 16 ms
7,728 KB
testcase_08 AC 17 ms
7,800 KB
testcase_09 AC 17 ms
7,728 KB
testcase_10 AC 60 ms
8,336 KB
testcase_11 AC 53 ms
8,260 KB
testcase_12 AC 2,215 ms
8,208 KB
testcase_13 AC 16 ms
7,748 KB
testcase_14 AC 16 ms
7,884 KB
testcase_15 AC 16 ms
7,896 KB
testcase_16 AC 16 ms
7,744 KB
testcase_17 AC 16 ms
7,920 KB
testcase_18 AC 29 ms
8,304 KB
testcase_19 AC 29 ms
8,176 KB
testcase_20 AC 18 ms
8,204 KB
testcase_21 AC 17 ms
7,688 KB
testcase_22 AC 23 ms
7,912 KB
testcase_23 AC 20 ms
7,768 KB
testcase_24 AC 18 ms
7,816 KB
testcase_25 AC 16 ms
7,780 KB
testcase_26 AC 18 ms
7,808 KB
testcase_27 AC 36 ms
7,812 KB
testcase_28 AC 26 ms
8,360 KB
testcase_29 AC 66 ms
8,172 KB
testcase_30 AC 73 ms
8,192 KB
testcase_31 AC 90 ms
8,160 KB
testcase_32 AC 65 ms
8,200 KB
testcase_33 AC 149 ms
8,284 KB
testcase_34 AC 58 ms
8,336 KB
testcase_35 AC 200 ms
8,252 KB
testcase_36 AC 17 ms
7,892 KB
testcase_37 AC 17 ms
7,896 KB
testcase_38 AC 16 ms
7,788 KB
testcase_39 AC 16 ms
7,852 KB
testcase_40 AC 16 ms
7,840 KB
testcase_41 AC 16 ms
7,728 KB
testcase_42 AC 16 ms
7,908 KB
testcase_43 AC 17 ms
7,896 KB
testcase_44 AC 21 ms
7,764 KB
testcase_45 AC 17 ms
7,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w = input().split()
h,w = int(h),int(w)
lst=[]

def f(plus_index):
    
    dummy = lst[:]
    h_index = lst[plus_index][0]-lst[0][0]
    w_index = lst[plus_index][1]-lst[0][1]
    
    for i in dummy:
        n = [i[0]+h_index,i[1]+w_index]
        if n in dummy:
            dummy.remove(n)
        else:
            return False
    else:
        print("YES")
        return True

for i in range(h):
    for j,x in enumerate(list(input())):
        if x=="#":
            lst.append([i,j])

if len(lst)%2==1:
    print("NO")
else:
    for i in range(1,len(lst)//2+1):
        if f(i):
            break
    else:
        print("NO")
0