Submission #62062994


Source Code Expand

Copy
h, w = map(int, input().split())
a = []
sx = -1
sy = -1
gx = -1
gy = -1
for i in range(h):
a.append(input())
for j in range(w):
if a[i][j] == "#":
if sx == -1:
sx = i
sy = j
sx = min(sx, i)
sy = min(sy, j)
gx = max(gx, i)
gy = max(gy, j)
# print(sx, sy, gx, gy)
for i in range(sx, gx + 1):
for j in range(sy, gy + 1):
if a[i][j] == ".":
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
h, w = map(int, input().split())
a = []
sx = -1
sy = -1
gx = -1
gy = -1
for i in range(h):
    a.append(input())
    for j in range(w):
        if a[i][j] == "#":
            if sx == -1:
                sx = i
                sy = j
            sx = min(sx, i)
            sy = min(sy, j)
            gx = max(gx, i)
            gy = max(gy, j)
# print(sx, sy, gx, gy)
for i in range(sx, gx + 1):
    for j in range(sy, gy + 1):
        if a[i][j] == ".":
            print("No")
            exit()
print("Yes")

Submission Info

Submission Time
Task C - Paint to make a rectangle
User ikoya
Language Python (PyPy 3.10-v7.3.12)
Score 300
Code Size 537 Byte
Status AC
Exec Time 80 ms
Memory 82336 KB

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 55 ms 76164 KB
example_01.txt AC 55 ms 76640 KB
example_02.txt AC 56 ms 76628 KB
hand_00.txt AC 74 ms 81768 KB
hand_01.txt AC 72 ms 81760 KB
hand_02.txt AC 67 ms 81868 KB
hand_03.txt AC 71 ms 82240 KB
hand_04.txt AC 75 ms 81836 KB
hand_05.txt AC 55 ms 76720 KB
hand_06.txt AC 55 ms 76768 KB
hand_07.txt AC 55 ms 76236 KB
hand_08.txt AC 65 ms 80904 KB
hand_09.txt AC 70 ms 81784 KB
hand_10.txt AC 67 ms 82092 KB
hand_11.txt AC 70 ms 81792 KB
hand_12.txt AC 74 ms 82124 KB
random_00.txt AC 79 ms 81868 KB
random_01.txt AC 80 ms 82268 KB
random_02.txt AC 71 ms 82168 KB
random_03.txt AC 79 ms 82088 KB
random_04.txt AC 80 ms 81856 KB
random_05.txt AC 67 ms 81756 KB
random_06.txt AC 69 ms 81864 KB
random_07.txt AC 69 ms 82336 KB
random_08.txt AC 72 ms 82108 KB
random_09.txt AC 71 ms 82172 KB
random_10.txt AC 73 ms 82104 KB
random_11.txt AC 72 ms 81828 KB
random_12.txt AC 76 ms 81828 KB
random_13.txt AC 74 ms 81908 KB
random_14.txt AC 72 ms 82132 KB
random_15.txt AC 73 ms 82080 KB
random_16.txt AC 73 ms 81844 KB
random_17.txt AC 68 ms 81964 KB
random_18.txt AC 73 ms 82216 KB
random_19.txt AC 75 ms 81784 KB
random_20.txt AC 72 ms 82116 KB
random_21.txt AC 74 ms 82244 KB
random_22.txt AC 73 ms 82016 KB
random_23.txt AC 72 ms 82056 KB
random_24.txt AC 76 ms 82228 KB


2025-03-11 (Tue)
03:34:43 +00:00