Submission #62064573


Source Code Expand

H, W = map(int, input().split())

S = []
T = []
for i in range(H):
  s = input()
  S.append(s)
  for j in range(W):
    if s[j] == "#":
      T.append([i,j])
left, right = 0, 0
up, down = 0, 0

T = sorted(T, key = lambda x:x[0])
up = T[0][0]
down = T[-1][0]
T = sorted(T, key = lambda x:x[1])
left = T[0][1]
right = T[-1][1]

#print(up, down, left, right)

for i in range(up, down+1):
  for j in range(left, right+1):
    if S[i][j] == ".":
      print("No")
      exit()

print("Yes")

Submission Info

Submission Time
Task C - Paint to make a rectangle
User G212
Language Python (PyPy 3.10-v7.3.12)
Score 300
Code Size 513 Byte
Status AC
Exec Time 490 ms
Memory 258172 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 41
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt
Case Name Status Exec Time Memory
example_00.txt AC 54 ms 76468 KiB
example_01.txt AC 54 ms 76484 KiB
example_02.txt AC 54 ms 76320 KiB
hand_00.txt AC 487 ms 258156 KiB
hand_01.txt AC 66 ms 81772 KiB
hand_02.txt AC 68 ms 82220 KiB
hand_03.txt AC 70 ms 82096 KiB
hand_04.txt AC 67 ms 82180 KiB
hand_05.txt AC 55 ms 76216 KiB
hand_06.txt AC 54 ms 76472 KiB
hand_07.txt AC 55 ms 76700 KiB
hand_08.txt AC 63 ms 80936 KiB
hand_09.txt AC 69 ms 81880 KiB
hand_10.txt AC 65 ms 81932 KiB
hand_11.txt AC 488 ms 257776 KiB
hand_12.txt AC 490 ms 258172 KiB
random_00.txt AC 134 ms 103948 KiB
random_01.txt AC 237 ms 145636 KiB
random_02.txt AC 65 ms 82048 KiB
random_03.txt AC 222 ms 141424 KiB
random_04.txt AC 273 ms 151416 KiB
random_05.txt AC 66 ms 82172 KiB
random_06.txt AC 66 ms 82080 KiB
random_07.txt AC 68 ms 82128 KiB
random_08.txt AC 65 ms 82044 KiB
random_09.txt AC 65 ms 82004 KiB
random_10.txt AC 355 ms 191764 KiB
random_11.txt AC 66 ms 81768 KiB
random_12.txt AC 109 ms 101624 KiB
random_13.txt AC 457 ms 236140 KiB
random_14.txt AC 65 ms 81796 KiB
random_15.txt AC 81 ms 84180 KiB
random_16.txt AC 107 ms 96172 KiB
random_17.txt AC 65 ms 82064 KiB
random_18.txt AC 67 ms 81888 KiB
random_19.txt AC 112 ms 96168 KiB
random_20.txt AC 66 ms 82056 KiB
random_21.txt AC 74 ms 83180 KiB
random_22.txt AC 368 ms 191904 KiB
random_23.txt AC 66 ms 82080 KiB
random_24.txt AC 77 ms 84248 KiB