Submission #48374970


Source Code Expand

import os
import sys

sys.setrecursionlimit(210000)


if os.getenv('TEST'):
    def eprint(*args, **kwargs):
        print('[\033[31mEPRINT\033[0m]', *args, file=sys.stderr, **kwargs)
else:
    def eprint(*args, **kwargs):
        pass


def main() -> None:
    _, M = map(int, input().split())
    S = list(map(int, input()))
    muji = M
    logo = 0
    min_logo = 0
    for s in S:
        if s == 0:
            logo = 0
            muji = M
        elif s == 1:
            if muji > 0:
                muji -= 1
            else:
                logo -= 1
        else:
            logo -= 1

        min_logo = min(min_logo, logo)

    print(max(-min_logo, 0))


if __name__ == '__main__':
    main()

Submission Info

Submission Time
Task C - T-shirts
User takedarts
Language Python (PyPy 3.10-v7.3.12)
Score 300
Code Size 709 Byte
Status AC
Exec Time 57 ms
Memory 76836 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 43
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, 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, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt
Case Name Status Exec Time Memory
example_00.txt AC 55 ms 76668 KiB
example_01.txt AC 55 ms 76296 KiB
example_02.txt AC 55 ms 76516 KiB
hand_00.txt AC 55 ms 76392 KiB
hand_01.txt AC 57 ms 76488 KiB
hand_02.txt AC 56 ms 76676 KiB
hand_03.txt AC 56 ms 76584 KiB
hand_04.txt AC 56 ms 76380 KiB
hand_05.txt AC 56 ms 76464 KiB
hand_06.txt AC 56 ms 76836 KiB
hand_07.txt AC 55 ms 76684 KiB
hand_08.txt AC 57 ms 76608 KiB
hand_09.txt AC 56 ms 76664 KiB
random_00.txt AC 56 ms 76516 KiB
random_01.txt AC 56 ms 76396 KiB
random_02.txt AC 56 ms 76380 KiB
random_03.txt AC 56 ms 76464 KiB
random_04.txt AC 56 ms 76608 KiB
random_05.txt AC 56 ms 76804 KiB
random_06.txt AC 55 ms 76460 KiB
random_07.txt AC 56 ms 76788 KiB
random_08.txt AC 55 ms 76396 KiB
random_09.txt AC 56 ms 76596 KiB
random_10.txt AC 55 ms 76492 KiB
random_11.txt AC 55 ms 76368 KiB
random_12.txt AC 56 ms 76468 KiB
random_13.txt AC 56 ms 76324 KiB
random_14.txt AC 55 ms 76668 KiB
random_15.txt AC 56 ms 76428 KiB
random_16.txt AC 56 ms 76532 KiB
random_17.txt AC 56 ms 76304 KiB
random_18.txt AC 56 ms 76460 KiB
random_19.txt AC 56 ms 76388 KiB
random_20.txt AC 55 ms 76400 KiB
random_21.txt AC 55 ms 76472 KiB
random_22.txt AC 55 ms 76396 KiB
random_23.txt AC 56 ms 76716 KiB
random_24.txt AC 56 ms 76248 KiB
random_25.txt AC 56 ms 76604 KiB
random_26.txt AC 55 ms 76460 KiB
random_27.txt AC 56 ms 76768 KiB
random_28.txt AC 56 ms 76600 KiB
random_29.txt AC 56 ms 76460 KiB