• 「CF538X」Codeforces Round #300

    「CF538X」Codeforces Round #300

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

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

    「codechef」April Challenge 2015

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

  • 「CF526X」ZeptoLab Code Rush 2015

    「CF526X」ZeptoLab Code Rush 2015

    懒得开多篇了,深夜口胡TAT现在是凌晨4点。。。A:KingofThieves枚举起始点模拟[crayon-67ce5dbb6b640190378261/]B:OmNomandDarkPark算出最大值,从最高层开始贪心,能加尽量加[crayon-67ce5dbb6b649343134391/]C:OmNomandCandies设hb/wb为小于ha/wa即a的单位质量价值高分类讨论若wb很大,则可以枚举b取了多少个否则a取的数量一定与c/wa相差不超过wb分类暴力TAT[crayon-67ce5dbb6b64e810701467/]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,261模拟
  • 「codechef」March Challenge 2015

    「codechef」March Challenge 2015

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

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

    「topcoder」Kodifica - Pratice Round 1

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

    02015年3月11日6,121模拟,排列组合
  • 「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-67ce5dbb844c3196246702/]Justmultiply 乘法快速乘即可,但乘方由于M过大。。使用欧拉函数降幂比较麻烦。。发现a^(10b+c)=(a^b)^10*a^c然后就能On算出表达式了^10可以看做常数[crayon-67ce5dbb844cd193141378/]Candidatewalk状压一下,转移显然[crayon-67ce5dbb844d2408929316/]Manybananas这一题比较有意思将宗族大小分为<=300和>300用数组统...

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

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

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

  • 「codechef」February Lunchtime 2015

    「codechef」February Lunchtime 2015

    懒得开多篇了LuckyFour 这题在逗我么[crayon-67ce5dbb85150107987600/]TheWarehouse发现实际上把一个东西移动到一个位置相当于不断做代价为1的交换所以只要枚举给3种字母赋权,求逆序对最小值即可[crayon-67ce5dbb85158053432363/]Heavy-lightDecompositions设f[i][j]表示i为根的子树,后代到i经过轻边数量不超过j树形dp,要用到前缀后缀积/逆元。。。[crayon-67ce5dbb8516e837340635/]  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,554模拟
  • 「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,302模拟