Editorial for COCI '07 Contest 6 #1 Parking


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

The task can be solved by simulation. We need to keep track of how many trucks are in the rest area.

For every minute between 0 and 100, we:

  • Add the number of trucks arriving during that minute.
  • Subtract the number of trucks departing during that minute.
  • Charge for parking based on the number of trucks parked.

Comments

There are no comments at the moment.