Skip to content

Instantly share code, notes, and snippets.

@nariaki3551
Last active October 9, 2017 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nariaki3551/e04cd8a46d104ff5748a211eac7cc3e3 to your computer and use it in GitHub Desktop.
Save nariaki3551/e04cd8a46d104ff5748a211eac7cc3e3 to your computer and use it in GitHub Desktop.
n=int(input())
m=int(input())
A=[list(map(int, input().split())) for _ in '1'*m]
B=[0]*m
for _ in range(n-1):
B = [max([B[k]+A[k][j] for k in range(m)]) for j in range(m)]
print(max(B))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment