Тип 22 №  47592

mail@pastecode.io avatar
unknown
python
8 months ago
251 B
4
Indexable
Never
with open('22.txt') as file:
    processes = {"0": 0}

    for line in file.readlines():
        num, time, related = line.split()
        processes[num] = max([processes[i] for i in related.split(";")]) + int(time)

    print(max(processes.values()))