Bus Trip (trip)

34 teams scored 2520 points on this task, for a maximum score of 100, an average score of 74 and a median score of 100.

Highlights

  1. I.S. Fermi MN, Mantova is the institute with the most points (280).
  2. Lombardia is the region with the most points (640).

Statement

In Italy there are N cities numbered from 0 to N-1. Luca lives in city S, but for the holidays he decided to go visit city E. Being just a student he doesn't want to spend a fortune in plane tickets, so he decided to have a nice bus trip! Luca used a Bash script to download the complete schedules of all the bus companies in the country. He collected M bus routes, and for each of those he has collected the following four details: (1) the starting city; (2) the time of bus departure; (3) the arrival city; (4) the time of bus arrival. Assuming that Luca is located in the city S at time t = 0, help him compute the earliest possible time he can reach the city E to enjoy his holiday, by using as many buses as needed.