DescriptionThereisatravelagencyinAdeltontownonZanzibarisland.Ithasdecidedtoofferitsclients,besidesmanyotherattractions,sightseeingthetown.Toearnasmuchaspossiblefromthisattraction,theagencyhasacceptedashrewddecision:itisnecessarytofindtheshortestroutewhichbeginsandendsatthesameplace.Yourtaskistowriteaprogramwhichfindssucharoute.InthetownthereareNcrossingpointsnumberedfrom1toNandMtwo-wayr...
DescriptionBessieisoutinthefieldandwantstogetbacktothebarntogetasmuchsleepaspossiblebeforeFarmerJohnwakesherforthemorningmilking.Bessieneedsherbeautysleep,soshewantstogetbackasquicklyaspossible.FarmerJohn'sfieldhasN(2<=N<=1000)landmarksinit,uniquelynumbered1..N.Landmark1isthebarn;theappletreegroveinwhichBessiestandsalldayislandmarkN.CowstravelinthefieldusingT(1<=T<=2000...
DescriptionThecowshavebeensentonamissionthroughspacetoacquireanewmilkingmachinefortheirbarn.TheyareflyingthroughaclusterofstarscontainingN(1<=N<=50,000)planets,eachwithatradingpost.ThecowshavedeterminedwhichofK(1<=K<=1,000)typesofobjects(numbered1..K)eachplanetintheclusterdesires,andwhichproductstheyhavetotrade.Noplanethasdevelopedcurrency,sotheyworkunderthebartersystem:alltr...
近期评论