Submission #43841361


Source Code Expand

#!/usr/bin/env python3
from typing import *


def solve(N: int, D: int, S: List[str]) -> int:
    free_days = [True for x in range(D)]
    for n_index in range(N):
        not_free_days = [index for index, value in enumerate(S[n_index]) if value == 'x']
        for not_free in not_free_days:
            free_days[not_free] = False

    results = [0]
    counting_num = 0
    is_counting = False
    for free in free_days:
        if is_counting:
            if free:
                counting_num += 1
            else:
                is_counting = False
                results.append(counting_num)
                counting_num = 0
        else:
            if free:
                is_counting = True
                counting_num = 1
            else:
                continue
    results.append(counting_num)
    return max(results)


# generated by oj-template v4.8.1 (https://github.com/online-judge-tools/template-generator)
def main():
    N, D = map(int, input().split())
    S = [None for _ in range(N)]
    for i in range(N):
        S[i] = input()
    a = solve(N, D, S)
    print(a)


if __name__ == '__main__':
    main()

Submission Info

Submission Time
Task B - Vacation Together
User maureen
Language Python (3.8.2)
Score 200
Code Size 1137 Byte
Status AC
Exec Time 36 ms
Memory 9988 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 5
AC × 25
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.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, 02_corner_00.txt, 02_corner_01.txt, 03_handmade_00.txt, 03_handmade_01.txt, 03_handmade_02.txt, 03_handmade_03.txt, 03_handmade_04.txt, 04_d_eq_1_00.txt, 04_d_eq_1_01.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 36 ms 9960 KiB
00_sample_01.txt AC 31 ms 9844 KiB
00_sample_02.txt AC 25 ms 9892 KiB
00_sample_03.txt AC 27 ms 9784 KiB
00_sample_04.txt AC 30 ms 9780 KiB
01_random_00.txt AC 32 ms 9808 KiB
01_random_01.txt AC 30 ms 9976 KiB
01_random_02.txt AC 30 ms 9988 KiB
01_random_03.txt AC 29 ms 9960 KiB
01_random_04.txt AC 25 ms 9908 KiB
01_random_05.txt AC 33 ms 9984 KiB
01_random_06.txt AC 26 ms 9984 KiB
01_random_07.txt AC 31 ms 9956 KiB
01_random_08.txt AC 29 ms 9800 KiB
01_random_09.txt AC 25 ms 9960 KiB
01_random_10.txt AC 30 ms 9864 KiB
02_corner_00.txt AC 28 ms 9928 KiB
02_corner_01.txt AC 25 ms 9860 KiB
03_handmade_00.txt AC 24 ms 9796 KiB
03_handmade_01.txt AC 27 ms 9808 KiB
03_handmade_02.txt AC 30 ms 9804 KiB
03_handmade_03.txt AC 31 ms 9960 KiB
03_handmade_04.txt AC 30 ms 9784 KiB
04_d_eq_1_00.txt AC 28 ms 9780 KiB
04_d_eq_1_01.txt AC 26 ms 9808 KiB