Guest User

Untitled

a guest
Oct 15th, 2016
82
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def M(A,j):
  2.         V = [0] * (j+1)
  3.         V[0] = max(A[0],0)
  4.  
  5.         for i in range(1,len(A),1):
  6.                 V[i]= max(V[i-1]+A[i],V[i])
  7.         return max(V)
  8.  
  9. A = [0,1,2,3,-1,77,22,100,-44,-55]
  10. j = len(A)
  11. print M(A,j)
RAW Paste Data