DescriptionBessiehastwocrispredapplestodelivertotwoofherfriendsintheherd.Ofcourse,shetravelstheC(1<=C<=200,000)cowpathswhicharearrangedastheusualgraphwhichconnectsP(1<=P<=100,000)pasturesconvenientlynumberedfrom1..P:nocowpathleadsfromapasturetoitself,cowpathsarebidirectional,eachcowpathhasanassociateddistance,and,bestofall,itisalwayspossibletogetfromanypasturetoanyotherpasture....
DescriptionFarmerJohnhasabalanceforweighingthecows.HealsohasasetofN(1<=N<=1000)weightswithknownmasses(allofwhichfitin31bits)foruseononesideofthebalance.Heplacesacowononesideofthebalanceandthenaddsweightstotheothersideuntiltheybalance.(FJcannotputweightsonthesamesideofthebalanceasthecow,becausecowstendtokickweightsinhisfacewhenevertheycan.)Thebalancehasamaximummassratingandwillbreak...
近期评论