• 「NOIP模拟赛」征兵

    「NOIP模拟赛」征兵

    一个国王,他拥有一个国家。最近他因为国库里钱太多了,闲着蛋疼要征集一只部队要保卫国家。他选定了N个女兵和M个男兵,但事实上每征集一个兵他就要花10000RMB,即使国库里钱再多也伤不起啊。他发现,某男兵和某女兵之间有某种关系(往正常方面想,一共R种关系),这种关系可以使KING少花一些钱就可以征集到兵,不过国王也知道,在征兵的时候,每一个兵只能使用一种关系来少花钱。这时国王向你求助,问他最少要花多少的钱...

    02014年7月3日3,843kruskal
  • 「NOIP模拟赛」魔术球问题弱化版

    「NOIP模拟赛」魔术球问题弱化版

    假设有n根柱子,现要按下述规则在这n根柱子中依次放入编号为1,2,3,…的球。(1)每次只能在某根柱子的最上面放球。(2)在同一根柱子中,任何2个相邻球的编号之和为完全平方数。试设计一个算法,计算出在n根柱子上最多能放多少个球。例如,在4根柱子上最多可放11个球。对于给定的n,计算在n根柱子上最多能放多少个球。输入描述第1行有1个正整数n,表示柱子数。输出描述一行表示可以放的最大球数4样例输出。样例输入11题目限制(...

    02014年7月3日3,771二分法,最大流
  • 「NOIP模拟赛」超电磁炮

    「NOIP模拟赛」超电磁炮

    「题目描述」早苗入手了最新的超电磁炮。最新款自然有着与以往不同的功能,那就是它的轨迹是条直线,厉害吧。2维平面上有n个目标,任意2个目标的坐标不会相同。超电磁炮的威力强到穿透一切,那么早苗一枪最多能击中多少目标? 「输入格式」第1行:一个整数n,表示目标数量。第2-n+1行:每行有两个整数xi和yi(-2000000000≤xi,yi≤2000000000),表示第i个教徒在地图中的行、列坐标。 「输出格式」一个整数表示答案。&nbs...

    02014年6月27日3,187几何
  • 「CFgym100460B」Time of Trial

    「CFgym100460B」Time of Trial

    Eniaisindanger!EvildarkmageDeimosinvadedfromanotherworld,andnotalone,butwithcountlessarmyofdarkness.CourtmagicianIrdishadfailedtodefeatDeimosinthemagicduel,sohehidinthebasementofthepalaceanddecidedtostepbackthroughaportaltocallonehisoldacquaintanceforhelp.ButsuchaturnisnotinDeimos'plans,sohewantsnottoreleasehisopponentalive.Irdisknows n differentspellstocreateaportal,anyofwhichisaccepta...

    12014年6月22日3,364其它
  • 「BZOJ3504」[CQOI2014] 危桥

    「BZOJ3504」[CQOI2014] 危桥

    DescriptionAlice和Bob居住在一个由N座岛屿组成的国家,岛屿被编号为0到N-1。某些岛屿之间有桥相连,桥上的道路是双向的,但一次只能供一人通行。其中一些桥由于年久失修成为危桥,最多只能通行两次。Alice希望在岛屿al和a2之间往返an次(从al到a2再从a2到al算一次往返)。同时,Bob希望在岛屿bl和b2之间往返bn次。这个过程中,所有危桥最多通行两次,其余的桥可以无限次通行。请问Alice和Bob能完成他们的愿望吗?Input本...

    22014年6月21日5,504最大流
  • 「泉七培训 – 郑予凡」雷神领域

    「泉七培训 - 郑予凡」雷神领域

    此题数据水,各种骗分。。。二维偏序最长链,两个方向最小值40分。。。直接统计不同的x,y坐标个数输出最小值70分。。。正解似乎比较奇怪。。。懒得解释了[crayon-67aaab1fb7a2a559847893/] ...

    12014年6月21日2,766并查集
  • 「BZOJ2430」[POI2003] Chocolate

    「BZOJ2430」[POI2003] Chocolate

    Description有一块n*m的矩形巧克力,准备将它切成n*m块。巧克力上共有n-1条横线和m-1条竖线,你每次可以沿着其中的一条横线或竖线将巧克力切开,无论切割的长短,沿着每条横线切一次的代价依次为y1,y2,…,yn-1,而沿竖线切割的代价依次为x1,x2,…,xm-1。例如,对于下图6*4的巧克力,我们先沿着三条横线切割,需要3刀,得到4条巧克力,然后再将这4条巧克力沿竖线切割,每条都需要5刀,则最终所花费的代价为y1+y2+y3+4*(x1+x2...

    02014年6月20日2,923贪心
  • 「CF442C」Artem and Array

    「CF442C」Artem and Array

    Artemhasanarrayof n positiveintegers.Artemdecidedtoplaywithit.Thegameconsistsof n moves.Eachmovegoeslikethis.Artemchoosessomeelementofthearrayandremovesit.Forthat,hegetsmin(a, b) points,where a and b arenumbersthatwereadjacentwiththeremovednumber.Ifthenumberdoesn'thaveanadjacentnumbertotheleftorright,Artemdoesn'tgetanypoints.Aftertheelementisremoved,thetwopartsofthearraygluetoge...

    22014年6月20日3,701贪心
  • 「CF442B」Andrey and Problem

    「CF442B」Andrey and Problem

    Andreyneedsonemoreproblemtoconductaprogrammingcontest.Hehas n friendswhoarealwayswillingtohelp.Hecanasksomeofthemtocomeupwithacontestproblem.Andreyknowsonevalueforeachofhisfiends—theprobabilitythatthisfriendwillcomeupwithaproblemifAndreyaskshim.HelpAndreychoosepeopletoask.Asheneedsonlyoneproblem,Andreyisgoingtobereallyupsetifnoonecomesupwithaproblemorifhegetsmorethanoneproblemfromhisfr...

    02014年6月20日3,253概率与期望
  • 「CF442A」Borya and Hanabi

    「CF442A」Borya and Hanabi

    HaveyoueverplayedHanabi?Ifnot,thenyou'vegottotryitout!Thisproblemdealswithasimplifiedversionofthegame.Overall,thegamehas25typesofcards(5distinctcolorsand5distinctvalues).Boryaisholding n cards.ThegameissomewhatcomplicatedbythefactthateverybodyseesBorya'scardsexceptforBoryahimself.Boryaknowswhichcardshehasbutheknowsnothingabouttheordertheyliein.NotethatBoryacanhavemultipleidenticalcar...

    02014年6月20日4,194模拟
  • 「BZOJ3262」陌上花开

    「BZOJ3262」陌上花开

    Description有n朵花,每朵花有三个属性:花形(s)、颜色(c)、气味(m),又三个整数表示。现要对每朵花评级,一朵花的级别是它拥有的美丽能超过的花的数量。定义一朵花A比另一朵花B要美丽,当且仅当Sa>=Sb,Ca>=Cb,Ma>=Mb。显然,两朵花可能有同样的属性。需要统计出评出每个等级的花的数量。Input第一行为N,K(1<=N<=100,000,1<=K<=200,000),分别表示花的数量和最大属性值。以下N行,每行三个整数...

    02014年6月19日9,645treap,树套树,树状数组
  • 「CF252A」Valera and Antique Items

    「CF252A」Valera and Antique Items

    Valeraisacollector.Oncehewantedtoexpandhiscollectionwithexactlyoneantiqueitem.Valeraknows n sellersofantiques,the i-thofthemauctioned ki items.Currentlytheauctionpriceofthe j-thobjectofthe i-thsellerissij.Valeragetsonwellwitheachofthe n sellers.Heisperfectlysurethatifheoutbidsthecurrentpriceofoneoftheitemsintheauction(inotherwords,offersthesellerthemoneythatisstrictlygreaterthanthec...

    02014年6月19日2,533模拟
82 / 145 « 上一页 1 ...80 81 82 83 84 ...145 下一页 »