Optiversponsoredproblem.AfteryearsofhardworkOptiverhasdevelopedamathematicalmodelthatallowsthemtopredictwetherornotacompanywillbesuccesful.Thisobviouslygivesthemagreatadvantageonthestockmarket.Inthepast,Optivermadeadealwithabigcompany,whichforcesthemtobuysharesofthecompanyaccordingtoafixedschedule.Unfortunately,Optiver’smodelhasdeterminedthatthecompanywillgobankruptafterexactlyndays,after...
Youhaverred,ggreenandbblueballoons.Todecorateasingletableforthebanquetyouneedexactlythreeballoons.Threeballoonsattachedtosometableshouldn'thavethesamecolor.Whatmaximumnumbertoftablescanbedecoratedifweknownumberofballoonsofeachcolor?Yourtaskistowriteaprogramthatforgivenvaluesr,gandbwillfindthemaximumnumbertoftables,thatcanbedecoratedintherequiredmanner.InputThesinglelinecontainsthreeintegers...
It'stimepolarbearsMenshykovandUsladafromthezooofSt.PetersburgandelephantHoracefromthezooofKievgotdowntobusiness.Intotal,therearentasksforthedayandeachanimalshoulddoeachofthesetasks.Foreachtask,theyhaveevaluateditsdifficulty.Alsoanimalsdecidedtodothetasksinorderoftheirdifficulty.Unfortunately,sometaskscanhavethesamedifficulty,sotheorderinwhichonecanperformthetasksmayvary.Menshykov,Usla...
DescriptionBeingafanofallcold-weathersports(especiallythoseinvolvingcows),FarmerJohnwantstorecordasmuchoftheupcomingwinterMoolympicsaspossible.ThetelevisionschedulefortheMoolympicsconsistsofNdifferentprograms(1<=N<=150),eachwithadesignatedstartingtimeandendingtime.FJhasadual-tunerrecorderthatcanrecordtwoprogramssimultaneously.Pleasehelphimdeterminethemaximumnumberofprogramshecanr...
Paulhatespalindromes.HeassumesthatstringsistolerableifeachitscharacterisoneofthefirstplettersoftheEnglishalphabetandsdoesn'tcontainanypalindromecontiguoussubstringoflength2ormore.Paulhasfoundatolerablestringsoflengthn.Helphimfindthelexicographicallynexttolerablestringofthesamelengthorelsestatethatsuchstringdoesnotexist.InputThefirstlinecontainstwospace-separatedintegers:nandp(1 ≤ n ≤ ...
ApplemanandToastmanplayagame.InitiallyApplemangivesonegroupof n numberstotheToastman,thentheystarttocompletethefollowingtasks:EachtimeToastmangetsagroupofnumbers,hesumsupallthenumbersandaddsthissumtothescore.ThenhegivesthegrouptotheAppleman.EachtimeApplemangetsagroupconsistingofasinglenumber,hethrowsthisgroupout.EachtimeApplemangetsagroupconsistingofmorethanonenumber,hesplitsthegrou...
近期评论