TheR2companyhas n employeesworkingforit.Theworkinvolvesconstantexchangeofideas,sharingthestoriesofsuccessandupcomingchallenging.Forthat,R2usesafamousinstantmessagingprogramSpyke.R2has m Spykechatsjusttodiscussallsortsofissues.Ineachchat,somegroupofemployeesexchangesmessagesdaily.Anemployeecansimultaneouslytalkinmultiplechats.Ifsomeemployeeisinthe k-thchat,hecanwritemessagestothisch...
NotsolongagocompanyR2boughtcompanyR1andconsequently,allitsdevelopmentsinthefieldofmulticoreprocessors.NowtheR2laboratoryistestingoneoftheR1processors.Thetestinggoesin n steps,ateachsteptheprocessorgetssomeinstructions,andthenitstemperatureismeasured.TheheadengineerinR2iskeepingareportrecordontheworkoftheprocessor:hewritesdowntheminimumandthemaximummeasuredtemperatureinhisnotebook.Hisas...
TheCompanyDynamicRankingshasdevelopedanewkindofcomputerthatisnolongersatisfiedwiththequeryliketosimplyfindthek-thsmallestnumberofthegivenNnumbers.TheyhavedevelopedamorepowerfulsystemsuchthatforNnumbersa[1],a[2],...,a[N],youcanaskitlike:whatisthek-thsmallestnumberofa[i],a[i+1],...,a[j]?(Forsomei<=j,0<k<=j+1-ithatyouhavegiventoit).Morepowerful,youcanevenchangethevalueofsomea[i],an...
TheemployeesoftheR1companyoftenspendtimetogether:theywatchfootball,theygocamping,theysolvecontests.So,it'snobigdealthatsometimessomeonepaysforsomeoneelse.Todayisthedayofgivingoutmoneyrewards.TheR1companyCEOwillinviteemployeesintohisofficeonebyone,rewardingeachoneforthehardworkthismonth.TheCEOknowswhoowesmoneytowhom.Andhealsounderstandsthatifheinvitesperson x tohisofficeforareward,a...
OneofthemostimportantproductsoftheR1companyisapopular@r1.commailservice.TheR1mailboxesreceiveandsendmillionsofemailseveryday.Today,theonlinenewsthunderedwithterribleinformation.TheR1databasecrashedandalmostnodatacouldbesavedexceptforonebigstring.ThedevelopersassumethatthestringcontainsthelettersofsomeusersoftheR1mail.Recoveringlettersisatediousmostlymanualwork.Sobeforeyoustartthisproces...
Developersoftenfacewithregularexpressionpatterns.Apatternisusuallydefinedasastringconsistingofcharactersandmetacharactersthatsetstherulesforyoursearch.Thesepatternsaremostoftenusedtocheckwhetheraparticularstringmeetsthecertainrules.Inthistask,apatternwillbeastringconsistingofsmallEnglishlettersandquestionmarks('?').Thequestionmarkinthepatternisametacharacterthatdenotesanarbitrarysmalllettero...
TheR1companywantstoholdawebsearchchampionship.Therewere n computersgivenforthecompetition,eachofthemisconnectedtotheInternet.Theorganizersbelievethatthedatatransferspeeddirectlyaffectstheresult.ThehigherthespeedoftheInternetis,thefastertheparticipantwillfindthenecessaryinformation.Therefore,beforethecompetitionstarted,eachcomputerhaditsmaximumpossibledatatransferspeedmeasured.Onthe i-t...
TheR1companyhasrecentlyboughtahighrisebuildinginthecentreofMoscowforitsmainoffice.It'stimetodecoratethenewoffice,andthefirstthingtodoistowritethecompany'ssloganabovethemainentrancetothebuilding.Thesloganofthecompanyconsistsof n characters,sothedecoratorshungalargebanner, n meterswideand 1 meterhigh,dividedinto n equalsquares.Thefirstcharacterofthesloganmustbeinthefirstsquare(theleftm...
Oneday,atthe"RussianCodeCup"eventitwasdecidedtoplayfootballasanoutofcompetitionevent.Allparticipantswasdividedinto n teamsandplayedseveralmatches,twoteamscouldnotplayagainsteachothermorethanonce.TheappointedJudgewasthemostexperiencedmember—Pavel.Butsincehewasthewisestofall,hesoongotboredofthegameandfellasleep.Wakingup,hediscoveredthatthetournamentisoverandtheteamswanttoknowtheresultso...
Duringthe"RussianCodeCup"programmingcompetition,thetestingsystemstoresallsentsolutionsforeachparticipant.Weknowthatmanyparticipantsuserandomnumbersintheirprogramsandareoftensentseveralsolutionswiththesamesourcecodetocheck.Eachparticipantisidentifiedbysomeuniquepositiveinteger k,andeachsentsolution A ischaracterizedbytwonumbers: x —thenumberofdifferentsolutionsthataresentbeforethefirst...
Thefinalistsofthe"RussianCodeCup"competitionin2214willbetheparticipantswhowininoneoftheeliminationrounds.Theeliminationroundsaredividedintomainandadditional.Eachofthemaineliminationroundsconsistsof c problems,thewinnersoftheroundarethefirst n peopleintheratinglist.Eachoftheadditionaleliminationroundsconsistsof d problems.Thewinneroftheadditionalroundisoneperson.Besides, k winnerso...
近期评论