Все задачи на 5.10.17 13:00

This commit is contained in:
2017-10-05 13:08:02 +03:00
parent 93746b05d7
commit ca2ca71f63
120 changed files with 2343 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import sys
problem_name = str('slalom')
sys.stdin = open(problem_name + ".in", "r")
sys.stdout = open(problem_name+".out", "w")
n= int(input())
a = []
for i in range(n):
a.append(list(map(int, input().split())))
count=0
for i in reversed(range(len(a)-1)):
for j in range(len(a[i])):
a[i][j] = a[i][j] + max(a[i+1][j], a[i+1][j+1])
print(a[0][0])