Submission #41053061


Source Code Expand

import sys
h,w = map(int,input().split())
a = [list(input()) for _ in range(h)]
ans = [0 for _ in range(min(h,w))]
for i in range(h):
    for j in range(w):
        if a[i][j] == "#":
            s = i
            p = j
            k = 0
            while s < h-1 and p < w-1:
                s += 1
                p += 1
                if a[s][p] == "#":
                    k += 1
                else:
                    break
            k //= 2
            ans[k-1] += 1
            for z in range(k+1):
                a[i+k+z][j+k+z] ="."
                a[i+k+z][j+k-z] ="."
                a[i+k-z][j+k+z] ="."
                a[i+k-z][j+k-z] ="."
print(*ans)
                    

Submission Info

Submission Time
Task C - Cross
User nnsmer
Language PyPy3 (7.3.0)
Score 300
Code Size 719 Byte
Status AC
Exec Time 65 ms
Memory 70316 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 21
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 02_corner_00.txt, 02_corner_01.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 65 ms 62116 KiB
00_sample_01.txt AC 48 ms 61828 KiB
00_sample_02.txt AC 44 ms 62068 KiB
00_sample_03.txt AC 51 ms 61976 KiB
01_random_00.txt AC 52 ms 64660 KiB
01_random_01.txt AC 56 ms 66600 KiB
01_random_02.txt AC 51 ms 65300 KiB
01_random_03.txt AC 53 ms 64704 KiB
01_random_04.txt AC 50 ms 64504 KiB
01_random_05.txt AC 53 ms 64312 KiB
01_random_06.txt AC 51 ms 64744 KiB
01_random_07.txt AC 56 ms 65580 KiB
01_random_08.txt AC 56 ms 65408 KiB
01_random_09.txt AC 58 ms 67388 KiB
01_random_10.txt AC 56 ms 65440 KiB
01_random_11.txt AC 53 ms 65480 KiB
01_random_12.txt AC 54 ms 65604 KiB
01_random_13.txt AC 59 ms 66980 KiB
01_random_14.txt AC 57 ms 65752 KiB
02_corner_00.txt AC 65 ms 70316 KiB
02_corner_01.txt AC 53 ms 64668 KiB