• 「BZOJ3894」文理分科

    「BZOJ3894」文理分科

    Description 文理分科是一件很纠结的事情!(虽然看到这个题目的人肯定都没有纠结过) 小P所在的班级要进行文理分科。他的班级可以用一个n*m的矩阵进行描述,每个格子代表一个同学的座位。每位同学必须从文科和理科中选择一科。同学们在选择科目的时候会获得一个满意值。满意值按如下的方式得到:1.如果第i行第秒J的同学选择了文科,则他将获得art[i][j]的满意值,如 果选择理科,将得到science[i][j]的满意值。2.如果第i行...

    22015年3月25日7,861最小割
  • 「BZOJ1283」序列

    「BZOJ1283」序列

    Description给出一个长度为的正整数序列Ci,求一个子序列,使得原序列中任意长度为的子串中被选出的元素不超过K(K,M<=100)个,并且选出的元素之和最大。Input第1行三个数N,m,k。接下来N行,每行一个字符串表示Ci。Output最大和。SampleInput10534446666644SampleOutput30HINT20%的数据:n<=10。100%的数据:N<=1000,k,m<=100。Ci<=20000。题解线性规划裸题复习模板ing题解请看:http://hzwer.c...

    02015年3月25日4,964费用流
  • 「BZOJ3850」ZCC Loves Codefires

    「BZOJ3850」ZCC Loves Codefires

    DescriptionThoughZCChasmanyFans,ZCChimselfisacrazyFanofacoder,called"Memset137".ItwasonCodefires(CF),anonlinecompetitiveprogrammingsite,thatZCCknewMemset137,andimmediatelybecamehisfan.Butwhy?BecauseMemset137cansolveallprobleminrounds,withoutunsuccessfulsubmissions;hisestimationoftimetosolvecertainproblemissoaccurate,thathecansurelygetanAcceptedthesecondhehaspredicted.Hesoon...

    02015年3月23日3,063贪心
  • 「CF529B」Group Photo 2(online mirror version)

    「CF529B」Group Photo 2(online mirror version)

    Manyyearshavepassed,andnfriendsmetatapartyagain.Technologieshaveleapedforwardsincethelastmeeting,cameraswithtimerappearedandnowitisnotobligatoryforoneofthefriendstostandwithacamera,and,thus,beingabsentonthephoto.Simplyspeaking,theprocessofphotographingcanbedescribedasfollows.Eachfriendoccupiesarectangleofpixelsonthephoto:thei-thoftheminastandingstateoccupiesawipixelswideandahipixelshighrectang...

    02015年3月23日2,710贪心,STL
  • 「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,256模拟
  • [JSOI2010] 旅行

    [JSOI2010] 旅行

    给定一张无向图,可以k次交换两条边边权,求1到n的最短路交换执行于求最短路之前,边权1<=c<=1000点数<=50边数<=150k<=20此题找不到题解求神犇留言做法我的想法。。。先求从1-n,无视i条边边权的最短路,然后在路径外找i条最短的加回去。。最后只对了5个点。。。[crayon-67bb4f5d089e7311367856/] ...

    22015年3月23日3,995STL,spfa
  • 「BZOJ2086」[POI2010] Blocks

    「BZOJ2086」[POI2010] Blocks

    Description给出N个正整数a[1..N],再给出一个正整数k,现在可以进行如下操作:每次选择一个大于k的正整数a[i],将a[i]减去1,选择a[i-1]或a[i+1]中的一个加上1。经过一定次数的操作后,问最大能够选出多长的一个连续子序列,使得这个子序列的每个数都不小于k。总共给出M次询问,每次询问给出的k不同,你需要分别回答。Input第一行两个正整数N(N<=1,000,000)和M(M<=50)。第二行N个正整数,第i个正整数表示a[i](a[i...

    02015年3月23日3,856单调栈
  • 「BZOJ2590」[Usaco2012 Feb] Cow Coupons

    「BZOJ2590」[Usaco2012 Feb] Cow Coupons

    DescriptionFarmerJohnneedsnewcows!ThereareNcowsforsale(1<=N<=50,000),andFJhastospendnomorethanhisbudgetofMunitsofmoney(1<=M<=10^14).CowicostsP_imoney(1<=P_i<=10^9),butFJhasKcoupons(1<=K<=N),andwhenheusesacoupononcowi,thecowcostsC_iinstead(1<=C_i<=P_i).FJcanonlyuseonecouponpercow,ofcourse.WhatisthemaximumnumberofcowsFJcanafford?PROBLEMN...

    12015年3月23日5,047STL,贪心
  • 「BZOJ3907」网格

    「BZOJ3907」网格

    Description某城市的街道呈网格状,左下角坐标为A(0,0),右上角坐标为B(n,m),其中n>=m。现在从A(0,0)点出发,只能沿着街道向正右方或者正上方行走,且不能经过图示中直线左上方的点,即任何途径的点(x,y)都要满足x>=y,请问在这些前提下,到达B(n,m)有多少种走法。Input输入文件中仅有一行,包含两个整数n和m,表示城市街区的规模。Output输出文件中仅有一个整数和一个换行/回车符,表示不同的方案总数。SampleInp...

    02015年3月23日5,315卡特兰数,排列组合
  • 「CF528A」Glass Carving

    「CF528A」Glass Carving

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

    12015年3月18日907STL,离线处理
  • 「codechef」March Challenge 2015

    「codechef」March Challenge 2015

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

    02015年3月17日3,464模拟,并查集,二分法,离线处理
  • 「CFgym100541」ATM withdrawal

    「CFgym100541」ATM withdrawal

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

    02015年3月14日2,952递推与动规
25 / 145 « 上一页 1 ...23 24 25 26 27 ...145 下一页 »