• 「CF538X」Codeforces Round #300

    「CF538X」Codeforces Round #300

    A.CuttingBanner枚举切掉中间部分匹配[crayon-662b9ab50bb07667991024/]B.QuasiBinary用最少的只包含01的数凑出n每次贪心在非0位上取1[crayon-662b9ab50bb14876787574/]C.Tourist'sNotes根据每俩个的时间及高度差可计算答案[crayon-662b9ab50bb1d911718998/]D.WeirdChess暴力暴力暴力[crayon-662b9ab50bb26589177682/]E.DemiurgesPlayAgain考虑进入某个根,最终会取得子树第几小的叶子[crayon-662b9ab50bb32142583...

    02015年4月27日6,146模拟,贪心,主席树,调和级数
  • 「codechef」April Challenge 2015

    「codechef」April Challenge 2015

    BROKPHON模拟[crayon-662b9ab50c49a788014962/]CHEFLCM所有约数和[crayon-662b9ab50c4a8793800499/]PIANO1暴力TT[crayon-662b9ab50c4b2960178356/]CSEQl~r之间每个数的使用次数当作一个变量。。那么就相当于求方程组sigma(xi)(l<=i<=r)=n的非负整数解数。。然后就是排列组合求和[crayon-662b9ab50c4ba003098096/]CARLOS先用并查集将能够相互转化的并在一起dpf(i,j)表示前i个末尾为j的最小改...

  • 「CF526X」ZeptoLab Code Rush 2015

    「CF526X」ZeptoLab Code Rush 2015

    懒得开多篇了,深夜口胡TAT现在是凌晨4点。。。A:KingofThieves枚举起始点模拟[crayon-662b9ab50d4eb080745258/]B:OmNomandDarkPark算出最大值,从最高层开始贪心,能加尽量加[crayon-662b9ab50d4f8881459453/]C:OmNomandCandies设hb/wb为小于ha/wa即a的单位质量价值高分类讨论若wb很大,则可以枚举b取了多少个否则a取的数量一定与c/wa相差不超过wb分类暴力TAT[crayon-662b9ab50d501380537659/]D: OmNom...

  • 「CF529E」The Art of Dealing with ATM

    「CF529E」The Art of Dealing with ATM

    ATMsofawell-knownbankofasmallcountryarearrangedsothattheycannotgiveanyamountofmoneyrequestedbytheuser.Duetothelimitedsizeofthebilldispenser(thedevicethatisdirectlygivingmoneyfromanATM)andsomepeculiaritiesoftheATMstructure,youcangetatmostkbillsfromit,andthebillsmaybeofatmosttwodistinctdenominations.Forexample,ifacountryusesbillswithdenominations10,50,100,500,1000and5000burles,thenatk = ...

    02015年3月23日3,101模拟
  • 「codechef」March Challenge 2015

    「codechef」March Challenge 2015

    只做了前6题弃疗了感觉codechef写题解也没啥人看……「codechefCNOTE」ChefandNotebooks纯模拟[crayon-662b9ab53aed5937177567/]「codechefSIGNWAVE」SignWave听说此题打表可以找规律。。引用zld神犇的话吧。。。就是若干个余弦函数的零点均不同。。然后sin函数的分布就十分奇怪了。。比如s=3的时候就是312131213,忽略两端的情况。。就变成非常规则的1213121然后我们再考虑余弦函数当c=2的时候分布就是011101110...

    02015年3月17日3,221模拟,二分法,并查集,离线处理
  • 「topcoder」Kodifica – Pratice Round 1

    「topcoder」Kodifica - Pratice Round 1

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

    02015年3月11日5,537模拟,排列组合
  • 「topcoder」Single Round Match 652 – Round 1 Div2

    「topcoder」Single Round Match 652 - Round 1 Div2

    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...

  • 「codechef」January Lunchtime 2015

    「codechef」January Lunchtime 2015

    Pieceofcake 统计每个字母出现次数,取最大值,判断其是否等于l/2[crayon-662b9ab53cb11878765233/]Justmultiply 乘法快速乘即可,但乘方由于M过大。。使用欧拉函数降幂比较麻烦。。发现a^(10b+c)=(a^b)^10*a^c然后就能On算出表达式了^10可以看做常数[crayon-662b9ab53cb20976880390/]Candidatewalk状压一下,转移显然[crayon-662b9ab53cb2a266608489/]Manybananas这一题比较有意思将宗族大小分为<=300和>300用数组统...

  • 「CF519X」Codeforces Round #294 (Div. 2)

    「CF519X」Codeforces Round #294 (Div. 2)

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

  • 「codechef」February Lunchtime 2015

    「codechef」February Lunchtime 2015

    懒得开多篇了LuckyFour 这题在逗我么[crayon-662b9ab53e195914669668/]TheWarehouse发现实际上把一个东西移动到一个位置相当于不断做代价为1的交换所以只要枚举给3种字母赋权,求逆序对最小值即可[crayon-662b9ab53e1a3372534486/]Heavy-lightDecompositions设f[i][j]表示i为根的子树,后代到i经过轻边数量不超过j树形dp,要用到前缀后缀积/逆元。。。[crayon-662b9ab53e1b0559227571/]  TheFirstCube 一眼分...

  • 「CF509A」Maximum in Table

    「CF509A」Maximum in Table

    Ann × ntableaisdefinedasfollows:Thefirstrowandthefirstcolumncontainones,thatis:ai, 1 = a1, i = 1foralli = 1, 2, ..., n.Eachoftheremainingnumbersinthetableisequaltothesumofthenumberaboveitandthenumbertotheleftofit.Inotherwords,theremainingelementsaredefinedbytheformulaai, j = ai - 1, j + ai, j - 1.Theseconditionsdefineallthevaluesinthetable.Youaregivenanumbern.Younee...

    02015年1月31日2,065模拟
  • 「CF508A」Pasha and Pixels

    「CF508A」Pasha and Pixels

    Pashaloveshisphoneandalsoputtinghishairup...Butthehairisnowirrelevant.Pashahasinstalledanewgametohisphone.Thegoalofthegameisfollowing.Thereisarectangularfieldconsistingofnrowwithmpixelsineachrow.Initially,allthepixelsarecoloredwhite.Inonemove,Pashacanchooseanypixelandcoloritblack.Inparticular,hecanchoosethepixelthatisalreadyblack,thenaftertheboy'smovethepixeldoesnotchange,thatis,itremains...

    02015年1月28日2,133模拟