Created
August 24, 2022 22:34
-
-
Save Zerumi/160bd0dbdd2ec88d794068f3498f0860 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N = 12 | |
time = [4,3,1,7,6,3,1,2,7,8,6,6] | |
deps = [[0],[0],[1,2],[3],[3],[5],[4,6],[7],[0],[0],[9],[10]] | |
for i in range(N): | |
totaltime = time[i] | |
if (deps[i][0] == 0): continue | |
maxdeptime = max(time[x - 1] for x in deps[i]) | |
totaltime += maxdeptime | |
time[i] = totaltime | |
print(max(time)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Решение нового задания #22 ЕГЭ по информатике 2023