본문 바로가기

Programming [Python]/백준 알고리즘 솔루션

#305 백준 파이썬 [2460] 지능형 기차 2

https://www.acmicpc.net/problem/2460

 

PYTHON CODE

passenger = 0
max_passenger = 0

for _ in range(10):
    out_train, in_train  = map(int, input().split()) 
    passenger += in_train - out_train 
    max_passenger = max(passenger, max_passenger) 
    
print(max_passenger)