Submission #3248018


Source Code Expand

import numpy as np
H, W = map(int, input().split())
grid = np.array([], dtype=np.int)
for i in range(H):
    grid = np.append(grid, np.array([c=="." for c in input()]))

grid = grid.reshape(H,W)
row_test = np.where(np.sum(grid, axis=1)==W)
col_test = np.where(np.sum(grid, axis=0)==H)

grid = np.delete(grid, row_test[0], axis=0)
grid = np.delete(grid, col_test[0], axis=1)

for r in grid:
    res = ''
    for v in r:
        if v == 1:
            res += '.'
        else:
            res += '#'
    print(res)

Submission Info

Submission Time
Task B - Grid Compression
User ikuya_sam
Language Python (3.4.3)
Score 200
Code Size 532 Byte
Status AC
Exec Time 277 ms
Memory 18984 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 12
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt
Case Name Status Exec Time Memory
0_00.txt AC 277 ms 18984 KB
0_01.txt AC 148 ms 12384 KB
0_02.txt AC 147 ms 12388 KB
0_03.txt AC 148 ms 12384 KB
1_00.txt AC 148 ms 12428 KB
1_01.txt AC 154 ms 12628 KB
1_02.txt AC 158 ms 12628 KB
1_03.txt AC 159 ms 12664 KB
1_04.txt AC 151 ms 12664 KB
1_05.txt AC 152 ms 12624 KB
1_06.txt AC 151 ms 12624 KB
1_07.txt AC 152 ms 12624 KB