Submission #472193


Source Code Expand

def dist(i,j,r,g):
    ret=0
    if j<=r:
        ret=abs(i-900)
    elif r<j and j<=r+g:
        ret=abs(i-1000)
    else:
        ret=abs(i-1100)
    return ret

R,G,B=map(int,raw_input().split())
dp=[[0 for i in xrange(1010)] for j in xrange(2010)]

for i in xrange(2010):
    for j in xrange(1000):
        dp[i][j]=99999999

for i in xrange(2010):
    dp[i][0]=0

for i in xrange(1,2010):
    for j in xrange(1,1000):
        dp[i][j]=min(dp[i-1][j],dp[i-1][j-1]+dist(i,j,R,G))

print(dp[2000][R+G+B])

Submission Info

Submission Time
Task D - マーブル
User chakku000
Language Python (2.7.3)
Score 0
Code Size 532 Byte
Status TLE
Exec Time 2054 ms
Memory 33692 KB

Judge Result

Set Name sub1 sub2 All
Score / Max Score 0 / 10 0 / 30 0 / 60
Status
TLE × 29
TLE × 57
TLE × 82
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 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 TLE 2045 ms 32428 KB
sample_02_BC.txt TLE 2045 ms 32796 KB
sample_03_C.txt TLE 2046 ms 33444 KB
test_ABC_01.txt TLE 2041 ms 32928 KB
test_ABC_02.txt TLE 2045 ms 32804 KB
test_ABC_03.txt TLE 2045 ms 33188 KB
test_ABC_04.txt TLE 2044 ms 32892 KB
test_ABC_05.txt TLE 2044 ms 32796 KB
test_ABC_06.txt TLE 2046 ms 32672 KB
test_ABC_07.txt TLE 2046 ms 33140 KB
test_ABC_08.txt TLE 2046 ms 32968 KB
test_ABC_09.txt TLE 2046 ms 31912 KB
test_ABC_10.txt TLE 2046 ms 32548 KB
test_ABC_11.txt TLE 2044 ms 32936 KB
test_ABC_12.txt TLE 2045 ms 33068 KB
test_ABC_13.txt TLE 2044 ms 32932 KB
test_ABC_14.txt TLE 2045 ms 32800 KB
test_ABC_15.txt TLE 2042 ms 32668 KB
test_ABC_16.txt TLE 2043 ms 33052 KB
test_ABC_17.txt TLE 2046 ms 32560 KB
test_ABC_18.txt TLE 2045 ms 32384 KB
test_ABC_19.txt TLE 2045 ms 33000 KB
test_ABC_20.txt TLE 2046 ms 32804 KB
test_ABC_21.txt TLE 2045 ms 32888 KB
test_ABC_22.txt TLE 2044 ms 32928 KB
test_ABC_23.txt TLE 2047 ms 32948 KB
test_ABC_24.txt TLE 2044 ms 33064 KB
test_ABC_25.txt TLE 2044 ms 32804 KB
test_ABC_26.txt TLE 2044 ms 33184 KB
test_ABC_27.txt TLE 2046 ms 33068 KB
test_ABC_28.txt TLE 2045 ms 32548 KB
test_BC_29.txt TLE 2045 ms 32160 KB
test_BC_30.txt TLE 2045 ms 33060 KB
test_BC_31.txt TLE 2046 ms 32404 KB
test_BC_32.txt TLE 2053 ms 32796 KB
test_BC_33.txt TLE 2045 ms 32932 KB
test_BC_34.txt TLE 2044 ms 33056 KB
test_BC_35.txt TLE 2045 ms 32632 KB
test_BC_36.txt TLE 2044 ms 32668 KB
test_BC_37.txt TLE 2044 ms 32664 KB
test_BC_38.txt TLE 2045 ms 32932 KB
test_BC_39.txt TLE 2045 ms 32800 KB
test_BC_40.txt TLE 2046 ms 32928 KB
test_BC_41.txt TLE 2047 ms 32808 KB
test_BC_42.txt TLE 2046 ms 33064 KB
test_BC_43.txt TLE 2043 ms 32928 KB
test_BC_44.txt TLE 2046 ms 32808 KB
test_BC_45.txt TLE 2045 ms 32940 KB
test_BC_46.txt TLE 2044 ms 33016 KB
test_BC_47.txt TLE 2044 ms 32888 KB
test_BC_48.txt TLE 2049 ms 32540 KB
test_BC_49.txt TLE 2045 ms 33184 KB
test_BC_50.txt TLE 2045 ms 33316 KB
test_BC_51.txt TLE 2046 ms 33160 KB
test_BC_52.txt TLE 2046 ms 33188 KB
test_BC_53.txt TLE 2046 ms 32540 KB
test_BC_54.txt TLE 2044 ms 32544 KB
test_BC_55.txt TLE 2044 ms 33188 KB
test_C_56.txt TLE 2047 ms 33064 KB
test_C_57.txt TLE 2044 ms 33436 KB
test_C_58.txt TLE 2046 ms 33176 KB
test_C_59.txt TLE 2045 ms 32552 KB
test_C_60.txt TLE 2043 ms 33056 KB
test_C_61.txt TLE 2045 ms 33572 KB
test_C_62.txt TLE 2054 ms 33312 KB
test_C_63.txt TLE 2043 ms 33052 KB
test_C_64.txt TLE 2043 ms 32548 KB
test_C_65.txt TLE 2045 ms 32928 KB
test_C_66.txt TLE 2045 ms 33192 KB
test_C_67.txt TLE 2043 ms 33308 KB
test_C_68.txt TLE 2045 ms 32028 KB
test_C_69.txt TLE 2046 ms 33052 KB
test_C_70.txt TLE 2045 ms 32920 KB
test_C_71.txt TLE 2049 ms 32536 KB
test_C_72.txt TLE 2046 ms 33180 KB
test_C_73.txt TLE 2046 ms 33320 KB
test_C_74.txt TLE 2046 ms 32664 KB
test_C_75.txt TLE 2045 ms 32980 KB
test_C_76.txt TLE 2043 ms 32552 KB
test_C_77.txt TLE 2045 ms 33400 KB
test_C_78.txt TLE 2045 ms 33580 KB
test_C_79.txt TLE 2046 ms 32800 KB
test_C_80.txt TLE 2044 ms 32764 KB
test_C_81.txt TLE 2045 ms 32944 KB
test_C_82.txt TLE 2046 ms 33692 KB