Submission #4850115


Source Code Expand

Copy
import copy
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
A = [a, b, c, d, e]

def dfs(ordered, remain, tim):
    if len(remain) == 0:
        #print("o", ordered, tim)
        return tim

    tims = []
    for r in remain:
        o = copy.copy(ordered)
        o.append(r)
        r2 = copy.copy(remain)
        r2.remove(r)
        t3 = (10 - tim % 10)
        t4 = 0 if t3 == 10 else t3
        tim2 = tim + t4  + r
        #print("tim", tim, t4, r)
        tims.append(dfs(o, r2, tim2))
    return min(tims)

print(dfs([], A, 0))

Submission Info

Submission Time
Task B - Five Dishes
User showyou41
Language Python3 (3.4.3)
Score 200
Code Size 599 Byte
Status
Exec Time 23 ms
Memory 3444 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 s1.txt, s2.txt, s3.txt
All 200 / 200 in1.txt, in2.txt, in3.txt, in4.txt, in5.txt, in6.txt, in7.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
in1.txt 22 ms 3444 KB
in2.txt 22 ms 3444 KB
in3.txt 22 ms 3444 KB
in4.txt 22 ms 3444 KB
in5.txt 23 ms 3444 KB
in6.txt 22 ms 3444 KB
in7.txt 23 ms 3444 KB
s1.txt 22 ms 3444 KB
s2.txt 22 ms 3444 KB
s3.txt 23 ms 3444 KB