DescriptionFJ'sNcows(2<=N<=100,000)arestandingatvariouspositionsalongalongone-dimensionalfence.Theithcowisstandingatpositionx_i(anintegerintherange0...1,000,000,000)andiseitheraplainwhitecoworaspottedcow.Notwocowsoccupythesameposition,andthereisatleastonewhitecow.FJwantstotakeaphotoofacontiguousintervalofcowsforthecountyfair,butinfairnesstohisdifferentcows,hewantstoensurethereareequ...
PolarbearsMenshykovandUsladafromthezooofSt.PetersburgandelephantHoracefromthezooofKievgotholdoflotsofwoodencubessomewhere.Theystartedmakingcubetowersbyplacingthecubesoneontopoftheother.Theydefinedmultipletowersstandinginalineasawall.Awallcanconsistoftowersofdifferentheights.Horacewasthefirsttofinishmakinghiswall.Hecalledhiswallanelephant.Thewallconsistsofwtowers.Thebearsalsofinishedm...
PolarbearsMenshykovandUsladafromthezooofSt.PetersburgandelephantHoracefromthezooofKievdecidedtobuildahouseofcards.Forthatthey'vealreadyfoundaheftydeckofnplayingcards.Let'sdescribethehousetheywanttomake:Thehouseconsistsofsomenon-zeronumberoffloors.Eachfloorconsistsofanon-zeronumberofroomsandtheceiling.Aroomistwocardsthatareleanedtowardseachother.Theroomsaremadeinarow,eachtwoadjoiningro...
It'stimepolarbearsMenshykovandUsladafromthezooofSt.PetersburgandelephantHoracefromthezooofKievgotdowntobusiness.Intotal,therearentasksforthedayandeachanimalshoulddoeachofthesetasks.Foreachtask,theyhaveevaluateditsdifficulty.Alsoanimalsdecidedtodothetasksinorderoftheirdifficulty.Unfortunately,sometaskscanhavethesamedifficulty,sotheorderinwhichonecanperformthetasksmayvary.Menshykov,Usla...
TwopolarbearsMenshykovandUsladafromtheSt.PetersburgzooandelephantHoracefromtheKievzoogotsixstickstoplaywithandassesstheanimals'creativity.Menshykov,UsladaandHoracedecidedtomakeeitheranelephantorabearfromthosesticks.Theycanmakeananimalfromsticksinthefollowingway:Foursticksrepresenttheanimal'slegs,thesesticksshouldhavethesamelength.Tworemainingsticksrepresenttheanimal'sheadandbody.Theb...
DescriptionBeingafanofallcold-weathersports(especiallythoseinvolvingcows),FarmerJohnwantstorecordasmuchoftheupcomingwinterMoolympicsaspossible.ThetelevisionschedulefortheMoolympicsconsistsofNdifferentprograms(1<=N<=150),eachwithadesignatedstartingtimeandendingtime.FJhasadual-tunerrecorderthatcanrecordtwoprogramssimultaneously.Pleasehelphimdeterminethemaximumnumberofprogramshecanr...
近期评论