Submission #48370643


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:
    K, G, M = map(int, input().split())
    g, m = 0, 0
    for _ in range(K):
        if g == G:
            g = 0
        elif m == 0:
            m = M
        elif m <= G - g:
            g += m
            m = 0
        else:
            m -= G - g
            g = G

    print(g, m)


if __name__ == '__main__':
    main()

Submission Info

Submission Time
Task B - Glass and Mug
User takedarts
Language Python (PyPy 3.10-v7.3.12)
Score 200
Code Size 587 Byte
Status AC
Exec Time 61 ms
Memory 76752 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 32
Set Name Test Cases
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.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
Case Name Status Exec Time Memory
example_00.txt AC 60 ms 76288 KiB
example_01.txt AC 60 ms 76572 KiB
hand_00.txt AC 60 ms 76292 KiB
hand_01.txt AC 61 ms 76444 KiB
hand_02.txt AC 60 ms 76284 KiB
hand_03.txt AC 60 ms 76252 KiB
hand_04.txt AC 60 ms 76664 KiB
hand_05.txt AC 60 ms 76360 KiB
random_00.txt AC 59 ms 76312 KiB
random_01.txt AC 60 ms 76468 KiB
random_02.txt AC 58 ms 76420 KiB
random_03.txt AC 59 ms 76480 KiB
random_04.txt AC 59 ms 76544 KiB
random_05.txt AC 59 ms 76576 KiB
random_06.txt AC 59 ms 76296 KiB
random_07.txt AC 60 ms 76624 KiB
random_08.txt AC 60 ms 76660 KiB
random_09.txt AC 60 ms 76632 KiB
random_10.txt AC 60 ms 76544 KiB
random_11.txt AC 60 ms 76280 KiB
random_12.txt AC 60 ms 76148 KiB
random_13.txt AC 60 ms 76284 KiB
random_14.txt AC 60 ms 76308 KiB
random_15.txt AC 59 ms 76428 KiB
random_16.txt AC 60 ms 76272 KiB
random_17.txt AC 59 ms 76604 KiB
random_18.txt AC 60 ms 76596 KiB
random_19.txt AC 59 ms 76676 KiB
random_20.txt AC 59 ms 76260 KiB
random_21.txt AC 60 ms 76496 KiB
random_22.txt AC 60 ms 76292 KiB
random_23.txt AC 60 ms 76752 KiB