ApplemanandToastmanplayagame.InitiallyApplemangivesonegroupof n numberstotheToastman,thentheystarttocompletethefollowingtasks:EachtimeToastmangetsagroupofnumbers,hesumsupallthenumbersandaddsthissumtothescore.ThenhegivesthegrouptotheAppleman.EachtimeApplemangetsagroupconsistingofasinglenumber,hethrowsthisgroupout.EachtimeApplemangetsagroupconsistingofmorethanonenumber,hesplitsthegrou...
DescriptionByteasarthegardenerisgrowingararetreecalledRotatusInformatikus.Ithassomeinterestingfeatures:Thetreeconsistsofstraightbranches,bifurcationsandleaves.Thetrunkstemmingfromthegroundisalsoabranch.Eachbranchendswitheitherabifurcationoraleafonitstopend.Exactlytwobranchesforkoutfromabifurcationattheendofabranch-theleftbranchandtherightbranch.Eachleafofthetreeislabelledwithanintegerfro...
LittleDimamisbehavedduringamathlessonalotandthenastyteacherMr.Picklesgavehimthefollowingproblemasapunishment.Findallintegersolutions x (0 < x < 109) oftheequation:x = b·s(x)a + c, where a, b, c aresomepredeterminedconstantvaluesandfunction s(x) determinesthesumofalldigitsinthedecimalrepresentationofnumber x.TheteachergivesthisproblemtoDimaforeachlesson.Hechangeson...
Vasyahas n pairsofsocks.InthemorningofeachdayVasyahastoputonapairofsocksbeforehegoestoschool.Whenhecomeshomeintheevening,Vasyatakesofftheusedsocksandthrowsthemaway.Every m-thday(atdayswithnumbers m, 2m, 3m, ...)mombuysapairofsockstoVasya.Shedoesitlateintheevening,sothatVasyacannotputonanewpairofsocksbeforethenextday.HowmanyconsecutivedayspassuntilVasyarunsoutofsocks?InputThesin...
近期评论