Bus Assignment
Question
Solution
Idea
As the first ICPC question I tried, this question is not that hard. Basically, the idea is:
use two variables
cur(the current number of passengers on the bus) andmax(the maximum number of passengers on the bus).Every time you arrived at a bus stop, update the
curbased on the number of passengers get on and off. After that, comparecurwithmax, ifcuris bigger, thenmax=cur.
Code
https://github.com/mendax1234/Coding-Problems/blob/main/kattis/busassignment/busassignment.c
Last updated