*nod*.
Build up your graph (city nodes with bridge edges between them). Almost any implimentation would work.
Then, you want to "paint" the graph with the max weight of a truck that can reach each city. Flow out greedily from city zero.
How to flow: keep track of which cities you already know how much weight can reach. Keep track of all bridges out of the known territory: store max (bridge capacity, capacity of the city it comes from), and keep this list sorted by this effective capacity.
Select the highest effective capacity bridge. Bring the city it goes to into the fold, and add the bridges out of that city to your sorted bridge list.
Repeat until bridge list empty.
You can short cut it once you have every city that you want to visit in your known capacity set.
Now, find the min capacity city you have to visit.
Will take O((n lg(n)) time at worst, n = cities + bridges.
Other than the fact both are graph problems, this really isn't the travelling salesman problem.
Oh yes, and all of the above gave good, if less explicit, advice.
General programming contest advice:
Learn "dynamic programming".
Figure out this cute problem: "How can we fit the most amount of cars on a two-lane ferry? Does always putting the next car on the side with the most remaining room solve the problem? Can we exploit the fact that the sum of accumulated car lengths on each lane of the ferry is always an integer?" (from
http://www.cs.sunysb.edu/~skiena/392/lectures/week11/ )
Learn a hell of alot of graph algorithms.
Learn some numeric computation: I got burned not knowing shit about this once.