Eniaisindanger!EvildarkmageDeimosinvadedfromanotherworld,andnotalone,butwithcountlessarmyofdarkness.CourtmagicianIrdishadfailedtodefeatDeimosinthemagicduel,sohehidinthebasementofthepalaceanddecidedtostepbackthroughaportaltocallonehisoldacquaintanceforhelp.ButsuchaturnisnotinDeimos'plans,sohewantsnottoreleasehisopponentalive.Irdisknows n differentspellstocreateaportal,anyofwhichisaccepta...
Artemhasanarrayof n positiveintegers.Artemdecidedtoplaywithit.Thegameconsistsof n moves.Eachmovegoeslikethis.Artemchoosessomeelementofthearrayandremovesit.Forthat,hegetsmin(a, b) points,where a and b arenumbersthatwereadjacentwiththeremovednumber.Ifthenumberdoesn'thaveanadjacentnumbertotheleftorright,Artemdoesn'tgetanypoints.Aftertheelementisremoved,thetwopartsofthearraygluetoge...
Andreyneedsonemoreproblemtoconductaprogrammingcontest.Hehas n friendswhoarealwayswillingtohelp.Hecanasksomeofthemtocomeupwithacontestproblem.Andreyknowsonevalueforeachofhisfiends—theprobabilitythatthisfriendwillcomeupwithaproblemifAndreyaskshim.HelpAndreychoosepeopletoask.Asheneedsonlyoneproblem,Andreyisgoingtobereallyupsetifnoonecomesupwithaproblemorifhegetsmorethanoneproblemfromhisfr...
HaveyoueverplayedHanabi?Ifnot,thenyou'vegottotryitout!Thisproblemdealswithasimplifiedversionofthegame.Overall,thegamehas25typesofcards(5distinctcolorsand5distinctvalues).Boryaisholding n cards.ThegameissomewhatcomplicatedbythefactthateverybodyseesBorya'scardsexceptforBoryahimself.Boryaknowswhichcardshehasbutheknowsnothingabouttheordertheyliein.NotethatBoryacanhavemultipleidenticalcar...
Valeraisacollector.Oncehewantedtoexpandhiscollectionwithexactlyoneantiqueitem.Valeraknows n sellersofantiques,the i-thofthemauctioned ki items.Currentlytheauctionpriceofthe j-thobjectofthe i-thsellerissij.Valeragetsonwellwitheachofthe n sellers.Heisperfectlysurethatifheoutbidsthecurrentpriceofoneoftheitemsintheauction(inotherwords,offersthesellerthemoneythatisstrictlygreaterthanthec...
近期评论