Submission #19661385


Source Code Expand

Copy
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def LS2(): return list(sys.stdin.readline().rstrip())


R,G,B = MI()

ans = 10**18
for i in range(-400,301):
    a = 0
    for j in range(i,i+G):
        a += abs(j)

    s = -100+(R-1)//2-R+1
    t = -100+(R-1)//2
    if t >= i:
        s = i-R
        t = i-1
    for j in range(s,t+1):
        a += abs(j+100)

    s = 100-(B-1)//2
    t = 100-(B-1)//2+B-1
    if s <= i+G-1:
        s = i+G
        t = i+G+B-1
    for j in range(s,t+1):
        a += abs(j-100)

    ans = min(ans,a)

print(ans)

Submission Info

Submission Time
Task D - マーブル
User ayaoni
Language PyPy3 (7.3.0)
Score 0
Code Size 935 Byte
Status MLE
Exec Time 113 ms
Memory 67956 KB

Judge Result

Set Name sub1 sub2 All
Score / Max Score 0 / 10 0 / 30 0 / 60
Status
AC × 1
MLE × 28
AC × 1
MLE × 56
AC × 1
MLE × 84
Set Name Test Cases
sub1 sample_01_ABC.txt, test_ABC_01.txt, test_ABC_02.txt, test_ABC_03.txt, test_ABC_04.txt, test_ABC_05.txt, test_ABC_06.txt, test_ABC_07.txt, test_ABC_08.txt, test_ABC_09.txt, test_ABC_10.txt, test_ABC_11.txt, test_ABC_12.txt, test_ABC_13.txt, test_ABC_14.txt, test_ABC_15.txt, test_ABC_16.txt, test_ABC_17.txt, test_ABC_18.txt, test_ABC_19.txt, test_ABC_20.txt, test_ABC_21.txt, test_ABC_22.txt, test_ABC_23.txt, test_ABC_24.txt, test_ABC_25.txt, test_ABC_26.txt, test_ABC_27.txt, test_ABC_28.txt
sub2 sample_01_ABC.txt, sample_02_BC.txt, test_ABC_01.txt, test_ABC_02.txt, test_ABC_03.txt, test_ABC_04.txt, test_ABC_05.txt, test_ABC_06.txt, test_ABC_07.txt, test_ABC_08.txt, test_ABC_09.txt, test_ABC_10.txt, test_ABC_11.txt, test_ABC_12.txt, test_ABC_13.txt, test_ABC_14.txt, test_ABC_15.txt, test_ABC_16.txt, test_ABC_17.txt, test_ABC_18.txt, test_ABC_19.txt, test_ABC_20.txt, test_ABC_21.txt, test_ABC_22.txt, test_ABC_23.txt, test_ABC_24.txt, test_ABC_25.txt, test_ABC_26.txt, test_ABC_27.txt, test_ABC_28.txt, test_BC_29.txt, test_BC_30.txt, test_BC_31.txt, test_BC_32.txt, test_BC_33.txt, test_BC_34.txt, test_BC_35.txt, test_BC_36.txt, test_BC_37.txt, test_BC_38.txt, test_BC_39.txt, test_BC_40.txt, test_BC_41.txt, test_BC_42.txt, test_BC_43.txt, test_BC_44.txt, test_BC_45.txt, test_BC_46.txt, test_BC_47.txt, test_BC_48.txt, test_BC_49.txt, test_BC_50.txt, test_BC_51.txt, test_BC_52.txt, test_BC_53.txt, test_BC_54.txt, test_BC_55.txt
All sample_01_ABC.txt, sample_02_BC.txt, sample_03_C.txt, test_ABC_01.txt, test_ABC_02.txt, test_ABC_03.txt, test_ABC_04.txt, test_ABC_05.txt, test_ABC_06.txt, test_ABC_07.txt, test_ABC_08.txt, test_ABC_09.txt, test_ABC_10.txt, test_ABC_11.txt, test_ABC_12.txt, test_ABC_13.txt, test_ABC_14.txt, test_ABC_15.txt, test_ABC_16.txt, test_ABC_17.txt, test_ABC_18.txt, test_ABC_19.txt, test_ABC_20.txt, test_ABC_21.txt, test_ABC_22.txt, test_ABC_23.txt, test_ABC_24.txt, test_ABC_25.txt, test_ABC_26.txt, test_ABC_27.txt, test_ABC_28.txt, test_BC_29.txt, test_BC_30.txt, test_BC_31.txt, test_BC_32.txt, test_BC_33.txt, test_BC_34.txt, test_BC_35.txt, test_BC_36.txt, test_BC_37.txt, test_BC_38.txt, test_BC_39.txt, test_BC_40.txt, test_BC_41.txt, test_BC_42.txt, test_BC_43.txt, test_BC_44.txt, test_BC_45.txt, test_BC_46.txt, test_BC_47.txt, test_BC_48.txt, test_BC_49.txt, test_BC_50.txt, test_BC_51.txt, test_BC_52.txt, test_BC_53.txt, test_BC_54.txt, test_BC_55.txt, test_C_56.txt, test_C_57.txt, test_C_58.txt, test_C_59.txt, test_C_60.txt, test_C_61.txt, test_C_62.txt, test_C_63.txt, test_C_64.txt, test_C_65.txt, test_C_66.txt, test_C_67.txt, test_C_68.txt, test_C_69.txt, test_C_70.txt, test_C_71.txt, test_C_72.txt, test_C_73.txt, test_C_74.txt, test_C_75.txt, test_C_76.txt, test_C_77.txt, test_C_78.txt, test_C_79.txt, test_C_80.txt, test_C_81.txt, test_C_82.txt
Case Name Status Exec Time Memory
sample_01_ABC.txt MLE 113 ms 67508 KB
sample_02_BC.txt MLE 74 ms 67764 KB
sample_03_C.txt MLE 76 ms 67768 KB
test_ABC_01.txt MLE 72 ms 67468 KB
test_ABC_02.txt MLE 73 ms 67256 KB
test_ABC_03.txt MLE 74 ms 67548 KB
test_ABC_04.txt MLE 68 ms 67476 KB
test_ABC_05.txt MLE 77 ms 67928 KB
test_ABC_06.txt MLE 73 ms 67560 KB
test_ABC_07.txt MLE 74 ms 67404 KB
test_ABC_08.txt MLE 72 ms 67704 KB
test_ABC_09.txt MLE 71 ms 67372 KB
test_ABC_10.txt MLE 70 ms 67680 KB
test_ABC_11.txt MLE 72 ms 67684 KB
test_ABC_12.txt MLE 73 ms 67480 KB
test_ABC_13.txt MLE 72 ms 67368 KB
test_ABC_14.txt MLE 72 ms 67488 KB
test_ABC_15.txt MLE 71 ms 67528 KB
test_ABC_16.txt MLE 71 ms 67372 KB
test_ABC_17.txt MLE 71 ms 67612 KB
test_ABC_18.txt MLE 73 ms 67736 KB
test_ABC_19.txt MLE 73 ms 67348 KB
test_ABC_20.txt MLE 75 ms 67832 KB
test_ABC_21.txt AC 63 ms 63448 KB
test_ABC_22.txt MLE 67 ms 67656 KB
test_ABC_23.txt MLE 72 ms 67424 KB
test_ABC_24.txt MLE 75 ms 67456 KB
test_ABC_25.txt MLE 71 ms 67696 KB
test_ABC_26.txt MLE 74 ms 67472 KB
test_ABC_27.txt MLE 70 ms 67560 KB
test_ABC_28.txt MLE 74 ms 67380 KB
test_BC_29.txt MLE 78 ms 67904 KB
test_BC_30.txt MLE 76 ms 67760 KB
test_BC_31.txt MLE 80 ms 67732 KB
test_BC_32.txt MLE 77 ms 67912 KB
test_BC_33.txt MLE 77 ms 67512 KB
test_BC_34.txt MLE 75 ms 67544 KB
test_BC_35.txt MLE 78 ms 67640 KB
test_BC_36.txt MLE 79 ms 67800 KB
test_BC_37.txt MLE 76 ms 67820 KB
test_BC_38.txt MLE 76 ms 67864 KB
test_BC_39.txt MLE 74 ms 67776 KB
test_BC_40.txt MLE 80 ms 67760 KB
test_BC_41.txt MLE 78 ms 67796 KB
test_BC_42.txt MLE 76 ms 67668 KB
test_BC_43.txt MLE 74 ms 67720 KB
test_BC_44.txt MLE 76 ms 67772 KB
test_BC_45.txt MLE 76 ms 67584 KB
test_BC_46.txt MLE 73 ms 67700 KB
test_BC_47.txt MLE 77 ms 67812 KB
test_BC_48.txt MLE 77 ms 67672 KB
test_BC_49.txt MLE 75 ms 67560 KB
test_BC_50.txt MLE 72 ms 67656 KB
test_BC_51.txt MLE 76 ms 67956 KB
test_BC_52.txt MLE 71 ms 67808 KB
test_BC_53.txt MLE 68 ms 67756 KB
test_BC_54.txt MLE 71 ms 67664 KB
test_BC_55.txt MLE 76 ms 67904 KB
test_C_56.txt MLE 76 ms 67804 KB
test_C_57.txt MLE 76 ms 67688 KB
test_C_58.txt MLE 81 ms 67788 KB
test_C_59.txt MLE 77 ms 67692 KB
test_C_60.txt MLE 80 ms 67892 KB
test_C_61.txt MLE 77 ms 67792 KB
test_C_62.txt MLE 75 ms 67868 KB
test_C_63.txt MLE 76 ms 67468 KB
test_C_64.txt MLE 77 ms 67804 KB
test_C_65.txt MLE 79 ms 67696 KB
test_C_66.txt MLE 75 ms 67616 KB
test_C_67.txt MLE 80 ms 67760 KB
test_C_68.txt MLE 76 ms 67656 KB
test_C_69.txt MLE 76 ms 67756 KB
test_C_70.txt MLE 76 ms 67540 KB
test_C_71.txt MLE 76 ms 67788 KB
test_C_72.txt MLE 77 ms 67572 KB
test_C_73.txt MLE 72 ms 67688 KB
test_C_74.txt MLE 75 ms 67736 KB
test_C_75.txt MLE 76 ms 67792 KB
test_C_76.txt MLE 74 ms 67388 KB
test_C_77.txt MLE 76 ms 67560 KB
test_C_78.txt MLE 74 ms 67592 KB
test_C_79.txt MLE 74 ms 67820 KB
test_C_80.txt MLE 72 ms 67796 KB
test_C_81.txt MLE 70 ms 67492 KB
test_C_82.txt MLE 83 ms 67612 KB