• 「CF538X」Codeforces Round #300

    「CF538X」Codeforces Round #300

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

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

    「codechef」April Challenge 2015

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

  • 「CF526X」ZeptoLab Code Rush 2015

    「CF526X」ZeptoLab Code Rush 2015

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

    「codechef」March Challenge 2015

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

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

    「topcoder」Kodifica - Pratice Round 1

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

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

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

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

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

  • 「codechef」February Lunchtime 2015

    「codechef」February Lunchtime 2015

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