SerejaisacoderandhelikestotakepartinCodesorfesrounds.However,Uzhlanddoesn'thavegoodinternetconnection,soSerejasometimesskipsrounds.Codesorfeshasroundsoftwotypes: Div1 (foradvancedcoders)and Div2 (forbeginnercoders).Tworounds, Div1 and Div2,cangosimultaneously,(Div1 roundcannotbeheldwithout Div2)inallothercasestheroundsdon'toverlapintime.Eachroundhasauniqueidentifier—apositi...
Vanyalovesplaying.Heevenhasaspecialsetofcardstoplaywith.Eachcardhasasingleinteger.Thenumberonthecardcanbepositive,negativeandcanevenbeequaltozero.Theonlylimitis,thenumberoneachcarddoesn'texceed x intheabsolutevalue.Natashadoesn'tlikewhenVanyaspendsalongtimeplaying,soshehidallofhiscards.Vanyabecamesadandstartedlookingforthecardsbutheonlyfound n ofthem.Vanyalovesthebalance,sohewantsthes...
Innalikessweetsandagamecalledthe"CandyMatrix".Today,shecameupwiththenewgame"CandyMatrix2:Reload".Thefieldforthenewgameisarectangletableofsize n × m.Eachlineofthetablecontainsonecellwithadwarffigurine,onecellwithacandy,theothercellsofthelineareempty.Thegamelastsforseveralmoves.Duringeachmovetheplayercanchoose alllinesofthematrixwheredwarfisnotonthecellwithcandy andshout"Let'sgo!"....
Therealwaysissomethingtochoosefrom!Andnow,insteadof"NoughtsandCrosses",Innachooseaveryunusualupgradeofthisgame.Therulesofthegamearegivenbelow:Thereisonepersonplayingthegame.Beforethebeginningofthegameheputs12cardsinarowonthetable.Eachcardcontainsacharacter:"X"or"O".Thentheplayerchoosestwopositiveintegers a and b (a·b = 12),afterthathemakesatableofsize a × b fromthecardshepu...
Useraintahasastackof n redandblueballs.Hecanapplyacertainoperationwhichchangesthecolorsoftheballsinsidethestack.Whilethetopballinsidethestackisred,poptheballfromthetopofthestack.Thenreplacetheblueballonthetopwitharedball.Andfinallypushsomeblueballstothestackuntilthestackhastotalof n ballsinside.Iftherearenoblueballsinsidethestack,aintacan'tapplythisoperation.Giventheinitialstateofthesta...
Useraintaismakingawebsite.Thistimeheisgoingtomakeanavigationofthepages.Inhissite,thereare n pagesnumberedbyintegersfrom 1 to n.Assumethatsomebodyisonthe p-thpagenow.Thenavigationwilllooklikethis: << p - k p - k + 1 ... p - 1 (p) p + 1 ... p + k - 1 p + k >>Whensomeoneclicksthebutton"<<"heisredirectedtopage 1,andwhensomeoneclicksth...
OuroldfriendAlexeyhasfinallyenteredtheUniversityofCityN—theBerlandcapital.AlexeyexpectedhisfathertogethimaplacetoliveinbuthisfathersaiditwashightimeforAlexeytopracticesomefinancialindependence.So,Alexeyislivinginadorm.Thedormhasexactlyonestraightdryer—a 100 centimeterlongropetohangclotheson.Thedryerhasgotacoordinatesysteminstalled:theleftmostendofthedryerhascoordinate 0,andtheoppo...
近期评论