116A - Tram

Run Settings
LanguagePython
Language Version
Run Command
def train(stops, i, j): new_list = [] count = 0 for e in range(0, stops): count = count - i[e] + j[e] new_list.append(count) return max(new_list) if __name__ == '__main__': stops = int(input()) i = [] j = [] for _ in range(0, stops): a, b = list(map(int, input().split())) i.append(a) j.append(b) print(train(stops, i, j))
Editor Settings
Theme
Key bindings
Full width
Lines