DescriptionThepasturecontainsasmall,contiguousgroveoftreesthathasno'holes'inthemiddleoftheit.Bessiewonders:howfarisittowalkaroundthatgroveandgetbacktomystartingposition?She'sjustsurethereisawaytodoitbygoingfromherstartlocationtosuccessivelocationsbywalkinghorizontally,vertically,ordiagonallyandcountingeachmoveasasinglestep.Justlookingatit,shedoesn'tthinkyoucouldpass'through'thegroveonatrickyd...
DescriptionBessieisinCamelotandhasencounteredastickysituation:sheneedstopassthroughtheforestthatisguardedbytheKnightsofNi.Inordertopassthroughsafely,theKnightshavedemandedthatshebringthemasingleshrubbery.Timeisoftheessence,andBessiemustfindandbringthemashrubberyasquicklyaspossible.Bessiehasamapofoftheforest,whichispartitionedintoasquaregridarrayedintheusualmanner,withaxesparalleltotheXa...
DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.HestartsatapointN(0<=N<=100,000)onanumberlineandthecowisatapointK(0<=K<=100,000)onthesamenumberline.FarmerJohnhastwomodesoftransportation:walkingandteleporting.*Walking:FJcanmovefromanypointXtothepointsX-1orX+1inasingleminute*Teleporting:FJcanmovefromanypointXtothepoint2*Xi...
近期评论