• + 0 comments

    n, m = list(map(int, input().split())) l = [0]*(n+1) for k in range(m): a, b, num = list(map(int, input().split())) l[a-1]+=num l[b]-=num maxa, x = 0,0 for i in l: x+=i if maxa

    made one in python, did not even pass as many testcases, that one with just direct adding did