
Dreamoonlovessummingupsomethingfornoreason.Onedayheobtainstwointegersaandboccasionally.Hewantstocalculatethesumofallniceintegers.Positiveintegerxiscalledniceifand,wherekissomeintegernumberinrange[1, a].Bywedenotethequotientofintegerdivisionofxandy.Bywedenotetheremainderofintegerdivisionofxandy.Youcanreadmoreabouttheseoperationshere:http://goo.gl/AcsXhT.Theanswermaybelarge,sopleaseprint...
![「BZOJ3540」[Usaco2014 Open] Fair Photography](http://hzwer.com/wp-content/themes/ly/image/image_post/2014-12-10_13-01-59.jpg)
DescriptionFJ'sNcows(2<=N<=100,000)arestandingatvariouspositionsalongalongone-dimensionalfence.Theithcowisstandingatpositionx_i(anintegerintherange0...1,000,000,000)andiseitheraplainwhitecoworaspottedcow.Notwocowsoccupythesameposition,andthereisatleastonewhitecow.FJwantstotakeaphotoofacontiguousintervalofcowsforthecountyfair,butinfairnesstohisdifferentcows,hewantstoensurethereareequ...

PolarbearsMenshykovandUsladafromthezooofSt.PetersburgandelephantHoracefromthezooofKievdecidedtobuildahouseofcards.Forthatthey'vealreadyfoundaheftydeckofnplayingcards.Let'sdescribethehousetheywanttomake:Thehouseconsistsofsomenon-zeronumberoffloors.Eachfloorconsistsofanon-zeronumberofroomsandtheceiling.Aroomistwocardsthatareleanedtowardseachother.Theroomsaremadeinarow,eachtwoadjoiningro...
![「BZOJ2102」[Usaco2010 Dec] The Trough Game](http://hzwer.com/wp-content/themes/ly/image/image_post/2014-12-10_11-13-41.jpg)
DescriptionFarmerJohnandBessieareplayinggamesagain.Thisonehastodowithtroughsofwater.FarmerJohnhashiddenN(1<=N<=20)troughsbehindthebarn,andhasfilledsomeofthemwithfood.BessiehasaskedM(1<=M<=100)questionsoftheform,"Howmanytroughsfromthislist(whichsherecites)arefilled?".Bessieneedsyourhelptodeducewhichtroughsareactuallyfilled.ConsideranexamplewithfourtroughswhereBessiehasas...

AfteryouhadhelpedGeorgeandAlextomoveinthedorm,theywenttohelptheirfriendFedorplayanewcomputergame«CallofSoldiers3».Thegamehas(m + 1)playersandntypesofsoldiersintotal.Players«CallofSoldiers3»arenumberedform1to(m + 1).Typesofsoldiersarenumberedfrom0ton - 1.Eachplayerhasanarmy.Armyofthei-thplayercanbedescribedbynon-negativeintegerxi.Considerbinaryrepresentationofxi:ifthej-thbit...
近期评论