結果

問題 No.179 塗り分け
ユーザー mkawa2mkawa2
提出日時 2019-12-30 16:39:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,466 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 44,780 KB
最終ジャッジ日時 2024-04-26 05:54:02
合計ジャッジ時間 60,431 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 491 ms
44,512 KB
testcase_01 AC 495 ms
44,384 KB
testcase_02 AC 497 ms
44,636 KB
testcase_03 AC 502 ms
44,644 KB
testcase_04 AC 502 ms
44,780 KB
testcase_05 AC 712 ms
44,768 KB
testcase_06 AC 496 ms
44,528 KB
testcase_07 WA -
testcase_08 AC 2,563 ms
44,640 KB
testcase_09 WA -
testcase_10 AC 491 ms
44,392 KB
testcase_11 AC 502 ms
44,508 KB
testcase_12 AC 2,303 ms
44,636 KB
testcase_13 AC 502 ms
44,644 KB
testcase_14 AC 508 ms
44,768 KB
testcase_15 AC 496 ms
44,532 KB
testcase_16 AC 506 ms
44,396 KB
testcase_17 AC 524 ms
44,512 KB
testcase_18 AC 548 ms
44,768 KB
testcase_19 AC 545 ms
44,636 KB
testcase_20 AC 2,476 ms
44,768 KB
testcase_21 AC 2,582 ms
44,524 KB
testcase_22 AC 2,618 ms
44,388 KB
testcase_23 AC 494 ms
44,512 KB
testcase_24 AC 2,558 ms
44,768 KB
testcase_25 AC 523 ms
44,400 KB
testcase_26 WA -
testcase_27 AC 2,574 ms
44,516 KB
testcase_28 WA -
testcase_29 AC 2,601 ms
44,384 KB
testcase_30 WA -
testcase_31 AC 2,582 ms
44,516 KB
testcase_32 AC 1,059 ms
44,768 KB
testcase_33 AC 2,611 ms
44,656 KB
testcase_34 WA -
testcase_35 AC 2,592 ms
44,388 KB
testcase_36 AC 499 ms
44,512 KB
testcase_37 AC 494 ms
44,388 KB
testcase_38 AC 508 ms
44,524 KB
testcase_39 AC 499 ms
44,772 KB
testcase_40 AC 496 ms
44,384 KB
testcase_41 AC 497 ms
44,512 KB
testcase_42 AC 501 ms
44,768 KB
testcase_43 AC 530 ms
44,512 KB
testcase_44 AC 725 ms
44,648 KB
testcase_45 AC 501 ms
44,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import *
from bisect import *
#from math import *
from collections import *
from heapq import *
from random import *
from decimal import *
import numpy as np
import sys
import copy

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def MF(): return map(float, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LF(): return list(map(float, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    def check(di,dj):
        t0=copy.deepcopy(t)
        for i in range(h):
            for j in range(w):
                if not t0[i][j]:continue
                if 0<=i+di<h and 0<=j+dj<w:
                    if not t0[i+di][j+dj]:
                        return False
                    t0[i+di][j+dj]=False
                else:
                    return False
        return True

    h,w=MI()
    t=[[c=="#" for c in input()] for _ in range(h)]
    for di in range(h):
        for dj in range(w):
            if (di,dj)==(0,0):continue
            if check(di,dj):
                print("YES")
                exit()
    print("NO")

main()
0