結果

問題 No.179 塗り分け
ユーザー dangodango
提出日時 2023-06-16 19:47:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 3,000 ms
コード長 542 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 77,396 KB
最終ジャッジ日時 2023-09-06 17:16:26
合計ジャッジ時間 5,636 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,276 KB
testcase_01 AC 69 ms
71,552 KB
testcase_02 AC 70 ms
71,152 KB
testcase_03 AC 70 ms
71,272 KB
testcase_04 AC 72 ms
71,352 KB
testcase_05 AC 80 ms
76,220 KB
testcase_06 AC 70 ms
71,360 KB
testcase_07 AC 73 ms
75,340 KB
testcase_08 AC 86 ms
77,128 KB
testcase_09 AC 85 ms
77,156 KB
testcase_10 AC 76 ms
75,968 KB
testcase_11 AC 76 ms
76,220 KB
testcase_12 AC 91 ms
77,200 KB
testcase_13 AC 70 ms
71,108 KB
testcase_14 AC 70 ms
71,228 KB
testcase_15 AC 69 ms
71,348 KB
testcase_16 AC 71 ms
71,392 KB
testcase_17 AC 71 ms
71,468 KB
testcase_18 AC 78 ms
76,292 KB
testcase_19 AC 78 ms
75,960 KB
testcase_20 AC 92 ms
77,148 KB
testcase_21 AC 92 ms
77,140 KB
testcase_22 AC 102 ms
77,376 KB
testcase_23 AC 75 ms
75,944 KB
testcase_24 AC 86 ms
77,200 KB
testcase_25 AC 75 ms
75,928 KB
testcase_26 AC 79 ms
76,672 KB
testcase_27 AC 87 ms
76,880 KB
testcase_28 AC 76 ms
76,128 KB
testcase_29 AC 94 ms
77,300 KB
testcase_30 AC 85 ms
77,140 KB
testcase_31 AC 89 ms
77,136 KB
testcase_32 AC 82 ms
76,716 KB
testcase_33 AC 92 ms
77,396 KB
testcase_34 AC 79 ms
76,208 KB
testcase_35 AC 92 ms
77,328 KB
testcase_36 AC 69 ms
71,416 KB
testcase_37 AC 69 ms
71,412 KB
testcase_38 AC 69 ms
71,620 KB
testcase_39 AC 69 ms
71,352 KB
testcase_40 AC 69 ms
71,580 KB
testcase_41 AC 69 ms
71,332 KB
testcase_42 AC 69 ms
71,232 KB
testcase_43 AC 71 ms
71,412 KB
testcase_44 AC 76 ms
75,896 KB
testcase_45 AC 69 ms
71,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int,input().split())
D = []
for i in range(H):
    D += input().split()
D = [c for l in D for c in l]
if '#' not in D:
    print('NO')
    exit(0)
for i in range(1, H * W):
    T = D[:]
    R = -1
    for j in range(len(T)):
        if T[j]=='#':
            if j + i < len(T) and T[j + i] == '#' and (R == (j + i) // W - j // W or R == -1):
                T[j], T[j + i]='.', '.'
                R = (j + i) // W - j // W
            else:
                break
    else:
        print('YES')
        break
else:
    print('NO')
0