DescriptionStanandOllieplaythegameofmultiplicationbymultiplyinganintegerpbyoneofthenumbers2to9.Stanalwaysstartswithp=1,doeshismultiplication,thenOlliemultipliesthenumber,thenStanandsoon.Beforeagamestarts,theydrawaninteger1<n<4294967295andthewinneriswhofirstreachesp>=n.InputEachlineofinputcontainsoneintegernumbern.OutputForeachlineofinputoutputonelineeitherStanwins.orOlliewins...
DescriptionLet'sdesignanewchessgame.ThereareNpositionstoholdMchessesinthisgame.Multiplechessescanbelocatedinthesameposition.Thepositionsareconstitutedasatopologicalgraph,i.e.therearedirectededgesconnectingsomepositions,andnocycleexists.TwoplayersyouandImovechessesalternately.Ineachturntheplayershouldmoveonlyonechessfromthecurrentpositiontooneofitsout-positionsalonganedge.Thegamedoesnote...
DescriptionNimisa2-playergamefeaturingseveralpilesofstones.Playersalternateturns,andonhis/herturn,aplayer’smoveconsistsofremoving oneormorestones fromanysinglepile.Playendswhenallthestoneshavebeenremoved,atwhichpointthelastplayertohavemovedisdeclaredthewinner.GivenapositioninNim,yourtaskistodeterminehowmanywinningmovesthereareinthatposition.ApositioninNimiscalled“losing”ifthefirstplay...
近期评论