
Leonidwantstobecomeaglasscarver(thepersonwhocreatesbeautifulartworksbycuttingtheglass).Healreadyhasarectangularwmm × hmmsheetofglass,adiamondglasscutterandlotsofenthusiasm.Whathelacksisunderstandingofwhattocarveandhow.Inordernottowastetime,hedecidedtopracticethetechniqueofcarving.Todothis,hemakesverticalandhorizontalcutsthroughtheentiresheet.Thisprocessresultsinmakingsmallerrectangularfra...

VinhworksforanATMmachinemanufacturingcompany.ThebasicfunctionalityofanATMmachineiscashwithdrawal.WhenauserrequestsacashwithdrawalofWVND(VietnameseDong),theATMhastodispenseNmoneynotessuchthattheysumuptoW.ForthenextgenerationofATMmachine,VinhisworkingonanalgorithmtominimizethenumberNofmoneynotesforeachcashwithdrawaltransaction.YourtaskistohelpVinhtodohisjobgiventhatthemon...

Minhhasaboxofpencils.TheboxisarectangleofsizeM * N,whereposition(i, j)hasapencilwithalengthofexactlyi * N + j(0 ≤ i ≤ M - 1, 0 ≤ j ≤ N - 1).Notethatposition(0, 0)doesnothaveanypencilhencehavingalengthof0.Hewondersifhecouldselectasub-rectangleoftheboxandjoinallthepencilswithinthatsub-rectangletogether,togetanewlongpencilthathasaspecificlengthLthathewants.Yourta...

Yourteamwasexploringanancientcity.Suddenlyyoufoundanoldscrollwith2integernumbersNandK,whichencryptsthesecretcodetoopenatreasurebox.ConsideringatransformationonanintegerXdescribedasfollows:X = X + X mod 100,thesecretcodecanbeobtainedbyapplyingtheabove-describedtransformationKtimessuccessivelytoN.InputTheinputfileconsistsofseveraldatasets.Thefirstlineoftheinputfilecontainsthenumb...
![「BZOJ2796」[POI2012] Fibonacci Representation](http://hzwer.com/wp-content/themes/ly/image/image_post/2014-12-10_12-32-52.jpg)
DescriptionFib数列0,1,1,2,3,5,8,13,21。给出一个数字,用FIB数列各项加加减减来得到。例如10=5+519=21-217=13+5-11070=987+89-5-1InputInthefirstlineofthestandardinputasinglepositiveintegerisgiven(1<=P<=10)thatdenotesthenumberofqueries.ThefollowinglinesholdasinglepositiveintegerKeach1<=K<=10^17.OutputForeachqueryyourprogramshouldprintonthestandardoutputtheminimumnumberofFibona...

打了场莫名其妙的比赛150Youneedtoupdatethebalanceinyourcheckbook.Youknowyourstartingbalance,thetotalamountspentusingyourdebitcard,andthetotalvalueofchecksthathavebeenwritten.Returnyourendingbalance.a-b-c。。。[crayon-69112c06d8ce9151999352/]500Preparinganationalbudgetinvolvessumsoflargenumbers.Thesenumbersshouldbeformattedinaniceway.Yourtaskis,givensomenicelyformattedcosts(inUSdollarsandcen...

topcoder怎么会把客户端做成这样差评第一场只能打div2TAT250Youaregivenastringsconsistingoflowercaseletters.Weassigntheletters'a'to'z'valuesof1to26,respectively.WewilldenotethevalueassignedtotheletterXbyval[X].Forexample,val['a']=1andval['e']=5.Wedefinethevalueofthestringsasfollows.Foreachletters[i],letk[i]bethenumberoflettersinsthatarelessthanorequaltos[i],includings[i]itself.Then,thevalu...

「cf519A」AandBandChess模拟[crayon-69112c06daaca600488443/]「cf519B」AandBandCompilationErrors排序,双指针对比用个hash/map统计下元素出现次数[crayon-69112c06daad9518930011/]「cf519C」AandBandTeamTraining实际上答案是min(n,m,(m+n)/3)我分类讨论了TAT还是很好yy的[crayon-69112c06daae5536685738/]「cf519D」AandBandInterestingSubstringsa[i][j]表示前缀和为i,字母j为末尾的前缀数量每次查询...
近期评论