You are viewing a single comment's thread. Return to all comments →
n,q = input().rstrip().split() zero_list = [ 0 for _ in range(int(n)+2)] for i in range(int(q)): n = list(map(int,input().rstrip().split()))[:3] zero_list[n[0]] += n[2] zero_list[n[1]+1] = zero_list[n[1]+1] - n[2] addition,max_val = 0,0 for i in range(len(zero_list)): addition += zero_list[i] if addition > max_val: max_val = addition print(max_val)
Seems like cookies are disabled on this browser, please enable them to open this website
Array Manipulation
You are viewing a single comment's thread. Return to all comments →