Advertisement
Guest User

Untitled

a guest
Feb 14th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. def main():
  2. first_input = input().strip('\n').split(' ')
  3. N, M = [int(x) for x in first_input]
  4.  
  5. target_list = [0] * N
  6.  
  7. max_v = 0
  8. # Loop through the input range
  9. for i in range(0, M):
  10. input_line = input().strip('\n').split(' ')
  11. a, b, k = [int(x) for x in input_line]
  12. # Modify list
  13. for j in range(a - 1, b):
  14. target_list[j] += k
  15. if target_list[j] > max_v:
  16. max_v = target_list[j]
  17.  
  18. print(max_v)
  19.  
  20.  
  21. if __name__ == '__main__':
  22. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement